Raster Query
Raster Query
Description:
The raster query API allows users to get value(s) at given location(s) from a raster. You need to setup the database properly to use this API.
Endpoint:
https://gws.gplates.org/raster/query
Parameters:
-
lon : longitude [-180, 180]
-
lat : latitude [-90, 90]
-
lons : a list of longitudes
-
lats : a list of latitudes
-
raster_name : the name of the raster
-
fmt: if set to "json", the server will return the data in JSON format.
Return:
Return the values at the given locations. Return nan or null if the data is missing in the raster.
If "fmt=json" is given, for a single location, the server will return data in JSON format.
For multiple locations, the server always returns data in JSON format.
Examples:
👉 E1: get raster value for a single location
Click this link to try this example in a web browser.
Alternatively, use curl command.
curl "https://gws.gplates.org/raster/query?lon=90&lat=-20&raster_name=age_grid_geek_2007"
👉 E2: get raster value for a single location, return data in JSON format
Click this link to try this example in a web browser.
Alternatively, use curl command.
curl "https://gws.gplates.org/raster/query?lon=90&lat=-20&raster_name=age_grid_geek_2007&fmt=json"
👉 E3: get raster values for multiple locations
Click this link to try this example in a web browser.
Alternatively, use curl command.
curl "https://gws.gplates.org/raster/query?raster_name=age_grid_geek_2007&lons=90,150,40,92&lats=-15,67,20,-12"