Opened 6 years ago

Closed 2 years ago

#4796 closed defect (invalid)

Append function in Combine with Tableindex / Slim not working

Reported by: errox Owned by: jburgess777@…
Priority: blocker Milestone:
Component: osm2pgsql Version:
Keywords: Cc:

Description

Hello.

There is a Big Bug if you want to use osm2pgsql to append files.

First error: Duplicate Key error. Ok -> use parameter -i.

But how can i combine it? If i want to use

-a (append) -i (no index error) -C Caching 1500 mb Ram max -s Slim

if i just use -a -i -s (max 800 default) it does not work.

osm2pgsql -a -i -s belgium.osm.pbf -> Throws Warning that -s is not activated osm2pgsql -a -s -i belgium.osm.pbf -> Usage Error osm2pgsql -i -a -s belgium.osm.pbf -> SQL Syntax error (.... planet_osm_point USING BTREE (osm_id) TABLESPACE -a osm2pgsql -i -s -a belgium.osm.pbf -> Throws Warning that -s is not activated osm2pgsql -s -i -a belgium.osm.pbf -> SQL Syntax error (.... planet_osm_point USING BTREE (osm_id) TABLESPACE -a osm2pgsql -s -i -a belgium.osm.pbf -> Usage Error

Normaly, the Order of the Commands is not neseserry, or am i wrong?

Change History (6)

comment:1 Changed 6 years ago by errox

Clean Formating:

osm2pgsql -a -i -s belgium.osm.pbf -> Throws Warning that -s is not activated

osm2pgsql -a -s -i belgium.osm.pbf -> Usage Error

osm2pgsql -i -a -s belgium.osm.pbf -> SQL Syntax error (.... planet_osm_point USING BTREE (osm_id) TABLESPACE -a

osm2pgsql -i -s -a belgium.osm.pbf -> Throws Warning that -s is not activated

osm2pgsql -s -i -a belgium.osm.pbf -> SQL Syntax error (.... planet_osm_point USING BTREE (osm_id) TABLESPACE -a

osm2pgsql -s -i -a belgium.osm.pbf -> Usage Error

comment:2 Changed 6 years ago by jburgess777@…

I don't know where you get the idea that -i will get rid of the duplicate key warning. Whatever string follows the -i is interpreted as the table space to use for the indexes. This is why you see the parameter ordering influencing the result: whatever follows the -i is taken as the tablespace and not parsed as another command line switch. You can see this in your examples above where "-i -a" returns a message about creating an index in "tablespace -a".

I suspect you are attempting to import data from two neighbouring areas. This causes problems because some data may be duplicated along the border between the two imports. The better way to do this is to either import a single larger area (e.g. all of europe) or import the data into different databases or with different table names (--prefix).

comment:3 Changed 6 years ago by errox

I imported Germany. I tried to import belgium -> to big.

Luxembourg without -slim, only -a -> Not working (Duplicate Entry)

Luxembourg -a -i -> worked (Small, RAM was enough)

To import hole Europe was my first idea. This is an alternative.

See: https://trac.openstreetmap.org/ticket/4790

comment:4 Changed 6 years ago by errox

I Imported the Files with the --prefix command (tablenames are now: belgium_ways, ..... and so on).

But the renderjob doesnt get it.

How can i say to the Renderjob: look in all tables and not just planet_xxxx

See: http://forum.openstreetmap.org/viewtopic.php?pid=317787#p317787

comment:5 Changed 6 years ago by amm

The rendering setup doesn't really support rendering from multiple tables like that (belgium_ways_ ...)

Currently it is only propperly supported to import a single data file during the initial import. So you either need to find an extract that includes all the areas you wish to render (e.g. Europe.osm.pbf), or you can use osmosis [1] to merge various extract into a single osm file prior to import with osm2pgsql.

[1] http://lists.openstreetmap.org/pipermail/osmosis-dev/2010-July/000641.html

comment:6 Changed 2 years ago by pnorman

Resolution: invalid
Status: newclosed

The problems described seem to be user errors (weird usage of -i) and expecting osm2pgsql to do things it doesn't claim to do, and the ticket is 4 years old and unlikely to get any attention here.

Note: See TracTickets for help on using tickets.