[Geocoding] Nominatim on Raspberry Pi (was: Nominatim release 2.2 announcement)

Matthew Grech matthewgrech1 at gmail.com
Thu Feb 27 07:33:05 UTC 2014


Thank you for this Sarah. I will try out what you suggested and get back to
you.

Matt


On Wed, Feb 26, 2014 at 11:53 PM, Sarah Hoffmann <lonvia at denofr.de> wrote:

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


More information about the Geocoding mailing list