Table of Contents |
---|
Introduction
In collaboration with the Treasurer/Tax Collector and the Department of Health, we are making a restful street address geocoding service available. This page describes the service. We mostly try to follow the the OGC geocoding standard which is described heredescribed here.
Contacts
Contact | Department |
---|---|
Richard Hagner | TAX |
Darrell Ascano | TAX |
Stephanie Cowles | DPH |
Preamble
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).
The Request
Here is the URL (DEV URL ) with an example address of "100 Main St":
http://10.250.60.189/geocode/streetNetworkfindAddressCandidates/findAddressCandidates?f=json&Address=100 Main St115%20Main%20St&Zip=94105
The the URL is case sensitive.
The service uses the street segment network only.
These data are carefully maintained by Department of Public Works, and brought into EAS on a nightly basis.
We return a single best candidate and have not implemented a scoring system.
Instead of scoring we return exceptions to help you correct the input data.
The location is based on the linear interpolation of the matching street segment.
We offset by 4 meters (about 12 feet) to the even or odd side.
For example, here is "217 4th St":
The Response
We strongly prefer JSON (available now) but we can produce XML if you buy us a beer.
The JSON is formatted for readability but your browser may obscure that.
The way to see the nicely formated JSON is to right click on the web page and select "view source".
If you use chrome or firefox you can type "ctrl-u".
If you use Internet Explore you can type "alt-v-c".
In any case, the JSON should look something like this:currently support JSON. Here is an example.
Code Block |
---|
{ "inputAddressStringspatialReference": "100{ Main St", "inputZipCodeStringwkid": "94105" 4326 }, "spatialReferencecandidates": {[ { "wkid": 4326 }, "foundMatchaddress": true,"115 MAIN ST", "foundEasMatch": false, "candidateslocation": [ { { "addressy": "100 MAIN ST",37.79152826999239, "longitudex": -122.39489592098057,39400753158013 "latitude": 37.7917552676099}, "score": null100, "attributes": { "StreetNamebase_address_num": "MAIN"115, "StreetTypebase_address_suffix": "ST"null, },"street_name": "MAIN", "addressNumberstreet_type": "100ST", "streetzipcode": {"94105", "streetNamePrimarydetails": {[ { "base_street_name": "MAIN", "streetaddress_base_typeflg": "ST" true, }, "blk_lot": "3717012", "streetNameAliases": [], "lunit_f_addnum": null 101, "l_t_add": 199 }, "r_f_add": 100, { "raddress_tbase_addflg": 198,true, "segblk_cnnlot": 8628000"3717013", "geometry": "MULTILINESTRING ((-122.3949402377882194 37.7918420903234775, -122.3934079394635717 37.7906126704266541))" "unit_num": null }, "zipCode": "94105",} "jurisdiction": "SF MAIN"] } } ], "validations": [], } "didYouMean": [] } |
Results and Performance
...
found street match | found eas match | count | percent |
---|---|---|---|
The service processes about 500 addresses per minute which should be fine for our purposes.
We have done no performance optimization so we can probably make it faster if you have a compelling reason.
Technical Details
If you are interested in technical details you can find the code mostly in 2 places.
More or less...
And in an effort to set a good example we have written real unit tests which you can see here!
Example URLs
The nominal example:
todo - results pending
Technical Details
todo - link to view, geocoder, and tests
Example URLs
http://10.250.60.189/geocode/streetNetwork/findAddressCandidates?f=json&Address=100 Main St&Zip=94105
You can send data with no street suffix if it's not ambiguous:
http://10.250.60.189/geocode/streetNetwork/findAddressCandidates?f=json&Address=157 Noe&Zip=94114
But be aware that there are ambiguous cases:
We do not parse degraded addresses:
Address that include extra information at the end parse but typically fail to return a candidate
But if it's clearly as unit, it works
You should get a warning if the address range of the best matching street is not a perfect
Example Client
Here is an example client written in python.