Hi Brian,<br><br><div class="gmail_quote">On Sat, Nov 28, 2009 at 4:19 AM, Brian Quinion <span dir="ltr"><<a href="mailto:openstreetmap@brian.quinion.co.uk">openstreetmap@brian.quinion.co.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">On Fri, Nov 27, 2009 at 8:48 PM, Ciprian Talaba <<a href="mailto:cipriantalaba@gmail.com">cipriantalaba@gmail.com</a>> wrote:<br>
> I am trying to create my own gazetteer service (using the new code from<br>
> Brian) that will be loaded with data from Romania only (at least for now)<br>
> and I am seeing some errors while following the steps in the README file:<br>
><br>
> 1. when I first try to execute commands from gazetteer-functions.sql I get<br>
> something like:<br>
><br>
> $ cat gazetteer-functions.sql | psql gazetteer<br>
> ....<br>
> ERROR:  type wordscore[] does not exist<br>
<br>
</div>wordscore type is created by osm2psql when using the -o gazetteer option.<br>
<br>
My best guess is that either you are running an older version of<br>
osm2pgsql or ran it after creating the gazetteer tables?<br>
<br>
Cheers,<br>
<font color="#888888">--<br>
 Bran<br>
</font></blockquote></div><br><br>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.<br><br>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':<br>
...<br>NOTICE:  Self-intersection at or near point 21.1894 45.7155<br>CONTEXT:  PL/pgSQL function "placex_insert" line 19 at IF<br>ERROR:  Argument to X() must be a point<br>CONTEXT:  PL/pgSQL function "placex_insert" line 25 at IF<br>
...<br>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).<br>
<br>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.<br>
<br>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).<br>
<br>And finally my instance of the gazetteer service was up and running.<br><br>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? <br>
<br>Thanks,<br>--Ciprian<br>