[postgis-users] RE: [postgis-devel] Geocoder and scripts
lee.keel at uai.com
Thu Jul 5 09:15:43 PDT 2007
> This is certainly a big one that I'd like to see done as well. It's
> pretty much on my todo list right now but I'm not sure when I'll get to
> it. I did adjust things such that it'll return something on city,state
> or zip-code lookups, based on TIGER data also. It could be better
> though, I'm sure. I'm actually pretty annoyed at the difficulty of
> getting decent zip code information. :/
I actually have some function right now that will work for city, state and
zip. In fact, in that website, you can enter city, state or zipcode and it
will work. I did not include them in the original geocoding function
because they really have a different return set. Zipcodes have been a
difficulty for us as well because the post office not only changes them, but
moves them all over the place. And to make things worse, they do this all
the time, so it gets insane to try to keep up with!
> > *Use of 'LIKE' will be incorporated if the postgres optimizer changes
> > optimize the use of a % at the end of a string.
> I thought it already did, actually... I'm happy enough with soundex()
> and regexp matching though...
The current functionality is using some logic that John Cole figured out for
me. If you do an analyze on the LIKE statement where you are doing "column
LIKE 'foo%'" the result query is really:
"column >= 'foo' AND column < 'fop'"
So what it is doing underneath is incrementing the last character by one
ascii value and doing the comparison. So in a couple of the functions you
will see "lower(r.fename::text) >= lower($2) and lower(r.fename::text) <
lower($3)". This will hopefully be replace in the future with
"(r.fename::text) LIKE lower($2)".
> Interesting.. I have to say that it looks quite a bit different than
> the tiger geocoder currently on the PostGIS site! I'm certainly going
> to try to look into it more and understand what's going on. Do you
> happen to recall if there was something which wasn't working well with
> the original geocoder?
I had a difficult time getting the scripts to load from the site, and I
wasn't sure what the different tables were. So, I took the lookup tables
from the scripts and started parsing through the normalizer and
understanding what it was doing. I then went on my own way while still
using the basic ideas I learned from those scripts.
> Also, I'm curious what you're using on the
> website for doing the mapping, mapserver? kamap? Something else?
We are using mapserver and openlayers to do our mapping.
> Lastly, what license is this under? I don't see any license statement
> in the zip file you sent. The TIGER geocoder is under the GPL but I'd
> like to make sure it's understood what the license is before we use or
> look to possibly incorporate anything from this into anything.
Sorry about that. I got a little eager when sending out that zip file. I
was ready to get my 4th started. This software is licensed as LGPL as
according to the attached License.txt file. It will be in any followup zip
> Perhaps we'll be able to work together to come up with someone that alot
> of people can use and improve and maybe get things like geocoding
> intersections added!
I truely hope so.
This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the sender. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
More information about the postgis-users