Opened 7 years ago

Closed 7 years ago

#4642 closed defect (invalid)

osm2pgsql creates duplicate db entries when using extracts as source

Reported by: stephankn Owned by: jburgess777@…
Priority: critical Milestone:
Component: osm2pgsql Version:
Keywords: Cc:

Description

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.

Change History (1)

comment:1 Changed 7 years ago by stephankn

Resolution: invalid
Status: newclosed

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

Note: See TracTickets for help on using tickets.