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

osm2pgsql creates duplicate db entries when using extracts as source #4642

Closed
openstreetmap-trac opened this issue Jul 23, 2021 · 1 comment

Comments

@openstreetmap-trac
Copy link

Reporter: stephankn
[Submitted to the original trac issue database at 6.01pm, Thursday, 18th October 2012]

When creating a database using area extracts as input the database contains duplicate entries.

Reproduced with version 28761 and using burkina_faso geofabrik extract. Format of input file does not matter. Tested with both xml and pbf input.

Create test DB:

createdb -E UTF8 -T template0 -O osm testpbf
psql -d testpbf -c "CREATE EXTENSION postgis;"
psql -d testpbf -c "CREATE EXTENSION hstore;"
echo "ALTER TABLE geometry_columns OWNER TO osm; ALTER TABLE spatial_ref_sys OWNER TO osm;"  | psql -d testpbf

import using PBF as source:

./osm2pgsql -v --create --slim --cache 800 --hstore-all --database testreadpbf --username osm --style default.style --number-processes 1 --disable-parallel-indexing -r pbf ../burkina_faso.osm.pbf

Checking for duplicate ways returns 110 rows:

SELECT osm_id,count(1) FROM planet_osm_line GROUP BY osm_id HAVING count(osm_id) > 1 ORDER BY count(osm_id) DESC

For example relation 192783 is contained 36 times in the db. A grep on the input file confirms it's only one time there.

@openstreetmap-trac
Copy link
Author

Author: stephankn
[Added to the original trac issue at 10.18pm, Friday, 19th October 2012]

it was confirmed om irc osm-dev that this is actually the intended behavior of osm2pgsql as it splits up lines for the rendering.

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