API reference - Rasters

/v1/elevation/hires-raster

Get a geotiff covering the specified area.

If you need the elevation for a grid of points, this is the endpoint for you. Compared to splitting up your grid into points (one per pixel) and making batch point requests, this endpoint will quickly calculate all the data you need in a single request.

The rectangular area must be smaller than 10 kmĀ², and the aspect ratio less than 1:100.

For the best accuracy and fastest response, use projection=best, res_m=best, and tight_bounds=false. Other parameter combinations trigger interpolation to produce the output raster, which takes longer and reduces accuracy.

HTTP request

GET https://api.gpxz.io/v1/elevation/hires-raster?bbox_left=-122.04&bbox_right=-122.03&bbox_bottom=37.357&bbox_top=37.37&res_m=2

Here's the same request, broken up over multiple lines for readability:

GET https://api.gpxz.io/v1/elevation/hires-raster?
    bbox_left=-122.04&
    bbox_right=-122.03&
    bbox_bottom=37.357&
    bbox_top=37.37&
    res_m=2

Request query parameters

  • bbox_top: Northmost latitude of the requested area. Required.
  • bbox_bottom: Southmost latitude. Required.
  • bbox_left: Westmost longitude. Required.
  • bbox_right: Eastmost longitde. Required.
  • res_m: Output raster resolution, in metres. Must be between 1 and 30 (inclusive), or best. Default: 1.
  • projection: Output raster projection. Either latlon (epsg:4326), utm, or best. Default: utm.
  • tight_bounds: If true make the output raster's bounds as close as possible to the input bbox, at the expense of lower accuracy due to interpolation. Default: false.

Response

A geotiff.

  • The mimetype is image/tiff; application=geotiff; profile=cloud-optimized.
  • For a non-200 status code, a standard json error message will be provided with mimetype application/json.
  • With tight_bounds=true and projection=latlon the output raster bounds will exatly match the provided bbox.
    • Otherwise, the output raster will likely be buffered slightly due to projection differences and accuracy optimisations.
  • Bathymetry is always included in the result.
  • Although the geotiff is cloud-optimized, this endpoint doesn't support range requests.
  • The sources used are returned in the x-data-sources header.