Skip to content

BrightPowerSoftware/nyc-geocoder-api

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nyc-geocoder-api

A simple geocoder for NYC. Similar to the NYC's official geoclient api, but with far fewer bells and whistles.

All the heavy lifting is done by:

How to use

There's only one endpoint with 3 ways to submit an address:

  1. House, Street, and Borough
curl https://geocode.nycdb.info/?house=1000&street=surf avenue&borough=brooklyn
  1. House, Street, and Zipcode
curl https://geocode.nycdb.info/?house=1000&street=surf avenue&zipcode=11224
  1. Address
curl https://geocode.nycdb.info/?address=1000 Surf Avenue Brooklyn, NY 11224

All of those requests return the same json object:

{
  "bbl": "3086960212",
  "latitude": 40.57436,
  "longitude": -73.978499,
  "status": "OK"
}

Response format

Successful responses contains a simple JSON object with 4 fields: bbl, latitude, longitude, status.

Responses with errors have one or two fields: status and message. If present, the message field will contain information that might help you figure out what went wrong.

Example error:

This request:

curl https://geocode.nycdb.info/?house=1000&street=Surf%20Avenue

Returns this error:

{
	"status":"ERROR",
	"message":"Missing parameter: zipcode or borough"
}

That's it! There's no authorization and no other information provided besides bbl, latitude and longitude.

Installation

NOTE: This has not tested on anything other Debian-based systems. As currently setup it almost certainly won't work on other OSs.

setup geosupport and libpostal

make setup libpostal

Install ruby gems:

bundle install

Setup geosupport paths

source libgeo-paths 

Run:

ruby app.rb

Run the tests:

rspec test.rb

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 84.6%
  • Makefile 13.2%
  • Shell 2.2%