[Geocoding] Problems while creating your own gazetteer server
Ciprian Talaba
cipriantalaba at gmail.com
Sat Nov 28 10:40:40 GMT 2009
Hi Brian,
On Sat, Nov 28, 2009 at 4:19 AM, Brian Quinion <
openstreetmap at brian.quinion.co.uk> wrote:
> On Fri, Nov 27, 2009 at 8:48 PM, Ciprian Talaba <cipriantalaba at gmail.com>
> wrote:
> > I am trying to create my own gazetteer service (using the new code from
> > Brian) that will be loaded with data from Romania only (at least for now)
> > and I am seeing some errors while following the steps in the README file:
> >
> > 1. when I first try to execute commands from gazetteer-functions.sql I
> get
> > something like:
> >
> > $ cat gazetteer-functions.sql | psql gazetteer
> > ....
> > ERROR: type wordscore[] does not exist
>
> wordscore type is created by osm2psql when using the -o gazetteer option.
>
> My best guess is that either you are running an older version of
> osm2pgsql or ran it after creating the gazetteer tables?
>
> Cheers,
> --
> Bran
>
Thanks for that info, indeed my osm2pgsql source was almost 2 months old.
After a svn up evrything is fine, from that point of view at least.
The good news is that I managed to get the service up and running, but I had
run into different problems to get it there. The first one is that I get an
error while running 'cat gazetteer-index.sql | psql gazetteer':
...
NOTICE: Self-intersection at or near point 21.1894 45.7155
CONTEXT: PL/pgSQL function "placex_insert" line 19 at IF
ERROR: Argument to X() must be a point
CONTEXT: PL/pgSQL function "placex_insert" line 25 at IF
...
I wasn't sure if this is why the search_name table is empty so I tried to
debug and found out that in some conditions the ST_Centroid return an empty
GEOMETRYCOLLECTION that is not suitable for ST_X. To get over this a simple
check in the same IF is sufficient (see attached functions.patch).
But still my search_name table was empty so I looked over util.index.php,
but it wasn't working for me (maybe it is suitable for large datasets?). So
I kept looking and discovered util.update.php that is not mentioned in the
README. It wasn't working for the first time because I couldn't find a
getCmdOpt function (Google wasn't helpful either) so I had to use only the
relevant code (attached as util.justupdate.php) and after waiting something
like 10-15 minutes I was able to see a lot of records in the search_name
table.
Unfortunately my quest was not over :-) because when I tried any search from
the web interface (with debug mode on) I always get an error that relation
country_name is not found. I searched the code an discovered that
country_name table is created by extract_countrynames.sql, but the code in
there needs a little update (wrong country code column in the
world_boundaries table (attached country.patch).
And finally my instance of the gazetteer service was up and running.
I hope all this information is helpful for you (to update the
documentation/code where you think is necessary) but also for others as
well. In the end I have another question related to the way the buildings
are indexed: I understand that the current code doesn't process addr:* tags
on buildings other than addr:street because of performance issues. Can it
work just fine if the dataset is limited to a small country (like Romania)?
And if it will work without a big performance penalty, how difficult will be
to activate this functionality?
Thanks,
--Ciprian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/geocoding/attachments/20091128/99e964d0/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: functions.patch
Type: application/octet-stream
Size: 1040 bytes
Desc: not available
URL: <http://lists.openstreetmap.org/pipermail/geocoding/attachments/20091128/99e964d0/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: country.patch
Type: application/octet-stream
Size: 866 bytes
Desc: not available
URL: <http://lists.openstreetmap.org/pipermail/geocoding/attachments/20091128/99e964d0/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: util.justupdate.php
Type: application/octet-stream
Size: 2012 bytes
Desc: not available
URL: <http://lists.openstreetmap.org/pipermail/geocoding/attachments/20091128/99e964d0/attachment-0002.obj>
More information about the Geocoding
mailing list