1

Is it possible to retrieve json/geojson boundaries using the ONS Open Geography Portal API, if so how?

I have got my apikey and gone through the documentation though I am not seeing any mention of boundary data.

If you visit the page http://geoportal.statistics.gov.uk/datasets/afcc88affe5f450e9c03970b237a7999_0

The API dropdown gives links like the ones below:

http://geoportal.statistics.gov.uk/datasets/afcc88affe5f450e9c03970b237a7999_0.geojson

And the link for a filtered dataset is showing as:

http://geoportal.statistics.gov.uk/datasets/afcc88affe5f450e9c03970b237a7999_0.geojson?where=&geometry={"xmin":-7777680.618944722,"ymin":6062179.402493376,"xmax":7113475.483456216,"ymax":8997361.288643364,"spatialReference":{"wkid":102100,"latestWkid":3857}}

Visiting the related site http://statistics.data.gov.uk/ you can retrieve a json boundary from a url like below which is more what I was expecting.

http://statistics.data.gov.uk/boundaries/E05009755.json
1
  • Try this www.boundaries-io.com . A simple API that returns GeoJson bundaries for postal district , sector and unit codes. It does cost $25 bucks a month,check out their Facebook page for example results.....*I work for them*
    – Jeryl Cook
    Oct 28, 2017 at 22:37

1 Answer 1

1

To get a single boundary you can add a where query to the URL, filtering on the relevant geographic code (in this case wd16cd).

https://ons-inspire.esriuk.com/arcgis/rest/services/Administrative_Boundaries/Wards_December_2016_Boundaries/MapServer/0/query?where=wd16cd=%27E05009755%27&outFields=*&outSR=4326&f=geojson

This URL gives you a geojson, as in the statistics.data.gov.uk example. To get the ESRI JSON format change f=geojson to f=json.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.