Skip to content

Roads

Stable
Only available in Canada

GET /intersections

Use this endpoint to list the closest major intersections (within 10km) to a given point.

As of 2020-03-26, intersections involving controlled-access freeways, as well as intersections involving only local streets, are not returned.

Payload details:

  • As of 2020-03-26, only the single closest intersection will be returned.
  • For each intersection returned, a list of the intersecting streets is provided. Usually, each intersection only involves two streets, but in some cases, there will be more (for example, when a street changes names at an intersection). The list will be sorted by street hierarchy, from highest hierarchy class (highway) to lowest (local street); as such, if only two streets are needed, the first two will generally be the best to use.
  • A name is provided for each street. More fields for each street may be added in future.
  • If no intersections are found within 10 km, the intersections list will be empty. A message clarifying what happened can be found in the meta key.
  • The distance to the specified lat/lng is provided in the distance key. As of 2020-03-26, only straight_line (linear, Euclidean) distances will be returned, rather than distances through the street network. Technicality: the straight-line distance is actually the geodesic / great-circle distance.
GET /intersections

QueryString Request Parameters

ParameterStatusDescription
latrequiredA decimal number between -90 and 90 (latitude)
lngrequiredA decimal number between -180 and 180 (longitude)
keyrequiredThe API Key provided for you

NodeJS example

require('request')({
method: 'GET',
url: 'https://api.locallogic.co/v1/intersections',
qs: {
lat: 49.26312,
lng:-123.09855,
limit: 1
},
headers: {
'X-API-KEY': 'API_KEY'
}
}, function (err, response, body) {
// See response example
})

200 - Response example

{
"data": {
"type": "intersections",
"attributes": {
"intersections": [{
"streets": [{
"name": "Scotia Street",
"class": "Local"
},
{
"name": "East Broadway",
"class": "Major artery"
}
],
"geometry": {
"lng": -123.09898499999997,
"lat": 49.26285259900004
},
"distance": {
"units": "meters",
"straight_line": 43
}
}]
}
},
"meta": {
"code": "LocalLogic.API.Success",
"detail": "Successfully found one or more intersections"
}
}
Edit this page on GitHub
1 contributorjpvalery
Last edited by jpvalery on July 20, 2020