get_boundary_geojson_by_code
Fetch the full GeoJSON geometry for a UK boundary by its ONS census code.
Returns a GeoJSON Feature object (WGS-84 / EPSG:4326) suitable for rendering on a map or performing geometric analysis. The geometry can be large — county and ceremonial county polygons are especially heavy. Only call this when you specifically need the shape; for metadata only use get_boundary_by_code() instead.
IMPORTANT — Leaflet / web maps: use get_boundary_geojson_simplified() instead. The full geometry is large enough to exhaust your context window before you can finish writing the page. The simplified version is safe to embed directly in HTML and indistinguishable from the full shape at normal map zoom levels.
Use this tool only when you need full-fidelity geometry for server-side analysis (e.g. precise point-in-polygon checks, area calculations, clipping).
Obtain the census code from search_boundaries_by_name() or find_boundaries_at_point() before calling this.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | ONS census / GSS / LAU code, e.g. "E09000012" for Hackney. Case-insensitive. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |