Road information API

The API allows to get specific information about the Latvian state roads by given coordinates.

API URL

The request URL should match the following pattern:

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

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
x x-coordinate in a Web Mercator projection (EPSG:3857)
y y-coordinate in a Web Mercator projection (EPSG:3857)

Error codes

Status code Description
200 no coordinates were passed.
404 No location found. The URL is not recognized; the resource does not exist.
5xx Server error.

Examples

Input:

https://api.kartes.lv/v3//roaddetail?x=2751386.663054411&y=7707654.346166896

Response:

{
  "type": "FeatureCollection",
  "name": "Road Detail",
  "crs": {
    "type": "name",
    "properties": {
      "name": "urn:ogc:def:crs:EPSG::3857"
    }
  },
  "features": [
    {
      "type": "Feature",
      "geometry": null,
      "properties": {
        "geom": "{\"type\":\"LineString\",\"coordinates\":[[2751443,7707713],[2751379,7707663]]}",
        "kategorija": "25",
        "klase": "A1",
        "klase_v": "A",
        "segums": "3",
        "rajons": "Ogres nodaļa",
        "distance": "6.39132735250261"
      }
    }
  ]
}