https://github.com/mdb/phl-geocode
A Node.js module for getting latitude and longitude coordinates for a Philadelphia address.
https://github.com/mdb/phl-geocode
Last synced: 10 months ago
JSON representation
A Node.js module for getting latitude and longitude coordinates for a Philadelphia address.
- Host: GitHub
- URL: https://github.com/mdb/phl-geocode
- Owner: mdb
- Created: 2012-11-11T15:19:20.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2013-05-25T13:28:32.000Z (about 13 years ago)
- Last Synced: 2025-06-21T13:42:03.093Z (12 months ago)
- Language: JavaScript
- Homepage:
- Size: 216 KB
- Stars: 4
- Watchers: 1
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[](https://travis-ci.org/mdb/phl-geocode)
# phl-geocode
A Node.js module for getting latitude and longitude coordinates for a Philadelphia addresses.
phl-geocode is based on the geolocation component of [Mark Headd](http://twitter.com/mheadd)'s [phlfindpolls gist](https://gist.github.com/4015200).
The module uses Philadelphia's [311 Mobile Data Service API](http://services.phila.gov/ULRS311).
## Getting Started
Install phl-geocode:
npm install phl-geocode
Require and instantiate phl-geocode:
var phlGeocode = require('phl-geocode')();
Default settings:
{
geoHost: 'http://services.phila.gov',
locationPath: '/ULRS311/Data/Location/',
minConfidence: 85
responseBody: ''
}
Overriding default settings on instantiation:
var phlGeocode = require('phl-geocode')({
minConfidence: 100
});
## Example Usage
Get latitude and longitude coordinates for a Philadelpia address:
phlGeocode.getCoordinates('1500 market street', function (err, data) {
console.log(data);
/* Example response:
[ { address: '1500 MARKET ST',
similarity: 100,
latitude: 39.9521740263203,
longitude: -75.1661518986459 },
{ address: '1500S MARKET ST',
similarity: 99,
latitude: 39.9521740263203,
longitude: -75.1661518986459 } ]
*/
});