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:
| Service | What it does | Endpoint |
|---|---|---|
| Address search (geocoding) | address text β coordinate + address components + address id; autocomplete | https://pump.elemroot.com/jgc_rest/geocode |
| Reverse geocoding | coordinate β nearest address | https://pump.elemroot.com/rgc4/revgeocode |
| Address selection (gazetteer) | address tree for dropdowns (county β β¦ β apartment), id β address | https://pump.elemroot.com/Gazetter/β¦ |
| Routing | route between points: length, time, line; directions and stop ordering (ESRI) | https://pump.elemroot.com/LogismeRouting/SURRouting |
| Vector maps | MapLibre style + vector tiles (EE/LV/LT in detail, world at overview zooms) | https://api.elemroot.com/styles/v1/elemroot/style.json |
| Raster maps | pre-rendered PNG/JPEG tiles (XYZ, WMTS): map and orthophoto, EPSG:3857 and L-EST97 | https://pump.elemroot.com/xyz/{layer}/{z}/{x}/{y}.png |
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
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:
| Parameter | Meaning |
|---|---|
q required | Address to geocode. |
gl required | Dataset ID, e.g. ee_aid. |
key required | API key. Without it, 403. |
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.
4. Output format
Choose the format with output (default json):
output | Content |
|---|---|
json | Hierarchical address (xAL tree): default |
json2 | Flat structured address (AddressLines) |
xml / xml2 | Same two structures as XML |
kml | Google Earth KML |
ads_liik_staatus | Address type/status XML (when the server allows it) |
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).
_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.