Skip to content
This repository has been archived by the owner on Jul 24, 2021. It is now read-only.

Append function in Combine with Tableindex / Slim not working #4796

Closed
openstreetmap-trac opened this issue Jul 23, 2021 · 6 comments
Closed

Comments

@openstreetmap-trac
Copy link

Reporter: errox
[Submitted to the original trac issue database at 7.59pm, Monday, 25th February 2013]

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?

@openstreetmap-trac
Copy link
Author

Author: errox
[Added to the original trac issue at 3.20am, Tuesday, 26th February 2013]

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

@openstreetmap-trac
Copy link
Author

Author: jburgess777[at]googlemail.com
[Added to the original trac issue at 11.17pm, Tuesday, 26th February 2013]

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).

@openstreetmap-trac
Copy link
Author

Author: errox
[Added to the original trac issue at 4.47pm, Wednesday, 27th February 2013]

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

@openstreetmap-trac
Copy link
Author

Author: errox
[Added to the original trac issue at 5.37pm, Sunday, 3rd March 2013]

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

@openstreetmap-trac
Copy link
Author

Author: amm
[Added to the original trac issue at 2.56am, Monday, 25th March 2013]

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

@openstreetmap-trac
Copy link
Author

Author: pnorman
[Added to the original trac issue at 10.25am, Tuesday, 3rd January 2017]

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant