Skip to content

A Node.js module for getting latitude and longitude coordinates for a Philadelphia address.

Notifications You must be signed in to change notification settings

PhillyCDO/phl-geocode

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status

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's phlfindpolls gist.

The module uses Philadelphia's 311 Mobile Data Service API.

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 (d) {
  console.log(d);

  /* 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 } ]
  */
});

About

A Node.js module for getting latitude and longitude coordinates for a Philadelphia address.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published