How to query

 

Basics of querying data from OGC APIs
 

APIs in this platform are all based on OGC API standards, which can be seen as newer versions for OGC Web Services, such as Web Feature Service (WFS) and Web Map Service (WMS).

OGC APIs are more interoperable, newer and easy to use. You only need to understand the most important resources to form a query that retrieves data from OGC APIs. The exact query syntax and parameters vary depending on the specific OGC API type and implementation. However, most queries are constructed on the same hierarchical pieces.

For example, the example of OGC API Features query:

  1. https://locationeurope.eu/geoe3/api/buildings is the landing page of the GeoE3 buildings API.
  2. https://locationeurope.eu/geoe3/api/buildings/collections lists feature collections (= data sets) that are offered through the API.
  3. https://locationeurope.eu/geoe3/api/buildings/collections/buildings_FI describes the feature collection named ‘buildings_FI’ that contains buildings from Finland.
  4. https://locationeurope.eu/geoe3/api/buildings/collections/buildings_FI/items presents the features that are in the collection named ‘buildings_FI’.
  5. https://locationeurope.eu/geoe3/api/buildings/collections/buildings_FI/items/f83036f2-f1f9-46cf-b844-06f11c3c60e3:5?f=html presents the feature with unique ID ‘f83036f2-f1f9-46cf-b844-06f11c3c60e3:5' using HTML format.
  6. https://locationeurope.eu/geoe3/api/buildings/collections/buildings_FI/items/f83036f2-f1f9-46cf-b844-06f11c3c60e3:5?f=json presents the feature ‘f83036f2-f1f9-46cf-b844-06f11c3c60e3:5’ in GeoJSON format (requires a valid API key).

 

The example above had only one additional parameter (f for format) but also more can be added after the question mark to select only a subset of the features in the collection. A BBOX or datetime parameter may be used to select only the subset of the collection features within the bounding box specified by the BBOX parameter or the time interval specified by the datetime parameter. The limit parameter may be used to control the page size by specifying the maximum number of features that should be returned in the response.

Each page may include information about the number of selected and returned features (‘numberMatched’ and ‘numberReturned’) as well as links to support paging (link relation ‘next’). Usually, the fastest way to check data is to write a query directly to a web browser. Another option is to use the command line, programming languages or some (GIS) software. See our How to use API key page for instructions on adding the API key to your command line queries.

For more information about OGC APIs, please visit the Service Management course of Location Innovation Academy . You can register and learn more for free.

 

Query examples
 

Request maximum one thousand HTML-encoded buildings from the Netherlands inside the given bounding box.
https://locationeurope.eu/geoe3/api/buildings/collections/buildings_NL/items?bbox=5.98699299002497,52.20603373570634,5.989407671305245,52.20829096113201&f=html&limit=1000

Request an individual building in GeoJSON format from Norway (requires a valid API key).
https://locationeurope.eu/geoe3/api/buildings/collections/buildings_NO/items/Building.192987695?f=json

Create a cross-collection query for buildings in Finland and Norway using a BBOX that crosses the boundary between Finland and Norway. The results are formatted in GeoJSON (requires a valid API key).
https://locationeurope.eu/geoe3/api/buildings/search?collections=buildings_FI,buildings_NO&bbox=27.048426848946182,69.91250293786004,27.06727569146675,69.91818900263786&f=json&limit=1000

Create a cross-collection query for buildings in Finland, Norway, The Netherlands and Spain without a BBOX. limit=1, so each service returns only one feature. The results are again formatted in GeoJSON (requires a valid API key).
https://locationeurope.eu/geoe3/api/buildings/search?collections=buildings_FI,buildings_NO,buildings_NL,buildings_ES&f=json&limit=1

Cross-collection query for DSM in Finland and Norway using a BBOX that crosses the boundary between Finland and Norway. The result is visualised as a PNG image (requires a valid API key).
https://locationeurope.eu/geoe3/api/dsm/search?collections=dsm_NO,dsm_FI&subset=x(1756108.1026075305:3748915.483376724),y(10110879.3898928:11705125.294508154)&scale-size=x(1000),y(800)&f=png

Location Europe

The Location Europe data integration platform provides harmonised location data from different countries across Europe. The Location Europe is part of Location Innovation Hub and their networks.

Accessibility statement

European Union logo

LIH logo