Glass API – Section MetaData using the EPOS ICS Portal

Endpoint /stations/v2/bbox/{minLon}/{minLat}/{maxLon}/{maxLat}

This endpoint returns all the stations inside the bounding box. The output format is GeoJson.

The parameters are the dimensions of the bounding box so they are all mandatory.

The coordinates shown in the example form a rectangle around Portugal.

maxLat

The maximum Latitude of the bounding box

  • 44.08
maxLon

The maximum Longitude of the bounding box

  • -5.53
minLat

The minimum Latitude of the bounding box

  • 35.10
minLon

The minimum Latitude of the bounding box

  • -12.21
Example Links
  • https://glass.c4g-pt.eu/GlassFramework/webresources/stations/v2/station/bbox/-32.5/29.22/14.58/49.03

Endpoint /stations/v2/geojson/{format}/{geojson}

This endpoint returns all stations that are inside the geometry of geoJSON.

All parameters are mandatory.

format

The format of the output

  • json
  • geojson
geojson

The geojson input that must be made on the following website:https://geojson.io/

You need to copy all the json code after drawing the figure on the map, after that you can use the following page to minimize the geojson to ensure that it is correctly read by the API: https://codebeautify.org/jsonminifier

Then you just need to place the geojson in the respective field

Example Links
  • https://glass.c4g-pt.eu/GlassFramework/webresources/stations/v2/station/bbox/-32.5/29.22/14.58/49.03

Type of Errors Explanation

Code 200
  • Ok -> Everything went well and results returned
Code 204
  • The response to your request is empty, please check the request made or check the information in the database.
Code 400
  • Bad Request -> Check the entered parameters;Verifies that the API server link is correct; Checks the entered parameters.; If everything above is fine, then the API may not be working.
  • SocketException -> The connection was closed without the results being returned, something may be wrong in the connection with the database.
  • SQLException -> An error in the SQL queries, probably some information that you wanted to retrieve has an error or there is no connection in a table.
  • ClassNotFoundException -> The Java class could not be found, this implies a serious error in the API, probably a compilation/installation error.