Reverse Geocoding

Cord Thomas cord at LUPINEX.COM
Thu Dec 30 13:40:24 PST 2004


Stephen's process is pretty much the algorithm i am using in my address
matching project

Cord

Stephen Woodbridge wrote:

> I have a product that does this, see:
>
>    http://imaptools.com/demos1/?tab=4
>
> The algorithm is not too complicated.
> 1) locate a list of line segments based on a lat/long
> 2) find which line segments are closest to the lat/long
> 3) drop a normal to the closest line segment
> 4) compute the ratio of the length from start of line to the projected
> point compared to the total line length
> 5) determine if the lat/long is on the right or left side of the line
> 6) compute the house number from the range of house numbers on the right
> or left and the ratio position of the projected point.
>
> -Steve W.
>
> Camden Daily wrote:
>
>> To the best of my knowledge, mapserver doesn't do any geocoding at
>> all.  The only package I've been able to find that can do it is the
>> Geo::Coder::US perl module from CPAN.  The module has an import()
>> function that can be used to generate a database for geocoding from
>> TIGER/Line data files, and a geocode() function that can then geocode
>> a given address.  I've managed to build my own database and get my
>> PHP/Mapscript to interface with the perl module for geocoding, but
>> reverse would be much trickier.
>>
>> If you don't care much too much about accuracy, it would seem that the
>> same alogorithm used to geocode could be reversed with a little work.
>> If you've got good Perl skills, I'd suggest looking at the source for
>> Geo::Coder:US.
>>


--------------------

This email message is for the sole use of the intended recipient(s) and
may contain privileged information. Any unauthorized review, use,
disclosure or distribution is prohibited. If you are not the intended
recipient, please contact the sender by reply email and destroy all copies
of the original message.



More information about the MapServer-users mailing list