Pushing the boundaries with the Open Geography Portal API

Contains National Statistics and OS data © Crown copyright and database right [YYYY]

Building an API query
Results returned from the API
Results returned from the API as a GeoJSON
Viewing a GeoJSON in geojson.io
library(sf)
sf <- st_read(“https://ons-inspire.esriuk.com/arcgis/rest/services/Administrative_Boundaries/Local_Authority_Districts_December_2018_Boundaries_UK_BGC/MapServer/0/query?where=lad18nm%20=%20%27Trafford%27&outFields=lad18cd,lad18nm,long,lat&outSR=4326&f=geojson")
plot(st_geometry(sf))
https://ons-inspire.esriuk.com/arcgis/rest/services/Administrative_Boundaries/Local_Authority_Districts_December_2018_Boundaries_UK_BGC/MapServer/0/query?where=lad18nm = ‘Trafford’&outFields=lad18cd,lad18nm,long,lat&outSR=4326&f=geojson
+--------------+--------------------------+---------------------+
| Parameter | Value | Description |
+--------------+--------------------------+---------------------+
| ’where’: | lad18nm = ‘Trafford’ | equal to 'Trafford' |
| ’outFields’: | lad18cd,lad18nm,long,lat | return attributes |
| ’outSR’: | 4326 | in lon/lat coords |
| ’f’: | geojson | in GeoJSON format |
+--------------+--------------------------+---------------------+
lad18nm IN ('Bolton','Bury','Manchester','Oldham','Rochdale','Salford','Stockport','Tameside','Trafford','Wigan')
https://ons-inspire.esriuk.com/arcgis/rest/services/Administrative_Boundaries/Local_Authority_Districts_December_2018_Boundaries_UK_BGC/MapServer/0/query?where=lad18nm IN ('Bolton','Bury','Manchester','Oldham','Rochdale','Salford','Stockport','Tameside','Trafford','Wigan')&outFields=lad18cd,lad18nm,long,lat&outSR=4326&f=geojson
Local authority district boundaries in Greater Manchester

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store