Salta el contingut

Metadata API

API URL

Endpoint api/v2/giscube/search/
Example https://xxxxxxx.xxxxxxx.xxx/apps/giscube-admin/api/v2/giscube/search/

Authentication

Authentication is required to access this API. In other words, a token must be sent to the server.

This can be sent in two ways:

  • access_token parameter in a GET request
Parameter access_token
Example https://xxxxxxx.xxxxxxx.xxx/giscube-admin/api/v2/giscube/search/?access_token=JIFbeOLxkW87wvu3a5at9164IGv7w7
  • HTTP Header
Parameter Authorization
Example Authorization=Bearer JIFbeOLxkW87wvu3a5at9164IGv7w7

Generate Token

Example of a call to generate a token

CLIENT_ID=b84uwJOlbtjeTAtThoazZFssE4RimQh3kyEiA8Z2

USERNAME=example

PASSWORD=example

curl -X POST -d "client_id=$CLIENT_ID&grant_type=password&username=$USERNAME&password=$PASSWORD" \

  https://xxxxxxx.xxxxxxx.xxx/apps/giscube-admin/o/token/

API Parameters

Text Search
Parameter q
Description Search by text matching in fields ‘name’, ‘title’, ‘keywords’, ‘metadata.provider_name’, ‘category.title’, ‘description’
Example q=escoles
Date Search
Parameter d
Description Search by metadata.data. Search by year or date range (comma-separated) Format: yyyy
Example https://xxxxxxx.xxxxxxx.xxx/apps/giscube-admin/api/v2/giscube/search/?d=2010,2020
https://xxxxxxx.xxxxxxx.xxx/apps/giscube-admin/api/v2/giscube/search/?d=2020
Notes Search for a specific year or a range of years
Element Type Search
Parameter e
Description Search by element type: giscube.dataset, imageserver.service, qgisserver.service, layerserver.geojsonlayer, layerserver.databaselayer
Example https://xxxxxxx.xxxxxxx.xxx/apps/giscube-admin/api/v2/giscube/search/?e=giscube.dataset
Distance Search
Description Search for elements that intersect at a distance from a point
Parameter p
Parameter Description Pair of decimals, coordinates, corresponding to longitude and latitude, separated by a comma. Decimals must be in English format
Parameter r
Parameter Description Radius in meters. Default 25 meters. Optional.
Parameter epsg
Parameter Description Indicates the coordinate system of the geometry. Example: epsg=25831. Optional. Default 4326.
Example https://xxxxxxx.xxxxxxx.xxx/apps/giscube-admin/api/v2/giscube/search/?p=1.111068,41.144431
Intersection with a Geometry
Description Search for elements that intersect with the bounding box (bbox) geometry
Parameter intersects
Parameter Description Geometry in wkt format
Parameter epsg
Parameter Description Indicates the coordinate system of the geometry. Example: epsg=25831. Optional. Default 4326
Example https://xxxxxxx.xxxxxxx.xxx/apps/giscube-admin/api/v2/giscube/search/?intersects=LINESTRING(1.0968840476263697%2041.15210198069979,1.1035788413275416%2041.14919367735578,1.1106169577826197%2041.15126181742966)
Within Bounds of a Geometry
Description Search for elements that are completely within a specified geometry
Parameter contains
Parameter Description Geometry in wkt format
Parameter epsg
Parameter Description Indicates the coordinate system of the geometry. Example: epsg=25831. Optional. Default 4326
Example https://xxxxxxx.xxxxxxx.xxx/apps/giscube-admin/api/v2/giscube/search/?contains=POLYGON((-1.6796875000000178%2045.320172290013765,6.582031249999982%2045.320172290013765,6.582031249999982%2037.8389415037292,-1.6796875000000178%2037.8389415037292,-1.6796875000000178%2045.320172290013765))