-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
428 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
language: node_js | ||
|
||
node_js: | ||
- '0.12' | ||
- '0.10' | ||
sudo: false # Enable docker-based containers | ||
cache: | ||
directories: # Cache dependencies | ||
- node_modules | ||
|
||
script: | ||
- npm test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Change Log | ||
All notable changes to this project will be documented in this file. | ||
This project adheres to [Semantic Versioning](http://semver.org/). | ||
|
||
## [0.1.1] - 2015-05-06 | ||
### Added | ||
* Flattening all object based properties | ||
* ensuring that each feature contains each field | ||
|
||
## [0.1.0] - 2015-04-21 | ||
### Changed | ||
* This project now uses `standard` as its code formatting | ||
* Keeping a legit changelog | ||
* Added tape testing with sinon stubs in the controller tests | ||
|
||
[0.1.1]: https://github.com/Esri/koop/releases/compare/v0.1.0...v0.1.1 | ||
[0.1.0]: https://github.com/Esri/koop/releases/tag/v0.1.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,50 @@ | ||
## Socrata Provider for [Koop](https://github.com/Esri/koop) | ||
----------- | ||
|
||
This provider makes it possible to access [Socrata's JSON API](http://dev.socrata.com/docs/formats/json.html) as either GeoJSON or an Esri FeatureService. This is particular useful for making maps and doing analysis on the web. | ||
|
||
## Installation | ||
## Install | ||
|
||
To install/use this provider you first need a working installation of [Koop](https://github.com/Esri/koop). Then from within the koop directory you'll need to run the following: | ||
|
||
``` | ||
npm install https://github.com/chelm/koop-socrata/tarball/master | ||
``` | ||
``` | ||
npm install https://github.com/koopjs/koop-socrata/tarball/master | ||
``` | ||
|
||
## Register Socrata Hosts | ||
|
||
Once this provider's been installed you need to "register" a particular instance of Socrate with your Koop instance. To do this you make `POST` request to the `/socrata` endpoint like so: | ||
Once this provider's been installed you need to "register" a particular instance of Socrata with your Koop instance. To do this you make `POST` request to the `/socrata` endpoint like so: | ||
|
||
``` | ||
curl --data "host=https://data.nola.gov&id=nola" localhost:1337/socrata | ||
``` | ||
``` | ||
curl --data "host=https://data.nola.gov&id=nola" localhost:1337/socrata | ||
``` | ||
*for Windows users, download cURL from http://curl.haxx.se/download.html or use a tool of your choice to generate the POST request* | ||
|
||
What you'll need for that request to work is an ID and a the URL of the Socrata instance. The ID is what you'll use to reference datasets that come from Socrata in Koop. | ||
What you'll need for that request to work is an ID and the URL of the Socrata instance. The ID is what you'll use to reference datasets that come from Socrata in Koop. | ||
|
||
To make sure this works you can visit: http://localhost:1337/socrata and you should see all of the register hosts. | ||
|
||
## Access Socrata Data | ||
|
||
To access a dataset hosted in Socrata you'll need a "resource id" from Socrata. Datasets in Socrata can be accessed as raw JSON like this: | ||
To access a dataset hosted in Socrata you'll need a "Resource ID" from Socrata. Datasets in Socrata can be accessed as raw JSON like this: | ||
|
||
* [https://data.nola.gov/Geographic-Reference/NOLA-Short-Term-Rentals-Map/psp3-bvzw](https://data.nola.gov/Geographic-Reference/NOLA-Short-Term-Rentals-Map/psp3-bvzw) translates into -> https://data.nola.gov/resource/psp3-bvzw.json | ||
* [https://data.nola.gov/Health-Education-and-Social-Services/NOLA-Grocery-Stores/fwm6-d78i](https://data.nola.gov/Health-Education-and-Social-Services/NOLA-Grocery-Stores/fwm6-d78i) translates into -> https://data.nola.gov/resource/fwm6-d78i.json | ||
|
||
And then the ID `psp3-bvzw` can be referenced in Koop like so: | ||
And then the ID `fwm6-d78i` can be referenced in Koop like so: | ||
|
||
[http://koop.dc.esri.com/socrata/nola/psp3-bvzw](http://koop.dc.esri.com/socrata/nola/psp3-bvzw) | ||
http://koop.dc.esri.com/socrata/nola/fwm6-d78i | ||
|
||
If your Socrata data has more than one location column, you can specify the desired location column in the http request like this: | ||
|
||
https://path_to_koop/socrata/socrataProvider/dataSetID!spatialColumn | ||
|
||
## Handle Large Datasets | ||
|
||
The Socrata API defaults to 1000 results per request, but can be set to return up to 50,000. Koop will page through large datasets to capture all the points. To change the number of results per request, modify the 'limit' variable in the socrata.getResoruce function in models/Socrata.js. | ||
|
||
## Examples | ||
|
||
Here's a few examples of data hosted in Socrata and accessed via Koop | ||
Here are a few examples of data hosted in Socrata and accessed via Koop. | ||
|
||
* GeoJSON [http://koop.dc.esri.com/socrata/nola/psp3-bvzw](http://koop.dc.esri.com/socrata/nola/psp3-bvzw) | ||
* FeatureService [http://koop.dc.esri.com/socrata/nola/psp3-bvzw/FeatureServer/0] | ||
* All of the publicly registered Socrata instances [http://koop.dc.esri.com/socrata](http://koop.dc.esri.com/socrata) | ||
* GeoJSON: http://koop.dc.esri.com/socrata/nola/fwm6-d78i | ||
* FeatureService: http://koop.dc.esri.com/socrata/nola/fwm6-d78i/FeatureServer/0 | ||
* All publicly registered Socrata instances: http://koop.dc.esri.com/socrata |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.