https://github.com/timwis/soda-geoservices
Query Esri Geoservices using a SODA2-style API
https://github.com/timwis/soda-geoservices
Last synced: 24 days ago
JSON representation
Query Esri Geoservices using a SODA2-style API
- Host: GitHub
- URL: https://github.com/timwis/soda-geoservices
- Owner: timwis
- License: mit
- Created: 2015-11-29T22:49:56.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-12-17T12:37:36.000Z (over 9 years ago)
- Last Synced: 2025-04-02T04:35:49.572Z (about 1 month ago)
- Language: JavaScript
- Size: 37.1 KB
- Stars: 7
- Watchers: 2
- Forks: 0
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SODA GeoServices
[](https://travis-ci.org/timwis/soda-geoservices)
[](https://coveralls.io/github/timwis/soda-geoservices?branch=master)
[](http://standardjs.com/)[](https://heroku.com/deploy)
Query [Esri Geoservices](http://geoservices.github.io/) using a [SODA2](https://dev.socrata.com/docs/queries/)-style API
This is still a work in progress. Check out the [list of features](https://github.com/timwis/soda-geoservices/issues/1) and
[tests](test/query.test.js) 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](http://geoservices.github.io/query.html#aggregation-statistics).
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](http://soda-geoservices.herokuapp.com/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)](http://soda-geoservices.herokuapp.com/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
1. Clone this repo and install dependencies via `npm install`
2. Copy `.env.sample` to `.env` and fill in `PROXY_TO` with the path to your Geoservices (ex. `http://maps2.dcgis.dc.gov/dcgis/rest/services/`)
and any default parameters in `DEFAULT_PARAMS` in `a=b&c=d` format
3. Run the server via `npm start`
4. Append the service to your URL and use SODA2 querystring parametersFor example:
```
http://localhost:8080/DDOT/AlleyConditions/MapServer/0?alley_material=Asphalt
```## Development
* Write tests first and run them via `npm test`
* Lint the code style via `npm run lint` (uses [standard](http://standardjs.com))## References
* [GeoServices Documentation](http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#/Query_Map_Service_Layer/02r3000000p1000000/)
* [SODA2 Documentation](https://dev.socrata.com/docs/queries/)
* [Supported functions for ArcGIS Server](http://resources.arcgis.com/en/help/main/10.2/index.html#//015400000686000000) (v10.2)
* [Validate SQL](https://services.arcgis.com/fLeGjb7u4uXqeF9q/arcgis/rest/services/APPEALS_LIRB/FeatureServer/0/validateSQL)## License
[MIT](LICENSE)