NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

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's gravatar image

Markus
16115
accept rate: 0%


The import script currently still assumes in many places that you are using a postgres user with the same name as the CLI user doing the import. You need to create such a user (with -s, to give it superuser rights), make sure you have set up postgres that it allows local peer identification and in your settings.local use a DSN without credentials.

permanent link

answered 26 Apr '12, 20:48

lonvia's gravatar image

lonvia
6.2k25789
accept rate: 40%

1

@lonvia: thanks a lot, that was it. It is even stated clearly in the text I quoted: "You also need a user with superuser rights...", I've no idea how I missed that.

(26 Apr '12, 22:31) Markus
-1

Hi Ionvia,

I think I'm having the same issue. What did you do exactly?

Thanks, Lucas

(12 Jun '13, 13:49) Kalu06

Have you read lonvias answer right above yours?

(13 Jun '13, 11:59) gormo
1

Since then I figured it out. Thanks anyway.

(13 Jun '13, 13:25) Kalu06

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×689
×61
×34

question asked: 26 Apr '12, 12:35

question was seen: 10,951 times

last updated: 13 Jun '13, 16:40

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum