<div dir="ltr">Thank you for this Sarah. I will try out what you suggested and get back to you.<div><br></div><div>Matt</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Feb 26, 2014 at 11:53 PM, Sarah Hoffmann <span dir="ltr"><<a href="mailto:lonvia@denofr.de" target="_blank">lonvia@denofr.de</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
On Wed, Feb 26, 2014 at 03:48:05PM +0100, Matthew Grech wrote:<br>
> It seems that the nominatim DB is not being correctly populated from the<br>
> Malta OSM DB extract for some reason. Can you please have a look at the<br>
> attachment and let me know your thoughts?<br>
<br>
It looks like the import of the OSM data did not work at all. There is only<br>
the preloaded US state and postcode data. It would be interesting to see<br>
the import logs. Could you provide them somewhere?<br>
<br>
> This is running on Raspian on a Raspberry Pi. The same import works on a<br>
> Debian or Ubuntu PC (Raspian is based on Debian).<br>
<br>
Given the limited processing power of the Pi, you might actually want to<br>
go a different way of getting the database there. You could simply dump<br>
the database from the PC and restore it on the Pi.<br>
<br>
For a non-updatable copy, the steps are roughly as follows:<br>
<br>
1. Setup up and import Nominatim on PC<br>
(preferably with the same postgres and postgis version but it<br>
should work ok if it is not matching)<br>
2. Create a partial dump:<br>
pg_dump --file=nominatim.dmp -F c -Z 9 -t 'country' -t file -t '*columns' \<br>
-t 'import_polygon_*' -t import_status -t place_addressline \<br>
-t placex -t search_name -t 'seq_*' -t word nominatim<br>
3. On raspberry pi follow installation instruction up until the import.<br>
4. Restore dump with:<br>
./utils/setup.php --create-db --setup-db --create-functions --create-partition-functions<br>
pg_restore -O -d nominatim nominatim.dmp<br>
./utils/setup.php --create-functions --create-partition-functions<br>
<br>
Sarah<br>
<br>
> On Wed, Feb 26, 2014 at 8:52 AM, Sarah Hoffmann <<a href="mailto:lonvia@denofr.de">lonvia@denofr.de</a>> wrote:<br>
><br>
> > Hi Matthew,<br>
> ><br>
> > On Tue, Feb 25, 2014 at 10:45:51PM +0100, Matthew Grech wrote:<br>
> > > Thanks for the good news. Do you know if this resolves any issues with<br>
> > the<br>
> > > initial data import? I had installed Nominatim on a raspberry pi running<br>
> > > raspian and had issues with the data import - key tables like place_x etc<br>
> > > were being populated wrongly.<br>
> ><br>
> > The population process for these tables hasn't changed, so I doubt that<br>
> > this fixes any issues you might be having there. Can you be a bit more<br>
> > specific about the errors you get?<br>
> ><br>
> > Sarah<br>
> ><br>
> > ><br>
> > > Kind Regards,<br>
> > ><br>
> > > Matthew<br>
> > ><br>
> > ><br>
> > > On Tue, Feb 25, 2014 at 8:32 PM, Sarah Hoffmann <<a href="mailto:lonvia@denofr.de">lonvia@denofr.de</a>><br>
> > wrote:<br>
> > ><br>
> > > > Hi,<br>
> > > ><br>
> > > > we have just released a new stable version 2.2 of Nominatim. This<br>
> > release<br>
> > > > mainly fixes some issues with the installation when using postgis 2.x.<br>
> > > > In addition, a number of smaller issues with applying updates have been<br>
> > > > fixed and the handling of addr:postcode has been improved.<br>
> > > ><br>
> > > > The new release is available at<br>
> > > ><br>
> > > > <a href="http://www.nominatim.org/release/Nominatim-2.2.0.tar.bz2" target="_blank">http://www.nominatim.org/release/Nominatim-2.2.0.tar.bz2</a><br>
> > > ><br>
> > > > Installation instructions are at the usual place at<br>
> > > ><br>
> > > > <a href="http://wiki.openstreetmap.org/wiki/Nominatim/Installation" target="_blank">http://wiki.openstreetmap.org/wiki/Nominatim/Installation</a><br>
> > > ><br>
> > > > Please note that starting with this release the external UK postcode<br>
> > > > data are no longer imported by default and need to be downloaded<br>
> > > > before the installation if required.<br>
> > > ><br>
> > > > Users of Nominatim 2.1 are able to update to this release while keeping<br>
> > > > their current database. Detailed instructions for updating can be found<br>
> > > > in the release notes:<br>
> > > ><br>
> > > > <a href="https://github.com/twain47/Nominatim/wiki/Release-Notes-2.2.0" target="_blank">https://github.com/twain47/Nominatim/wiki/Release-Notes-2.2.0</a><br>
> > > ><br>
> > > > If you are running an older version, a full database reimport is<br>
> > > > required.<br>
> > > ><br>
> > > ><br>
> > > > Regards<br>
> > > ><br>
> > > > Sarah<br>
> > > ><br>
> > > ><br>
> > > > _______________________________________________<br>
> > > > Geocoding mailing list<br>
> > > > <a href="mailto:Geocoding@openstreetmap.org">Geocoding@openstreetmap.org</a><br>
> > > > <a href="https://lists.openstreetmap.org/listinfo/geocoding" target="_blank">https://lists.openstreetmap.org/listinfo/geocoding</a><br>
> > > ><br>
> ><br>
<br>
> On Raspberry Pi:<br>
><br>
> root@test:/home/pi# psql nominatim -c "select count(*) from placex"<br>
> count<br>
> -------<br>
> 32388<br>
> (1 row)<br>
><br>
> root@test:/home/pi#<br>
><br>
> $ psql nominatim -U www-data -c "select count(*) from placex"<br>
> count<br>
> -------<br>
> 32388<br>
> (1 row)<br>
><br>
> On a Ubuntu Nominatim server installed in 2012 (which is working correctly, DB has not been updated since):<br>
><br>
> $ psql nominatim -U www-data -c "select count(*) from placex"<br>
> count<br>
> -------<br>
> 46874<br>
> (1 row)<br>
><br>
> $<br>
><br>
> So there is a heavy discrepancy in the number of rows.<br>
><br>
> The unable to geocode error is generted by /usr/local/src/Nominatim-2.1/lib/template/address-xml.php which is invoked in /usr/local/src/Nominatim-2.1/lib/ReverseGeocode.php<br>
> :<br>
><br>
> if (!sizeof($aPlace))<br>
> {<br>
> if (isset($sError))<br>
> echo "<error>$sError</error>";<br>
> else<br>
> echo "<error>Unable to geocode</error>";<br>
> }<br>
><br>
> On Raspberry Pi:<br>
><br>
> select place_id,parent_place_id,rank_search from placex;<br>
><br>
> nominatim=# select place_id,parent_place_id,rank_search from placex;<br>
> place_id | parent_place_id | rank_search<br>
> ----------+-----------------+-------------<br>
> 116512 | 0 | 21<br>
> 100031 | 0 | 21<br>
> 100015 | 0 | 21<br>
> 100041 | 0 | 21<br>
> 100007 | 0 | 21<br>
> 100028 | 0 | 21<br>
> 100021 | 0 | 21<br>
> 100018 | 0 | 21<br>
> 100032 | 0 | 21<br>
> 100034 | 0 | 21<br>
> 100023 | 0 | 21<br>
> 100009 | 0 | 21<br>
> 100010 | 0 | 21<br>
> 100047 | 0 | 21<br>
> 100002 | 0 | 21<br>
> 100049 | 0 | 21<br>
> 100003 | 0 | 21<br>
><br>
> nominatim=# select * from place_addressline;<br>
> place_id | address_place_id | fromarea | isaddress | distance | cached_rank_address<br>
> ----------+------------------+----------+-----------+--------------------+---------------------<br>
> 131828 | 131828 | t | t | 0 | 11<br>
> 130214 | 130214 | t | t | 0 | 11<br>
> 129093 | 129093 | t | t | 0 | 11<br>
> 127388 | 127388 | t | t | 0 | 11<br>
> 123479 | 123479 | t | t | 0 | 11<br>
> 123260 | 123260 | t | t | 0 | 11<br>
> 114849 | 114849 | t | t | 0 | 11<br>
> 113977 | 113977 | t | t | 0 | 11<br>
> 107709 | 107709 | t | t | 0 | 11<br>
> 106303 | 106303 | t | t | 0 | 11<br>
> 103497 | 103497 | t | t | 0 | 11<br>
><br>
> On a Ubuntu Nominatim server installed in 2012 (which is working correctly, DB has not been updated since):<br>
><br>
> nominatim=# select * from placex;<br>
> place_id | parent_place_id | rank_search<br>
> ----------+-----------------+-------------<br>
> 100004 | 108534 | 30<br>
> 100005 | 108534 | 30<br>
> 100012 | 110338 | 30<br>
> 100013 | 114537 | 30<br>
> 100000 | 102085 | 30<br>
> 100006 | 109013 | 30<br>
> 100009 | 105030 | 30<br>
> 100033 | 101872 | 18<br>
> 100035 | 101872 | 18<br>
> 100039 | 101872 | 18<br>
> 100007 | 101872 | 18<br>
> 100027 | 101872 | 18<br>
> 100031 | 101872 | 18<br>
> 100045 | 101872 | 18<br>
> 100047 | 101872 | 18<br>
> 100014 | 101872 | 18<br>
> 100016 | 101872 | 18<br>
> 100017 | 101872 | 18<br>
> 100019 | 101872 | 18<br>
><br>
> select * from place_addressline;<br>
><br>
> nominatim=# select * from place_addressline;<br>
> place_id | address_place_id | fromarea | isaddress | distance | cached_rank_address<br>
> ----------+------------------+----------+-----------+----------------------+---------------------<br>
> 100764 | 100764 | t | t | 0 | 4<br>
> 110710 | 110710 | t | t | 0 | 8<br>
> 110710 | 100764 | t | t | 0.00835347581786879 | 4<br>
> 117168 | 117168 | t | t | 0 | 8<br>
> 117168 | 100764 | t | t | 0.00835347581786879 | 4<br>
> 102107 | 102107 | t | t | 0 | 8<br>
> 102107 | 100764 | t | t | 0.081694317374461 | 4<br>
> 102106 | 102106 | t | t | 0 | 8<br>
> 102106 | 100764 | t | t | 0.218869861226327 | 4<br>
> 105372 | 105372 | t | t | 0 | 8<br>
><br>
> It can be seen that the parent_place_id and other fields do not seem to be populated on the raspberry pi.<br>
<br>
</blockquote></div><br></div>