...
In collaboration with Treasurer/Tax Collector and the Department of Public Health, we have written a restful RESTful street address geocoding service. This page describes that service. We try to follow the OGC geocoding standard which is described here. The service uses EAS addresses. While EAS addresses are bound to the street network, the results will differ significantly from a street network geocoding service. For example, if you try to geocode "100 Main St" using this service, you will get zero candidates. That's because (at the time of this writing) there is no "100 Main St" in EAS. Although there is a street segment that supports "100 Main St" there is no building or proposed building that has that address. Why use EAS geocoding? If you want units or parcels that are associated with an address, this is probably your best bet. EAS addresses are curated and maintained (not mined) and we synchronize the streets and parcels with Dept. of Public Works on a daily basis. To see what EAS address look like, check out the web interface which is here (internal).
...
Contact | Department |
---|---|
Richard Hagner | Treasurer/Tax Collector |
Darrell Ascano | Treasurer/Tax Collector |
Stephanie Cowles----------------- | Dept. of Public Health |
Aksel Olsen | Dept. of Planning |
...
2358 2362 15th St | 2362 15th St |
2855 2857 2859 BUSH St | 2855 Bush St |
3354 3358 cesar chavez St | 3354 Cesar Chavez St |
654 GRANT Ave 2 | 654 Grant Ave |
3148 CESAR CHAVEZ BLDG#14 St | 3148 Cesar Chavez |
In April 2013, a more challenging DPH data set was geocoded against the EAS geocoding service, which resulted in some Lessons from Geocoding Locations from ED Database.
Client
Here is a working command line client written for Python 2.7.
If you download it and run it with no arguments, you will get the following usage argument:
Div | ||||
---|---|---|---|---|
| ||||
usage: c:\temp\geocoding_client_dph.py <host ip> <host port> <input file path> <output file path> <address column name> [zip code column name] example command line: python geocoding_client_dph.py eas.sfgov.org 80 c:/temp/input.csv c:/temp/output.csv Address Zip |
You must specify the host IP, host port, input file, output file name, name of the field containing addresses, and optionally the name of the field containing zip codes.
For <host IP>, you can run the client against the development (DEV), quality assurance (QA) or production (PROD) server... the production server is the most stable and is recommended.
Running the client against this input file will produce a file like this. The output file will contain your original data fields, plus 18 additional fields with elements converted from the json query result.
As documented above, each address query can return several match candidates and several parcels. The output file will contain a field called detailfields called match_input_row, match_candidate_row, and match_parcel_row that will help you decode these cases. The part of the number before the decimal point in the detail_row is the row in the input file that the query came from. Additional candidates returned are enumerated in the tenths column after the decimal point. Additional parcels returned are enumerated in the thousandths column. For example, detail_row 237.205 represents the fifth parcel of the second candidate returned for input row 237.
...