Intersections API

The API returns coordinates of an intersection or intersections for two specified streets.

API URL

The request URL should match the following pattern:

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

The response is given in JSON.

The HTTP GET request method is used.

Query parameters

The request consists of the following GET parameters:

Parameter Description Possible values
cs CRS
  • wgs84 - Latitude and longitude in the WGS-84 projection (EPSG:4326).
  • lks - x- and y- coordinates in the TM Baltic93 CRS (EPSG:25884).
street1 Street
street2 Cross-street
pop_place Populated place for both streets

Response parameters

The response contains an object with the specified structure:

  • street1:
    • rank
    • id
    • name - street or road name
    • pop_place - populated place (city, town or village)
    • the_geom - geometry WKT
  • street2:
    • rank
    • id
    • name - street or road name
    • pop_place - populated place (city, town or village)
    • the_geom - geometry WKT
  • intersection - intersection coordinates

Error codes

Status code Description
200 Wrong input data. Server can’t respond due to client error.
404 No location found. The URL is not recognized; the resource does not exist.
5xx Server error.

Examples

Input:

https://api.kartes.lv/v3//intersection?street1=Latgales iela&street2=Plostu iela

Response:

[
  {
    "street1": {
      "rank": "0.0991032",
      "id": "1000042359",
      "name": "Latgales iela",
      "pop_place": "Rīga",
      "the_geom": "MULTILINESTRING((24.130026 56.939708,24.131882 56.93953,24.132558 56.939481,24.133578 56.939407,24.134182 56.939452,24.134893 56.939509,24.136644 56.93962,24.136982 56.939618,24.137492 56.939605,24.137861 56.939582,24.138065 56.939555,24.138673 56.939424,24.139201 56.939284,24.139709 56.939118,24.13995 56.93902,24.140055 56.938975,24.140794 56.938663,24.141418 56.938468,24.142617 56.938117,24.143204 56.93804,24.143534 56.938014,24.145216 56.937881,24.146204 56.937875,24.146957 56.937858,24.147669 56.937848,24.14784 56.937842,24.149848 56.937814... )"
    },
    "street2": {
      "rank": "0.0991032",
      "id": "1000019049",
      "name": "Plostu iela",
      "pop_place": "Rīga",
      "the_geom": "MULTILINESTRING((24.192815 56.90427,24.192951 56.904329,24.193486 56.904564,24.193896 56.904745,24.194126 56.904864,24.194988 56.905215,24.195711 56.905498,24.195847 56.905502,24.195905 56.905486,24.196035 56.905426),(24.196487 56.905896,24.198222 56.90668),(24.199158 56.907145,24.198732 56.906846,24.198367 56.90659))"
    },
    "intersection": "POINT(24.192815 56.90427)"
  }
]