I'm on Debian Squeeze and following http://wiki.openstreetmap.org/wiki/Nominatim/Installation . I'm at the point where I import the OSM file ( http://wiki.openstreetmap.org/wiki/Nominatim/Installation#Import_and_index_OSM_data ):
time php -d error_reporting=E_ALL ./utils/setup.php --osm-file austria.osm --all
I'm using a specific country as opposed to the whole planet and the setup runs for about 13 minutes and ends with:
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
COMMIT
SET
SET
SET
SET
SET
SET
SET
SET
SET
CREATE TABLE
SET
SET
SET
SET
SET
SET
SET
SET
CREATE TABLE
ALTER TABLE
Import
Using projection SRS 4326 (Latlong)
NOTICE: table "place" does not exist, skipping
NOTICE: type "keyvalue" does not exist, skipping
NOTICE: type "wordscore" does not exist, skipping
NOTICE: type "stringlanguagetype" does not exist, skipping
NOTICE: type "keyvaluetype" does not exist, skipping
NOTICE: function get_connected_ways(pg_catalog.int4[]) does not exist, skipping
Allocating memory for dense node cache
Allocating dense node cache in one big chunk
Allocating memory for sparse node cache
Sharing dense sparse
Node-cache: cache=15000MB, maxblocks=1920001*8192, allocation method=11
Mid: pgsql, scale=10000000 cache=15000
Setting up table: planet_osm_nodes
NOTICE: table "planet_osm_nodes" does not exist, skipping
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "planet_osm_nodes_pkey" for table "planet_osm_nodes"
Setting up table: planet_osm_ways
NOTICE: table "planet_osm_ways" does not exist, skipping
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "planet_osm_ways_pkey" for table "planet_osm_ways"
Setting up table: planet_osm_rels
NOTICE: table "planet_osm_rels" does not exist, skipping
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "planet_osm_rels_pkey" for table "planet_osm_rels"
Reading in file: austria.osm
Processing: Node(16412k 72.6k/s) Way(1550k 8.12k/s) Relation(28484 1017.29/s) parse time: 445s
Node stats: total(16412032), max(1543457158) in 226s
Way stats: total(1550680), max(140997267) in 191s
Relation stats: total(28484), max(1907412) in 28s
node cache: stored: 16412032(100.00%), storage efficiency: 67.22% (dense blocks: 1301, sparse nodes: 15387701), hit rate: 97.81%
Stopping table: planet_osm_nodes
Stopping table: planet_osm_rels
Building index on table: planet_osm_rels (fastupdate=off)
Stopping table: planet_osm_ways
Building index on table: planet_osm_ways (fastupdate=off)
Stopped table: planet_osm_nodes in 0s
Stopped table: planet_osm_rels in 0s
Stopped table: planet_osm_ways in 355s
Osm2pgsql took 800s overall
osm2pgsql SVN version 0.80.0 (32bit id space)
ERROR: No Data
No Data
real 13m37.663s
user 4m18.800s
sys 0m7.800s
I grepped the source for No Data and found this in util/setup.php
:
123 $oDB =& getDB();
124 $x = $oDB->getRow('select * from place limit 1');
125 if (!$x || PEAR::isError($x)) fail('No Data');
But what puzzles me is that I see there is actually data there:
$ psql nominatim
psql (8.4.11)
Type "help" for help.
nominatim=# select count(*) from place;
count
---------
1788758
(1 row)
I re-ran the command with additional debug info in the setup.php
script to echo the PEAR error, in case it is one, and got this:
Message: DB Error: insufficient permissions
ERROR: No Data
No Data
I then discovered that the table place
has been created with the owner postgres
; this is the use under which I executed the whole setup utility and which has local ident rights to do everything (default setup).
I did this because the guide mentions:
You also need a user with superuser rights for the account that is doing the import. You must not run the import as user www-data.
However it seems the import script is using different users when doing the stuff and I'm not sure how to handle this. I set proper credentials in settings/local.php
, but it seems the actual import with osm2pgsql
is done with my CLI user postgres
and when the script tries to access the database it is my configured username (which is just nominatim
per the examples; this is only a postgresql user, not a system account).
What is the proper procedure for the import?
thanks
asked
26 Apr '12, 12:35
Markus
16●1●1●5
accept rate:
0%