Uses node-soda2-parser to provide a Socrata-style SODA2 API in front of a postgres database
- Clone the repo
- Install dependencies via
npm install
- Create a copy of
.env.sample
named.env
and fill in the values, pointing it to a postgres database with postgis enabled
git clone https://github.com/timothyclemansinsea/soql-for-cartodb.git
cd soql-for-cartodb/
npm install
To run a SODA2 API server, use node index.js
Then query the API using SODA2 calls, ie. http://localhost:8080/resource/table_name?$select=*&zip_code=19141
A demo server with the Heart Healthy Screening Sites dataset provides the following examples.
- [$select=zip_code, screening_type, geom](http://104.236.214.217/resource/sites?$select=zip_code, screening_type, geom)
- $select=zip_code, count(*)&$group=zip_code
- [$select=convex_hull(geom) AS hull&zip_code=19146](http://104.236.214.217/resource/sites?$select=convex_hull(geom) AS hull&zip_code=19146)
- $where=within_box(geom, -75.182324, 39.949259, -75.170769, 39.934494)
- $where=within_circle(geom, -75.163406, 39.952503, 1000)
- $where=within_polygon(geom, 'MULTIPOLYGON (((-75.184290 39.926206,-75.168267 39.930942,-75.159473 39.923000,-75.171159 39.917874,-75.184290 39.926206)))')