This repository lists resources useful when working with NYC Space/Time Directory data.
See http://spacetime.nypl.org/#data
See https://github.com/nypl-spacetime/spacetime-schemas
- Command line tools: https://github.com/nypl-spacetime/spacetime-cli
The examples below use the following tools:
- jq: command-line JSON processor, install with
brew install jq
- ndjson-cli: command-line tools for operating on newline-delimited JSON streams, install with
npm install -g ndjson-cli
- spacetime-cli: command-line tools for NYC Space/Time Directory data, install with
npm install -g nypl-spacetime/spacetime-cli
Download Map Warper data from the NYC Space/Time Directory and convert to a JSON array:
curl http://s3.amazonaws.com/spacetime-nypl-org/\
datasets/mapwarper/mapwarper.objects.ndjson \
| spacetime-to-json
Use jq to only display the ID and the area the map depicts:
curl http://s3.amazonaws.com/spacetime-nypl-org/\
datasets/mapwarper/mapwarper.objects.ndjson \
| spacetime-to-json | \
jq '.[] | {id: .id, area: .data.area}'
Use ndjson-filter to filter Building Inspector data by year, and save the resulting GeoJSON file to disk:
curl http://s3.amazonaws.com/spacetime-nypl-org/\
datasets/building-inspector/building-inspector.objects.ndjson \
| ndjson-filter 'd.validSince > 1880' | spacetime-to-geojson > \
~/Downloads/building-inspector-1880.geojson
Use ndjson-map to only display the ID and the name, and then grep for Harlem:
curl http://s3.amazonaws.com/spacetime-nypl-org/\
datasets/mapwarper/mapwarper.objects.ndjson \
| ndjson-map '`${d.id} - ${d.name}`' | grep Harlem
Download Map Warper data, filter maps which title includes broadway, convert to GeoJSON and copy to clipboard:
curl http://s3.amazonaws.com/spacetime-nypl-org/\
datasets/mapwarper/mapwarper.objects.ndjson \
| ndjson-filter 'd.name && d.name.toLowerCase().includes("broadway")' \
| spacetime-to-geojson | pbcopy
Then, we can paste this GeoJSON data into geojson.io: