Geocoding

Geocoding is the process of encoding an address into a latitude & longitude coordinate. With Naurt, this takes on a slightly different form. Instead of responding with a single coordinate, Naurt will respond with a GeoJSON containing the building's entrances, parking zones, and outline.

Requests

All requests should be sent to Naurt's final-destination endpoint.

POST
https://api.naurt.net/final-destination/v1

Addresses

The simplest way to request Naurt data is via an address.

A POST request should be sent to the final-destination endpoint containing a JSON with the address that is to be searched.

JSON
{
  "address_string": "The Martha Gunn, 100 Upper Lewes Road, Brighton & Hove, United Kingdom, BN2 3FE",
  "country": "UK"
}
Currently supported country tags are:
  • UK: United Kingdom
  • SG: Singapore

Don't forget to include the API key in the Authorization header.

curl
curl -X POST \
-H 'Content-type: application/json' \
-H 'Authorization: <API-KEY-HERE>' \
-d '{"address_string":"The Martha Gunn, 100 Upper Lewes Road, Brighton & Hove, United Kingdom, BN2 3FE", "country": "UK"}' \
'https://api.naurt.net/final-destination/v1'
Python
import requests

API_KEY = "<API-KEY-HERE>"

url = "https://api.naurt.net/final-destination/v1"

json_request = {
  "address_string": "The Martha Gunn, 100 Upper Lewes Road, Brighton & Hove, United Kingdom, BN2 3FE", "country": "UK"
}

response = requests.post(
  url,
  json=json_request,
  headers={
      "Authorization": API_KEY,
  },
)

print(response.text)

Address and Location

If there are multiple similar addresses to the one you are searching, it might be useful to limit your search to a smaller area. For this, Naurt also allows you to specify a latitude & longitude, and optionally a distance_filter which defaults to 5000 metres. When used, only results within that distance of the provided position will be returned.

The distance_filter should always be specified in metres. It has a maximum value of 25,000 metres, a minimum value of 0 metres, and a default value of 5000 metres which applies even if this parameter is not provided.

JSON
{
  "address_string": "The Martha Gunn, 100 Upper Lewes Road, Brighton & Hove, United Kingdom, BN2 3FE",
  "latitude": 50.8353,
  "longitude": -0.1277,
  "distance_filter": 100,
  "country": "UK"
}
curl
curl -X POST \
-H 'Content-type: application/json' \
-H 'Authorization: <API-KEY-HERE>' \
-d '{"address_string":"The Martha Gunn, 100 Upper Lewes Road, Brighton & Hove, United Kingdom, BN2 3FE", "latitude": 50.8353, "longitude": -0.1277, "distance_filter": 100, "country": "UK"}' \
'https://api.naurt.net/final-destination/v1'
Python
import requests

API_KEY = "<API-KEY-HERE>"

url = "https://api.naurt.net/final-destination/v1"

json_request = {
  "address_string": "The Martha Gunn, 100 Upper Lewes Road, Brighton & Hove, United Kingdom, BN2 3FE",
  "latitude": 50.8353,
  "longitude": -0.1277,
  "distance_filter": 100,
  "country": "UK"
}

response = requests.post(
  url,
  json=json_request,
  headers={
      "Authorization": API_KEY,
  },
)

print(response.text)

Responses

Within each response, Naurt provides a best_match to the requested address. As you'd expect, this is what Naurt believes to be the most relevant address for your request. However, by setting additional_matches: true in the body of your request, you can receive up to 4 additional matches which are relevant.

For each match Naurt provides the address and a GeoJSON containing the building entrances, parking zone, and building outline. Building entrances are type MultiPoint, and parking zones and building outlines are type Polygon,

An example response can be seen below plotted and as the GeoJSON response.


Request
curl -X POST \
-H 'Content-type: application/json' \
-H 'Authorization: <API-KEY-HERE>' \
-d '{"address_string":"The Martha Gunn, 100 Upper Lewes Road, Brighton & Hove, United Kingdom, BN2 3FE", "country": "UK"}' \
'https://api.naurt.net/final-destination/v1'
Response
{
  "best_match": {
    "address": "The Martha Gunn, 100 Upper Lewes Road, Brighton & Hove, United Kingdom, BN2 3FE",
    "geojson": {
      "features": [
        {
          "geometry": {
            "coordinates": [
              [
                -0.128205,
                50.835318
              ]
            ],
            "type": "MultiPoint"
          },
          "properties": {
            "naurt_type": "naurt_door"
          },
          "type": "Feature"
        },
        {
          "geometry": {
            "coordinates": [
              [
                [
                  -0.128108,
                  50.835308
                ],
                [
                  -0.128171,
                  50.835335
                ],
                [
                  -0.128264,
                  50.835289
                ],
                [
                  -0.128172,
                  50.835251
                ],
                [
                  -0.128108,
                  50.835308
                ]
              ]
            ],
            "type": "Polygon"
          },
          "properties": {
            "naurt_type": "naurt_building"
          },
          "type": "Feature"
        },
        {
          "geometry": {
            "coordinates": [
              [
                [
                  -0.128297,
                  50.835282
                ],
                [
                  -0.128332,
                  50.83531
                ],
                [
                  -0.128161,
                  50.835393
                ],
                [
                  -0.128126,
                  50.835365
                ],
                [
                  -0.128297,
                  50.835282
                ]
              ]
            ],
            "type": "Polygon"
          },
          "properties": {
            "naurt_type": "naurt_parking"
          },
          "type": "Feature"
        }
      ],
      "type": "FeatureCollection"
    },
    "id": "53f4017b-ef4b-6c3f-09d3-4a5e1a6d7e31",
    "version": "1.0.0"
  },
  "contributors": [
    "© OpenStreetMap contributors"
  ]
}