Set query
The Set Query API allows users to look up a point location and get back information from a set.
A set is a collection of data layers and tables that can be viewed downloaded at one time. Publishers use sets to enable users to access datasets that are commonly grouped together.
Differences to vector and raster APIs
Section titled “Differences to vector and raster APIs”The set query API returns similar information to the Vector and Raster API endpoints, with a few notable differences
- You query a single set, not a number of layers. You don’t have to know what layers are in the set before you query it.
- Layers are returned in the correct order, in a JSON list rather than an object. Both vector and grid layers from the set will be included.
- Each layer returned contains its ID and title, since you might not already have them.
The endpoint depends on the Koordinates site you’re using. On koordinates.com it’s:
https://koordinates.com/services/query/v1/setQuery the layers in a set at a pointFormats
Section titled “Formats”The sets API returns in JSON:
content-type: application/vnd.koordinates.vectorQuery+json
Formats can be specified via URL. For example: https://koordinates.com/services/query/v1/set.json?key=YOUR_API_KEY&set=SET_ID&x=LONGITUDE&y=LATITUDE
They can also be specified using the HTTP Accept header with the appropriate content-type against the base URL. For example: application/vnd.koordinates.vectorQuery-1+json
By default, all responses use the newest format. While we try very hard to prevent backwards-incompatible breaks, please note that it may happen in future
If you’re using the URL endpoint (for example, set.json) you can pass a &v=1 parameter to specify version 1.
Compression
Section titled “Compression”Add a request header with Accept-Encoding: gzip to get compressed results. This dramatically reduces the size of the response and will speed up your API requests.
Parameters
Section titled “Parameters”key required
- Your Koordinates API key, unless you send it in an
Authorization: key YOUR_API_KEYheader instead
x required
- Longitude (WGS84 decimal degrees) of the point to query
- range: -180 to 180
y required
- Latitude (WGS84 decimal degrees) of the point to query
- range: -90 to 90
radius
- Radius (m) within which to search
- default: 1000
- range: 0 to 100000
geometry
- Include geometries with the result
- default: false
with_field_names
- Include field names with the result
- default: false
precision
- Number of decimal places for GeoJSON geometry coordinates
- default: 8
- range: 0 to 15
set required
- ID of the set to query. Only one set can be queried at a time; passing
setmore than once returns a 400 error
max_results
- Maximum number of features to return for each layer
- default: 1
- range: 1 to 5