List neighbouring areas
Find the areas that share a border with this one, longest shared border first. Just what you need for "how does this ward compare with the ones around it?".
/areas/{geography}/{release}/{code}/neighboursGood to know
- Set
touches=anyto include areas that only meet at a corner. TheirsharedBorderMis zero.
geographystringrequiredA geography type id, e.g.
constituencyorward.releasestringrequiredA boundary release id, e.g.
2024-07-uk-bgc, orlatestfor the geography's newest release: the one/boundary-releases:resolvechooses for the furthest date. A response tolatestnames the release it read inContent-Location. A geography whose newest month holds several releases that differ in more than coverage, or that has a release whose id carries no month, is refused with409and the releases that could be newest.codestringrequiredThe official source code for this area on this boundary release.
touchesstringoptionaledgefor areas sharing a border with length;anyto include areas meeting only at a point.One ofedgeanyDefaultedge
Returns
AreaNeighboursEnvelopeThe neighbouring areas, ordered by shared border, longest first.
apiVersionv1requiredatlasReleasestringrequiredThe immutable
/atlas-releasereleaseIdfor the artifacts that produced this response.metaobjectrequiredShowHide1 child field
nextCursorstring | nullrequiredOpaque cursor for the next page, or null at the end.
dataAreaNeighboursrequiredShowHide10 child fields
idstringrequiredgeographystringrequiredboundaryReleasestringrequiredcodestringrequirednamestringrequiredaliasesstring[]optionaltouchesstringrequiredOne ofedgeanyborderobjectrequiredShowHide4 child fields
perimeterMnumberrequiredsharedBorderMnumberrequiredBorder shared with the neighbours returned.
unsharedBorderMnumberrequiredThe remainder: coastline, a national boundary, or a border with an area outside this release. Nothing for a landlocked area.
pointOnlyTouchesintegerrequiredAreas meeting only at a point, counted whether or not
touchesreturned them.
methodobjectrequiredShowHide4 child fields
rulestringrequiredsharedBorderstringrequiredunsharedstringrequiredlimitsstringrequired
neighboursAreaInRelease[]requiredShowHide11 child fields
idstringrequiredgeographystringoptionalboundaryReleasestringoptionalcodestringrequirednamestringrequiredaliasesstring[]optionaltouchstringrequiredOne ofedgepointsharedBorderMnumberrequiredZero for a point touch.
shareOfPerimeternumberrequiredThe shared border as a fraction of this area's own perimeter.
sharedEdgesintegerrequiredsharedVerticesintegerrequired
- 400
touchesis neitheredgenorany. - 404Either no compiled area matches that identity, or the area exists but no feature for its code was found in the raw geometry source.
- 503The area exists but its geometry cannot be served: no raw source is declared, or its CRS has no transformation to WGS84.
Every error has the same shape. See Errors for how to handle them.
Show the precise behaviourHide the precise behaviour
Returns the areas next to this one within the same geography and release, each with the length of the border they share. This supports local comparison, map navigation and spatial modelling: "how does this ward compare with the ones around it" needs to know which those are.
Neighbours are found from shared vertices, not from a distance threshold. Adjacent areas in one published release are drawn from the same vertices, so a common border is the same coordinates on both sides and matches exactly; the shared length is summed over those edges, each counted once, with ground length from the ellipsoid's radii of curvature. Nobody picks a tolerance, and nothing is approximate.
touches decides whether areas meeting at a single point count. edge, the default, returns only areas sharing a border with length; any also returns those meeting at a corner, whose sharedBorderM is zero. Four areas at a crossroads are not neighbours of each other in any sense useful for comparison or for colouring a map, so they are excluded unless asked for; border.pointOnlyTouches counts them either way, so their exclusion is visible rather than silent. They are real: none occur between local authorities, while about 3% of ward adjacencies are corners.
border totals the perimeter, the border shared with the neighbours returned, and the remainder. For a landlocked area the remainder is nothing; otherwise it is coastline, a national boundary, or a border with an area outside this release. Birmingham shares 100% of its perimeter across seven neighbours; the Isle of Wight has none, and all 188.7 km of its boundary is its own.
Within one geography and release only. Two areas that genuinely touch on the ground but were drawn from different vertices are not found, which is why this is not offered across releases.