John Sample

Bits and Bytes
posts - 103, comments - 354, trackbacks - 16

New DLL (Lots of new stuff)

I think this one is pretty cool.

Its got a ton of new features:

Faster
ZIP code is no longer required.
Cleaner class structure
Address parsing
VERY flexible address finding
Reverse geocoding!

If you used the .05 installer there are some small index changes, download the one appropriate for your platform:
MySql
Sql Server

Those should be the last db updates for a while.

The documentation:
http://www.johnsample.com/misc/geo2/api/doc/index.html

And finally the API:
Geocode.02.zip

posted on Thursday, September 15, 2005 6:36 PM

Feedback

# re: New DLL (Lots of new stuff)

Some info thats not in the docs yet:
Reverse geocoding takes an optional paramater called bounds. The default is 1000.
This translates to the last 4 decimal points of the longitude/latitude, approximately .5 to 1.5 miles depending on the locaiton being searched.
Try to leave this at the default if possible. Increasing the value will increase the search time, lowering it may leave you with no results. In a city like New York you could probably cut it in half, in Montatna you may need to increase the value.

The address parsing uses a compiled regex for maximum speed.
You can override the search pattern but make sure the groupings stay the same as the original.
Here is the compiled pattern. Groupings: number, dirp, street, streetType, dirs, city, state, zip

^(?'number'\d+)? (?# House/Place number)
(\s+)? (?# Number is optional)
(?'dirp'NORTH|SOUTH|EAST|WEST|N|S|E|W|NE|NW|SE|SW|NORTHEAST|NORTHWEST|SOUTHEAST|SOUTHWEST)?
(\s+)? (?# Dirp is optional)
(?'street'\b\w[\w ]+\b) (?# Street Name - required)
\b(?'streetType'ALY|ARC|AVE|BLVD|BR|BRG|BYP|CIR|CRES|CSWY|CT|CTR|CV|DR|EXPY|FMRD|FWY|GRD|HWY|LN|LOOP|MAL|MTWY|OVPS|PASS|PATH|PIKE|PKY|PL|PLZ|RAMP|RD|RMRD|ROW|RTE|RUE|RUN|SKWY|SPUR|SQ|ST|TER|TFWY|THFR|THWY|TPKE|TRCE|TRL|TUNL|WALK|WAY|WKWY|XING|STREET|DRIVE|ROAD|AVENUE|FREEWAY|PARKWAY|HIGHWAY|BOULEVARD|BYPASS|TURNPIKE|TRAIL|SQUARE)\b\.?
(\s*)
((?'dirs'NORTH|SOUTH|EAST|WEST|N|S|E|W|NE|NW|SE|SW|NORTHEAST|NORTHWEST|SOUTHEAST|SOUTHWEST)\b)?
(,?(?'city'[\w ]{2,}\b),?\s(?'state'[A-Z]{2}))? (?# entire section is optional, but the pieces, if they exist, are not)
([^\r\n\w])?
,?\s?(?'zip'\d{5})?

9/15/2005 6:57 PM | John Sample

# re: New DLL (Lots of new stuff)

Hi, This what i was looking for for a while. Thanks a lot!!!
Howevere :) i have a some problem with the installer(not sure this is the rigth place to ask questions) Any way after it downloads all the zip files I got this strange error(in a message box) Any idea what is this ? :
---------------------------
Tiger Install
---------------------------
'57' is not a valid value for 'value'. 'value' should be between 'minimum' and 'maximum'.
---------------------------
OK
---------------------------
10/30/2005 12:06 PM | Alided

# re: New DLL (Lots of new stuff)

Thanks for the regular expression John. Very helpful. For those who may be new to reqular expressions (like me), I found you will want to specify the IgnoreCase and IgnorePatternWhitespace regex options when using this expression.
1/30/2006 11:00 AM | Brian

Post Comment

Title  
Name  
Url
Enter the code you see:
Comment