Reverse geocoding

The API finds an address based on given coordinates.

API URL

The request URL should match the following pattern:

https://api.kartes.lv/v3//reverse_geocoding?

By default, the response is given in JSON (JSONP and XML are also available).

The HTTP GET request method is used.

  • client_key: Your authorisation key.

Query parameters

The request consists of the following GET parameters:

Parameter Description Possible values
x x-coordinate in the TM Baltic93 CRS (EPSG:25884).
y y-coordinate in the TM Baltic93 CRS (EPSG:25884).
lat Latitude coordinate in the WGS-84 projection (EPSG:4326)
lon Longitude coordinate in the WGS-84 projection (EPSG:4326)
returnTerritUnitAfter If this parameter is used, only territorial unit and administrative unit is returned. The minimum distance in meters, when this approach should work, should be defined. number (meters)
result_data_type Output format. JSON is the default option.
  • json
  • jsonp
  • xml
callback Use it if you use result_data_type=jsonp.

Response parameters

The response consists of a single element. It has following parameters:

Parameter Description
valsts Country.
admin_vien Administrative unit.
terit_vien Territorial unit.
apdz_vieta Populated place (city, town or other settlement).
iela Street or road name.
maja House number or name.
index Postal code.
vzd_id The unique address identifier.
distance Distance in meters from the given point to the returned address.
x x-coordinate in the TM Baltic93 CRS (EPSG:25884) of the address.
y y-coordinate in the TM Baltic93 CRS (EPSG:25884) of the address.
lon Longitude coordinate in the WGS-84 projection (EPSG:4326) of the address.
lat Latitude coordinate in the WGS-84 projection (EPSG:4326) of the address.

Examples

Input:

https://api.kartes.lv/v3//reverse_geocoding?x=509679&y=6314169

Response:

{
    "valsts":"Latvija",
    "admin_vien":"Rīga",
    "terit_vien":"Vidzemes priekšpilsēta",
    "apdz_vieta":"Rīga",
    "iela":"Brīvības gatve",
    "maja":"197A",
    "index":"LV-1039",
    "korpuss":"",
    "vzd_id":"101867023",
    "distance":25,
    "x":"509679.56",
    "y":"6314193.80",
    "lon":24.1592171,
    "lat":56.97122225,

}

Input:

https://api.kartes.lv/v3//reverse_geocoding?lat=57.208140&lon=24.773591

Response:

{
  "valsts": "Latvija",
  "admin_vien": "Krimuldas novads",
  "terit_vien": "Krimuldas pagasts",
  "apdz_vieta": "",
  "iela": "",
  "maja": "Akmeņi",
  "index": "LV-2144",
  "korpuss": "",
  "vzd_id": "104910650",
  "distance": 99,
  "x": "546816.85",
  "y": "6340771.40",
  "adrese": "Akmeņi, Krimuldas pag., Krimuldas nov., Latvija",
  "lon": 24.775007,
  "lat": 57.207688
}