Getting started

Every example on this page works as is: copy the curl command into a terminal, the public demo key is already included. You will make three requests (address β†’ coordinates, coordinates β†’ address, a route between two points) and pick a suitable output format and coordinate reference system.

1. Endpoints

Each service has its own URL:

ServiceWhat it doesEndpoint
Address search (geocoding)address text β†’ coordinate + address components + address id; autocompletehttps://pump.elemroot.com/jgc_rest/geocode
Reverse geocodingcoordinate β†’ nearest addresshttps://pump.elemroot.com/rgc4/revgeocode
Address selection (gazetteer)address tree for dropdowns (county β†’ … β†’ apartment), id β†’ addresshttps://pump.elemroot.com/Gazetter/…
Routingroute between points: length, time, line; directions and stop ordering (ESRI)https://pump.elemroot.com/LogismeRouting/SURRouting
Vector mapsMapLibre style + vector tiles (EE/LV/LT in detail, world at overview zooms)https://api.elemroot.com/styles/v1/elemroot/style.json
Raster mapspre-rendered PNG/JPEG tiles (XYZ, WMTS): map and orthophoto, EPSG:3857 and L-EST97https://pump.elemroot.com/xyz/{layer}/{z}/{x}/{y}.png
Vector maps use a different base URL. Vector maps live at api.elemroot.com (not pump.elemroot.com) and also use the key parameter: see Vector maps.

2. Authentication

Every service requires an API key: pass it with each request as the key query parameter. Without a key (or with a wrong one) the server responds 403. The key carries server-side permissions: which services are enabled and whether, for example, extended data (xd=true) is allowed.

...&key=docs_382d376eaaa6d004b7b93b7d
Demo key. The docs_… key used in the examples is a public demo key for trying the API: it rotates regularly (the examples on this site always carry the current one) and it is rate-limited; overly frequent requests get 429. For your own application, request a personal key.

All services return the Access-Control-Allow-Origin: * header (also on error responses); in the browser you can use plain fetch() from any page. For older clients the geo services also support JSONP (callback).

3. Three requests: address β†’ coordinate β†’ address β†’ route

1) Geocode the address Muuseumi tee 2 against the Estonian address dataset (ee_aid):

curl "https://pump.elemroot.com/jgc_rest/geocode?q=Muuseumi+tee+2&gl=ee_aid&output=json&key=docs_382d376eaaa6d004b7b93b7d"

Three parameters are required:

ParameterMeaning
q requiredAddress to geocode.
gl requiredDataset ID, e.g. ee_aid.
key requiredAPI key. Without it, 403.
If you need address components as separate fields (county, street, house number, postal code, address id), add output=json2. The default json returns only the address text, coordinates and accuracy.

The response contains point.coordinates: [26.74628263, 58.39577394]: longitude, latitude.

2) Reverse geocode the same point back to an address (NB the input is lat,lon):

curl "https://pump.elemroot.com/rgc4/revgeocode?q=58.39577394,26.74628263&gl=ee_lt_lv&output=json&s=ADDRESS&key=docs_382d376eaaa6d004b7b93b7d"

Response: "address":"EE, Tartu maakond, Tartu linn, Tartu linn, Muuseumi tee 2", distance in metres (β‰ˆ0 here).

3) Compute a route from Muuseumi tee 2 to the Town Hall Square (input E,N = lon,lat; summary only by default):

curl "https://pump.elemroot.com/LogismeRouting/SURRouting?pref=Fastest&start=26.74628263,58.39577394&end=26.72210014,58.37978616&output=json&key=docs_382d376eaaa6d004b7b93b7d"

Response: TotalDistance β‰ˆ 3 844 m, TotalTime β‰ˆ 8 min; add noRouteGeom=false for the route line.

A map on your page. The vector-map quickstart is 15 lines of HTML with the ready-made style; see the vector maps guide; raster tiles with Leaflet/OpenLayers see the raster maps guide. Working examples with code: examples.elemroot.com.

4. Output format

Choose the format with output (default json):

outputContent
jsonHierarchical address (xAL tree): default
json2Flat structured address (AddressLines)
xml / xml2Same two structures as XML
kmlGoogle Earth KML
ads_liik_staatusAddress type/status XML (when the server allows it)
Dataset-specific. For dataset ee_aid, json returns address components only in the Accuracy field; full components (street, EHAK, postal code, etc.) come from json2 output. See the guide.

5. Coordinate reference system

Default is EPSG:4326 (WGS84, degrees). For the Estonian projected system (metres) use srs=EPSG:3301 (L-EST97):

curl "https://pump.elemroot.com/jgc_rest/geocode?q=Muuseumi+tee+2&gl=ee_aid&srs=EPSG:3301&key=docs_382d376eaaa6d004b7b93b7d"

Coordinates are always returned in order [E, N]: the first value points east, the second north. In degrees (EPSG:4326) that means [longitude, latitude]. For EPSG:3301 (L-EST97, metres) the same order is written [Y, X] in the Estonian convention: the first value is Y (east), the second X (north); in the Estonian system the X axis points north, so a larger X means a point further north.

Next: every service guide

Every service has the same layout: overview (1 example) β†’ guide (parameters, β€œwhen to use what”, pitfalls, error handling) β†’ API reference (Swagger UI + OpenAPI YAML).

Address search β†’ Autocomplete, bulk requests, address id, extended data, JSONP. Reverse geocoding β†’ Point to address, components, _reverse, coordinate pitfalls. Address selection β†’ Dropdown cascade, id β†’ address, parent objects, Estonia/Latvia/Lithuania. Routing β†’ Route line, via points, L-EST97, ESRI interface, directions, stop optimisation. Vector maps β†’ MapLibre quickstart, your own style from TileJSON, fonts, QGIS. Raster maps β†’ XYZ and WMTS, orthophoto, EPSG:3301 grid, Leaflet/OpenLayers/QGIS. Address picker (component) β†’ Search, levels and map on your page with one script. Examples gallery – examples.elemroot.com β†— Copyable code for every service, working with the public URLs.