Overlays

An overlay is a separate data layer that you put on top of the vector map. The basemap stays the same; the overlay data is updated on its own and reaches the map by itself. Overlays work with all map styles.

Contents

Cadastral parcels

The boundaries of Estonian cadastral parcels with the cadastral code, land use purpose, area and address. The data is updated every month. The map attribution has the form Katastriüksuste piirid: Maa- ja Ruumiamet DD.MM.YYYY, where the date is the date of the data (data version). It comes from the TileJSON and the map library shows it below the map by itself; with a new data version the date changes too. If you show the data in another way, add the same attribution.

The base URL is https://api.elemroot.com; all addresses need the parameter key.

AddressContent
/tiles/v2/elemroot-cadastre-v1.jsonTileJSON, current data version (start here)
/tiles/v2/elemroot-cadastre-v1/{data_version}.jsona specific data version
/tiles/v2/elemroot-cadastre-v1/{data_version}/{z}/{x}/{y}.mvttiles (MVT)

The key is the same as for the vector map: it needs the vector map (tiles) service right. Overlay requests are counted like vector map requests. The tiles are at zoom levels 12–16 and cover Estonia; closer in, the map library scales up the z16 tiles, so the boundaries are visible at high zoom too.

The layer is also in the map app: maps.elemroot.com (menu “More” → “Cadastral parcels”).

Cadastre on the map (MapLibre GL JS)

Add the TileJSON as a source and put the boundaries below the style layer metadata["elemroot:before_id"]: this keeps street names and other labels above the cadastral boundaries (see your own layers on the map). An invisible fill makes the parcel clickable.

const map = new maplibregl.Map({
  container: 'map',
  attributionControl: { compact: true },
  style: 'https://api.elemroot.com/styles/v2/daylight/style.json?key=docs_3d4e64fa1755d7299cb78bf6',
  center: [24.7365, 59.4448],
  zoom: 16
});

map.on('load', () => {
  const beforeId = map.getStyle().metadata['elemroot:before_id'];
  map.addSource('cadastre', {
    type: 'vector',
    url: 'https://api.elemroot.com/tiles/v2/elemroot-cadastre-v1.json?key=docs_3d4e64fa1755d7299cb78bf6'
  });
  map.addLayer({
    id: 'cadastre-area', type: 'fill', source: 'cadastre', 'source-layer': 'cadastre', minzoom: 14,
    paint: { 'fill-color': '#000000', 'fill-opacity': 0 }
  }, beforeId);
  map.addLayer({
    id: 'cadastre-line', type: 'line', source: 'cadastre', 'source-layer': 'cadastre', minzoom: 14,
    paint: {
      'line-color': '#a3417b',
      'line-width': ['interpolate', ['linear'], ['zoom'], 14, 0.5, 16, 0.9, 19, 1.6]
    }
  }, beforeId);
});

map.on('click', 'cadastre-area', (e) => {
  const p = e.features[0].properties;
  new maplibregl.Popup()
    .setLngLat(e.lngLat)
    .setText(p.tunnus + ' · ' + p.purpose + ' · ' + p.area_m2 + ' m²')
    .addTo(map);
});

In a city one z13 tile holds thousands of parcels; the boundaries are readable from z14 (minzoom: 14). A dark line suits a light basemap; on the orthophoto (style hybrid) a light line with a dark casing. Changing the style with setStyle removes the added source and layers; add them again after the change.

Layers and fields

LayerContentZoom
cadastrecadastral parcels as areas (polygons)12–16
cadastre_labelone point inside each parcel, field tunnus; for a cadastral code label at high zoom16
Field (cadastre)TypeContent
tunnustextcadastral code, for example 78401:001:0049
addresstextaddress of the parcel; several addresses are separated by //
purposetextland use purpose as a code (see land use purposes)
purpose_pctnumbershare of the purpose in per cent
purpose2textsecond land use purpose; empty if there is none
purpose2_pctnumbershare of the second purpose; only when there is a second purpose
area_m2numberregistered area in square metres
settlementtextsettlement unit or city district, for example Kesklinna linnaosa
municipalitytextmunicipality, for example Tallinn

Example of the fields of one parcel:

{
  "tunnus": "78401:001:0049",
  "address": "Lastekodu tn 42",
  "purpose": "ELAMUMAA",
  "purpose_pct": 90,
  "purpose2": "ARIMAA",
  "purpose2_pct": 10,
  "area_m2": 1296,
  "settlement": "Kesklinna linnaosa",
  "municipality": "Tallinn"
}

Land use purposes

The fields purpose and purpose2 are codes in capital letters without diacritics:

CodeEstonian nameLand use purpose
ELAMUMAAElamumaaResidential land
ARIMAAÄrimaaCommercial land
TOOTMISMAATootmismaaIndustrial land
MAATULUNDUSMAAMaatulundusmaaAgricultural and forest land
TRANSPORDIMAATranspordimaaTransport land
ULDKASUTATAV_MAAÜldkasutatav maaPublic open space
UHISKONDLIKE_EHITISTE_MAAÜhiskondlike ehitiste maaLand for public buildings
SOTSIAALMAASotsiaalmaaSocial land
KAITSEALUNE_MAAKaitsealune maaProtected land
RIIGIKAITSEMAARiigikaitsemaaNational defence land
VEEKOGUDE_MAAVeekogude maaWater body land
MAETOOSTUSMAAMäetööstusmaaMining land
TURBATOOSTUSMAATurbatööstusmaaPeat extraction land
JAATMEHOIDLA_MAAJäätmehoidla maaWaste disposal land
SIHTOTSTARBETA_MAASihtotstarbeta maaLand without a designated purpose

Data version

The data version is the date of the cadastral data in the form YYYYMMDD (TileJSON field elemroot:data_version). The unversioned TileJSON always points to the current data version, so new data reaches the map by itself. The server keeps the last three data versions; the addresses of an older version return 404.

ResourceCache-Control
Tiles at the address with a data versionpublic, max-age=31536000, immutable
Tiles at the unversioned addresspublic, max-age=86400 (24 h)
TileJSONpublic, max-age=3600 (1 h)

Error handling

CodeMeaning
403Wrong or missing key, or the key lacks the vector map (tiles) service right: body {"error":"invalid_api_key"}
204Empty tile (no cadastral parcels there, for example the sea): normal
404Zoom outside the range 12–16 or an unknown data version