Hi Brian, On Sat, Nov 28, 2009 at 4:19 AM, Brian Quinion < [email protected]> wrote:
> On Fri, Nov 27, 2009 at 8:48 PM, Ciprian Talaba <[email protected]> > 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
functions.patch
Description: Binary data
country.patch
Description: Binary data
<<attachment: util.justupdate.php>>
_______________________________________________ Geocoding mailing list [email protected] http://lists.openstreetmap.org/listinfo/geocoding

