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 |
|
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 |
---|---|
400 | 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=Maskavas iela&street2=Plostu iela
Response:
[
{
"street1": {
"rank": "0.0991032",
"id": "1000041977",
"name": "Maskavas iela",
"pop_place": "Rīga",
"the_geom": "MULTILINESTRING((24.1104866192 56.9438138403,24.1107903116 56.9436833099,24.1110875794 56.9436381291,24.1116673638 56.943597186,24.1118337014 56.9435700872,24.1119149784 56.9435448316,24.1124154755 56.9433061663,24.1125805249 56.9432235498),(24.1137109631 56.9428470394,24.1135376247 56.9428972731,24.1133903623 56.9429399496,24.1127528769 56.9432266248,24.1125805249 56.9432235498),(24.1125805249 56.9432235498,24.1126184657 56.9431081194,24.1128287109 56.9429718587,24.1130709451 56.9428599912,24.1134536354 56.9427549746),(24.1134536354 56.9427549746,24.1137109631 56.9428470394) ... )"
},
"street2": {
"rank": "0.0991032",
"id": "1000038280",
"name": "Plostu iela",
"pop_place": "Rīga",
"the_geom": "MULTILINESTRING((24.1927643999 56.9042939774,24.1929001964 56.9043532268,24.1934447528 56.9045908199,24.1938741871 56.904777378,24.1949673963 56.90522486,24.1956978716 56.9054797537,24.1958236776 56.9054975236,24.1959005992 56.9054884189),(24.196486676 56.9058962556,24.1982216052 56.9066795853),(24.1991579964 56.9071452468,24.1983668598 56.9065895186))"
},
"intersection": "POINT(24.192764 56.904294)"
}
]