omniscale / imposm3

Imposm imports OpenStreetMap data into PostGIS
http://imposm.org/docs/imposm3/latest/
Apache License 2.0
725 stars 159 forks source link

Duplicate rows #85

Closed pnorman closed 8 years ago

pnorman commented 8 years ago

I ran imposm3 import -mapping imposm3_mapping.json -cachedir ~/replicate/imposm3_cache/ -diff -connection='postgis://?prefix=NONE' -read british-columbia-160122.osm.pbf -write -deployproduction -overwritecache with a geofabrik extract and imposm3_mapping.json I get duplicate rows

=> select * from planet where osm_id=203962976;
-[ RECORD 1 ]--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
id       | 1869877
osm_id   | 203962976
tags     | "aeroway"=>"apron"
the_geom | 0102000020110F000006000000E82039D9E54C6AC14BC45072A8F957419F739036E74C6AC1B79B6562AEF95741286FBC90E74C6AC1E8915AE9AFF95741B0D11AABE14C6AC17EBC399ABCF95741728397F3DF4C6AC1D9AD38ABADF95741E82039D9E54C6AC14BC45072A8F95741
-[ RECORD 2 ]--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
id       | 1869878
osm_id   | 203962976
tags     | "aeroway"=>"apron"
the_geom | 0103000020110F00000100000006000000286FBC90E74C6AC1E8915AE9AFF95741B0D11AABE14C6AC17EBC399ABCF95741728397F3DF4C6AC1D9AD38ABADF95741E82039D9E54C6AC14BC45072A8F957419F739036E74C6AC1B79B6562AEF95741286FBC90E74C6AC1E8915AE9AFF95741
pnorman commented 8 years ago

a ha - one is a polygon and the other is a linestring

   id    |  osm_id   |                                                                                                           st_astext                                                                                                           |        tags
---------+-----------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------
 1870999 | 203962976 | LINESTRING(-13788974.7882237 6284961.78617961,-13788985.7051333 6284985.53745168,-13788988.5230022 6284991.64615295,-13788941.3470238 6285042.40977394,-13788927.6122453 6284982.67533442,-13788974.7882237 6284961.78617961) | "aeroway"=>"apron"
 1871002 | 203962976 | POLYGON((-13788988.5230022 6284991.64615295,-13788941.3470238 6285042.40977394,-13788927.6122453 6284982.67533442,-13788974.7882237 6284961.78617961,-13788985.7051333 6284985.53745168,-13788988.5230022 6284991.64615295))  | "aeroway"=>"apron"

Is a column of id type supposed to be usable as a primary key?

ImreSamu commented 8 years ago

maybe related : https://github.com/omniscale/imposm3/issues/51

pnorman commented 8 years ago

Ah, yes, duplicates #51