niwa / geoapis

A Python package for simply downloading publicly available web-hosted geo-spatial data. View API docs at: https://niwa.github.io/geoapis/
MIT License
9 stars 3 forks source link

Add support for pulling vector data from ArcGIS Hub / ArcGIS sites #3

Closed rosepearson closed 2 years ago

rosepearson commented 2 years ago

Various entities host data on the ArcGIS Hub. It appears that this data can be accessed directly from the Hub by searching for the datasets name, or through an 'opendata' site i.e. data-kiwirail. Note the /search is needed to view a list of all datasets.

API calls exist to download an individual dataset and are accessed by clicking the blue banner 'I want to use this' followed by 'View API Resources'. Two API Queries exist - GeoService or GeoJSON:

It seems we will want a generic class for accessing any data hosted on the ArcGIS Hub. If we go with the GeoJSON URL's can be read directly in geopandas. See webpage

image

rosepearson commented 2 years ago

NZ Rail Network

https://data-kiwirail.opendata.arcgis.com/datasets/nz-railway-network/explore?location=-40.961529%2C-6.706994%2C5.89 https://services6.arcgis.com/eqX2HMCD3H8MUs6Q/arcgis/rest/services/NZ_Rail_Network/FeatureServer/0/query?outFields=*&where=1%3D1 https://opendata.arcgis.com/datasets/0b38bbe20d3f4ebdab4e15e90ba3edbc_0.geojson

Rail Bridges

https://data-kiwirail.opendata.arcgis.com/datasets/kiwirail-bridges/explore?location=-41.040850%2C-7.517550%2C5.89 https://services6.arcgis.com/eqX2HMCD3H8MUs6Q/arcgis/rest/services/KiwiRailBridges/FeatureServer/0/query?outFields=*&where=1%3D1 https://opendata.arcgis.com/datasets/5eb673fcdc244ec1ae0b3d84dbd534d1_0.geojson

Rail Tunnels

https://data-kiwirail.opendata.arcgis.com/datasets/kiwirail-tunnels/explore?location=-41.300650%2C-7.574900%2C5.93 https://services6.arcgis.com/eqX2HMCD3H8MUs6Q/arcgis/rest/services/KiwiRailTunnels/FeatureServer/0/query?outFields=*&where=1%3D1 https://opendata.arcgis.com/datasets/ff8eab5a0724475ca2c1ff4855050d59_0.geojson

rosepearson commented 2 years ago

Given this is a one line operation and there is no real need to construct the URL from the base site - I am going to close this case. We can always reopen it if we want to add support for removing geopandas/geojson features outside a search polygon. CC @Pooja3894