A Python library for geocoding with NYC Planning's Geosupport Desktop Edition.
Developed using version 17C
of Geosupport Desktop Edition.
Install Geosupport Desktop Edition:
- Geosupport Desktop Edition for Windows (32-bit)
- Geosupport Desktop Edition for Windows (64-bit)
- Geosupport Desktop Edition for Linux
Windows users: Ensure you select the correct Geosupport installation that corresponds to the Python interpreter you are using. Ex., Python 32-bit will only work with Geosupport 32-bit.
Additionally, you should check that the following environmental variables are set:
GEOFILES
= thefls
directory of your Geosupport installation. (ex.C:\Program Files (x86)\Geosupport Desktop Edition\fls\
)- The Geosupport
bin
directory is in thePATH
. (ex.C:\Program Files (x86)\Geosupport Desktop Edition\bin
)
Linux users: Extract the .zip to a folder of your choice and set the GEOFILES
and LD_LIBRARY_PATH
environmental variables of the fls
and lib
directories like so:
$ export GEOFILES=/var/geosupport/version-17c/fls
$ export LD_LIBRARY_PATH=/var/geosupport/version-17c/lib/
-
Install via pip:
pip install python-geosupport
-
Import the library and create an instance:
from geosupport import Geocode g = Geocode()
-
Geocode with:
Single input street address
result = g.address(address="125 Worth st, NY, NY")
Parsed street address (Must provide zip code or borough)
result = g.address(house_number="125", street="Worth st", zip=10013) result = g.address(house_number="125", street="Worth st", boro='MANHATTAN')
Borough, Block, and Lot
result = g.bbl(boro='1', block='00168', lot='0032')
BIN
result = g.bin(bin='1001831')
Placename
result = g.place(place='VAN CRTLANDT MANSION', boro='bronx')
Intersection
result = g.intersection(street_1='ST NICHOLAS AVENUE', street_2='MENAHAN STREET', boro='QUEENS')
Street Segment
result = g.street_segment(on_street='STORY AVENUE', cross_street_1='EVERGREEN AVENUE', cross_street_2='WHEELER AVENUE', boro='BRONX')
Blockface
result = g.blockface(on_street='STORY AVENUE', cross_street_1='EVERGREEN AVENUE', cross_street_2='WHEELER AVENUE', boro='BRONX', compass_direction='N')
Street Stretch
result = g.street_stretch(on_street='CLIFTON PLACE', cross_street_1='SAINT JAMES PLACE', cross_street_2='GRAND AVENUE', boro='BK', compass_direction='N', compass_direction_2='S')
*The
boro
argument can be borough code, borough name or a common borough abbreviation.
>> python setup.py test
- Single address inputs containing
Grand Concourse
are not parsed correctly if they do not containNY
orNew York
in the string. - Single address inputs with a space instead of a hyphen are not parsed correctly. Ex.
180 05 HILLSIDE AVE, QUEENS, 11432
- Improve single address input parsing
- Better data with compass direction for testing
blockface
andstreet_stretch
methods.
This project is licensed under the MIT License - see the license.txt file for details
- Charles Wang for his initial proof of concept in python
- Chris Whong and Noah Veltman for their work using Node.js
- Datamade's usaddress