Developer platform

Geocoding, addresses and kilometre markers

Turn addresses and kilometre markers into coordinates and back, and check an address before a truck is sent there.

Runs on: Google Geocoding for addresses. Markers use OpenStreetMap geometry and markers, plus the Rijkswaterstaat road register for Dutch hectometre posts.

Endpoints

EndpointPermissionWhat it does
POST /location/geocode/addressGeoReferencegeoCode:addressGeoReferenceCoordinates for an address.
POST /location/geocode/validateAddressGeoReferencegeoCode:addressGeoReferenceWhether an address exists, with its formatted form.
POST /location/geocode/markerReferencegeoCode:markerReferenceCoordinates for a road, rail or waterway marker, such as hectometre post A15 Re 45.3.
POST /location/reverseGeocode/markerReferencegeoCode:markerReferenceThe marker on the nearest numbered road, rail line or waterway for a point.

Base URL https://api.transportial.com/api. Send x-api-key and x-api-secret, from an API access integration holding the permission above. Missing or invalid credentials answer 401; an integration without the permission answers 403.

Validate before you plan

The validation endpoint returns valid, the formatted address and partialMatch, which is true when only part of the input was recognised. Use it at order entry, while someone can still correct the address.

Kilometre, hectometre and mile markers

On a motorway, a driver with a breakdown says "A15, right side, post 45.3", not an address. The marker endpoint turns that into coordinates on the right carriageway. The reverse endpoint turns a vehicle position into the marker, for messages to drivers, roadside assistance and incident reports.

The same request works for rail line kilometres and river or canal kilometres. In the US and Canada, markers restart at every state or province line, so send the region as well.

Where the numbering jumps

Marker numbers are not measured distance. When a road is realigned, its posts keep their old numbers, so the numbering skips or repeats. Between two known markers the position is interpolated; where the numbering does not match the distance, it is counted from the nearer marker instead. Each result says how it was derived and how far away the nearest known marker is.

Example

Validate an address

The type field is required: the address model is part of a family of location types.

Call
curl -X POST "https://api.transportial.com/api/location/geocode/validateAddressGeoReference" \
  -H "x-api-key: $TRANSPORTIAL_KEY" \
  -H "x-api-secret: $TRANSPORTIAL_SECRET" \
  -H "Content-Type: application/json" \
  -d @request.json
request.json
{
  "type": "addressGeoReference",
  "street": "Weena",
  "houseNumber": "505",
  "postalCode": "3013 AL",
  "city": "Rotterdam",
  "country": "NL"
}
Response
{
  "valid": true,
  "formattedAddress": "...",
  "partialMatch": false,
  "latLonPointGeoReference": { "lat": 0, "lon": 0 }
}

Response shape only; the values depend on your engine and input.

Find hectometre post A15 Re 45.3

Re is the right-hand carriageway, where the numbering increases. The result lies 0.6 m from the position in the Dutch road register.

Call
curl -X POST "https://api.transportial.com/api/location/geocode/markerReference" \
  -H "x-api-key: $TRANSPORTIAL_KEY" \
  -H "x-api-secret: $TRANSPORTIAL_SECRET" \
  -H "Content-Type: application/json" \
  -d @request.json
request.json
{
  "countryCode": "NL",
  "ref": "A15",
  "value": 45.3,
  "side": "Re"
}
Response
{
  "success": true,
  "results": [
    {
      "mode": "road",
      "countryCode": "NL",
      "ref": "A15",
      "value": 45.3,
      "unit": "km",
      "direction": "increasing",
      "side": "right",
      "point": { "lat": 51.869052, "lon": 4.312396 },
      "quality": { "method": "interpolated", "nearestKnownMarkerMetres": 0.0, "approximate": false }
    }
  ]
}

Describe a vehicle position as a marker

Without ref and countryCode, every numbered line near the point is tried and the country is looked up.

Call
curl -X POST "https://api.transportial.com/api/location/reverseGeocode/markerReference" \
  -H "x-api-key: $TRANSPORTIAL_KEY" \
  -H "x-api-secret: $TRANSPORTIAL_SECRET" \
  -H "Content-Type: application/json" \
  -d @request.json
request.json
{
  "lat": 51.869048,
  "lon": 4.312403
}
Response
{
  "success": true,
  "results": [
    {
      "mode": "road",
      "countryCode": "NL",
      "ref": "A15",
      "value": 45.3,
      "unit": "km",
      "direction": "increasing",
      "side": "right",
      "point": { "lat": 51.869053, "lon": 4.312402 },
      "distanceFromLineMetres": 0.5,
      "quality": { "method": "interpolated", "nearestKnownMarkerMetres": 0.0, "approximate": false }
    }
  ]
}

The second result, the opposite carriageway 40.6 m away, is left out.

Limits worth knowing

  • The geocode endpoint returns 0,0 when nothing is found; treat that as no result.
  • The first request for a marker line downloads it. When that takes more than about 20 seconds, the answer is 503 line_loading with Retry-After; after that the line answers at once for 30 days.
  • Marker coverage follows OpenStreetMap, plus the Dutch road register. Where few markers are known, quality.approximate is true.

Questions

Does this create a location?
No. These endpoints only look up the address or marker.
What is a hectometre post?
A small sign every 100 m along Dutch and Belgian roads, with the road number, the carriageway (Re or Li) and the distance, such as 45.3. Other countries use kilometre or mile markers in the same way.