Open Source Geocoding Engine
David Bitner
osgis.lists at GMAIL.COM
Fri Mar 4 14:08:09 PST 2005
Elankes,
In order to keep this information on the list so that others having
your same problem can searchthe archives and find answers without
reanswering, try to remember to reply to the whole list rather than to
me in particular.
My advice to you, if you don't want to go crazy, is to keep your
thoughts of a geocoder very separate from what you are doing with the
Mapserver software. Using PostgreSQL/PostGIS along with perl or php
or cold fusion or whatever you can create a standalone geocoder which
can then be used to plug into Mapserver. Perhaps, I can use this as
an opportunity to create a brief tutorial on creating a geocoder. The
first things that you will want to do if you want to go about this
with PotgreSQL/PostGIS are to become familiar with the very basics of
PL/PGSQL and creating data types in PostgreSQL. Then you will also
want a scripting language to create web access to you database
functions -- I use PHP, but Perl, JSP, CF or anything else that can
connect to PostgreSQL would do fine. The "heavy lifting" will all be
done in PL/PGSQL.
In the meantime, I can try to put together a tutorial together over
the next week along with some basic scripts that you could modify to
work with your dataset. It may even help me clean up my code which is
rather ugly right now.
David
On Fri, 4 Mar 2005 16:11:47 -0500, Poopalasingham Elankeswaran
<pelankes at gmail.com> wrote:
> Hi David Bitner,
>
> Thank you very much for this information. I am a co-op student working
> on this project. I started working on this project since January 1st
> and I am totally new to GIS. My supervisor has DMTI street network
> data. The from_left, to_left, from_right, and to_right were mixed up
> at the beginning. We rearranged those columns, so now all even numbers
> are in left side and odd numbers are in the right side. As you
> mention, this data would be enough for this specific geocoding.
>
> I don't have much experience with PL/PGSQL. I am going to follow your
> pseudo code.
>
> It is very hard to work with Mapserver since there are lot of stuff
> involved with this and we don't have a good documentation for this
> very powerful software.
>
> Thank you again.
>
> Elankes
>
>
> On Fri, 4 Mar 2005 13:24:33 -0600, David Bitner <osgis.lists at gmail.com> wrote:
> > PostgreSQL/PostGIS combined with PL/PGSQL can create a very good
> > localized geocoder. I have created a geocoder using PostgreSQL that
> > is very specific to a particular local streets dataset without much
> > difficulty.
> >
> > The previously mentioned OS geocoders will not do anything for
> > Southern Ontario out of the box since they are specific to the US
> > Census Tiger Data.
> >
> > The first thing that you will need regardless of how you are planning
> > on creating your geocoder is good address matchable street data. This
> > streets data must have separated fields for the different component
> > address parts as well as from and to address ranges for each street
> > segment (often a group of fields l_f_add,l_t_add,r_f_add,r_t_add).
> >
> > If you do not have address matchable street data, you are dead in the
> > water regardless of whether you have geocoding software.
> >
> > I do know that Refractions has been working on some geocoding pl/pgsql as well.
> >
> > A rough outline of a plpgsql geocoder follows (assuming you can split
> > the address into the appropriate parts):
> >
> > create a type to hold the results of your geocode query -- this should
> > include all fields that you'll want in your result and a field to hold
> > a rank.
> >
> > create a function that returns your geocode result type:
> > set up a loop with the pieces of the address that you want to force an
> > exact match --
> >
> > for i in select * from roads where streetname=inputstreetname and
> > inputstreetnumber between minimum_address_number and maximum address
> > number LOOP
> > if i.prefix_direction=inputprefixdirection then rank=rank+1; end if;
> > if i.street_type=inputstreettype then rank=rank+1;end if;
> > ...
> > result.prefix_direction:=i.prefix_direction;
> > result.street_type:=i.street_type;
> > ...
> > percent:=(street_number-i.minimum_address)/(i.maximum_address-i.minimum_address);
> > result.geometry:=line_interpolate_point(geometryn(i.geometry,1),percent);
> > result.rank=rank;
> > return next result;
> > end LOOP;
> >
> > The to get your result, you could use a query like:
> > select * from geocode_function(inputstreetnumber,inputprefixdirection,...)
> > order by rank limit 1;
> >
> >
> > On Fri, 4 Mar 2005 11:50:31 -0600, Poopalasingham Elankeswaran
> > <pelankes at gmail.com> wrote:
> > > Hi there,
> > >
> > > I am doing research on Address gecoding with Mapserver and
> > > PostgreSQL/PostGIS. Does anyone have any idea in this area? It is not like
> > > Goole Map or Mapquest. This has to be specifically for Southern Ontario,
> > > Canada. I need to search list of addresses and displaying them together on a
> > > Map or save all the corresponding points to a shape file.
> > >
> > > Is there any Open Source Geocoding Engine?
> > >
> > > Thanks,
> > >
> > > P.Elankes
> > > Computer System Engineering
> > > Carleton University
> > > Ottawa,Canada
> > >
> >
>
> --
> P.Elankes
>
More information about the MapServer-users
mailing list