Query

Query Dataset List Post

Execute a READ-ONLY SQL query on the specified raster-based dataset version for a potentially large list of features. The features may be specified by an inline GeoJson feature collection, or a list of ResourceWatch geostore IDs, or the URI of vector file that is in any of a variety of formats supported by GeoPandas, include GeoJson and CSV format. For CSV files, the geometry column should be named "WKT" (not "WKB") and the geometry values should be in WKB format.

The specified sql query will be run on each individual feature, and so may take a while. Therefore, the results of this query include a job_id. The user should then periodically query the specified job via the /job/{job_id} api. When the "data.status" indicates "success" or "partial_success", then the successful results will be available at the specified "data.download_link". When the "data.status" indicates "partial_success" or "failed", then failed results (likely because of improper geometries) will be available at "data.failed_geometries_link". If the "data.status" indicates "error", then there will be no results available (nothing was able to complete, possible because of an infrastructure problem).

Limitations

  • The request payload must be under 256 KB. This limit does not apply to features provided in a file referenced using the uri field—use this option to include larger geometry data via an external file.

  • There is currently a five-minute time limit on the entire list query, but up to 100 individual feature queries proceed in parallel, so lists with several thousands of features can potentially be processed within that time limit.

post/dataset/{dataset}/{version}/query/batch

Request

  • Base URL: https://data-api.globalforestwatch.org (the document declares no server; this is the origin it was published from)
  • URL: https://data-api.globalforestwatch.org/dataset/{dataset}/{version}/query/batch
  • Auth: one of:
    • API key in query parameter x-api-key
    • API key in header x-api-key

Path parameters

datasetstring required
versionstring required

Request body

uristring

URI to a vector file in a variety of formats supported by Geopandas, including GeoJson and CSV format, giving a list of features on which to do the same query. For a CSV file, the column with the geometry in WKB format should be named 'WKT' (not 'WKB')

geostore_idsstring[]

An inline list of ResourceWatch geostore ids

id_fieldstring

Name of field with the feature id, for use in labeling the results for each feature. This field must contain a unique value for each feature. If geostore_ids are specified, then they will automatically be used as the feature id for labeling the results.

sqlstring required

Response

Successful Response

statusstring

Changes

No recorded changes to this operation across all 1 revision of this API.