1.0.0 • Published 10 years ago
soda-geoservices v1.0.0
SODA GeoServices
Query Esri Geoservices using a SODA2-style API
This is still a work in progress. Check out the list of features and tests to get an idea for the functionality.
Why?
Geoservices are incredibly powerful but have a complex query structure as a result, and can be intimidating for new users - particularly when you want to do a basic query like a group by. This tool provides a layer of abstraction - an easy-to-use API for common queries. It is not meant to cover the breadth of functionality geoservices provide; rather just those provided by the SODA2 spec.
Examples
Using https://services.arcgis.com/fLeGjb7u4uXqeF9q/ArcGIS/rest/services
- /Storefront_Improvement_Programs/FeatureServer/0
- /Storefront_Improvement_Programs/FeatureServer/0?relations=Mayfair CDC(http://soda-geoservices.herokuapp.com/Storefront_Improvement_Programs/FeatureServer/0?relations=Mayfair CDC)
- /Storefront_Improvement_Programs/FeatureServer/0?$select=funded_by, count(*)&$group=funded_by(http://soda-geoservices.herokuapp.com/Storefront_Improvement_Programs/FeatureServer/0?$select=funded_by, count(*)&$group=funded_by)
- /Storefront_Improvement_Programs/FeatureServer/0?$select=extent(geometry)
- /Storefront_Improvement_Programs/FeatureServer/0?$where=within_circle(geometry, 39.9520, -75.1646, 100)(http://soda-geoservices.herokuapp.com/Storefront_Improvement_Programs/FeatureServer/0?$where=within_circle(geometry, 39.9520, -75.1646, 100))
- /Storefront_Improvement_Programs/FeatureServer/0?$where=within_box(geometry, 39.9537, -75.1577, 39.9623, -75.1422)(http://soda-geoservices.herokuapp.com/Storefront_Improvement_Programs/FeatureServer/0?$where=within_box(geometry, 39.9537, -75.1577, 39.9623, -75.1422))
Usage
- Clone this repo and install dependencies via
npm install - Copy
.env.sampleto.envand fill inPROXY_TOwith the path to your Geoservices (ex.http://maps2.dcgis.dc.gov/dcgis/rest/services/) and any default parameters inDEFAULT_PARAMSina=b&c=dformat - Run the server via
npm start - Append the service to your URL and use SODA2 querystring parameters
For example:
http://localhost:8080/DDOT/AlleyConditions/MapServer/0?alley_material=AsphaltDevelopment
- Write tests first and run them via
npm test - Lint the code style via
npm run lint(uses standard)
References
- GeoServices Documentation
- SODA2 Documentation
- Supported functions for ArcGIS Server (v10.2)
- Validate SQL
License
1.0.0
10 years ago