I am examining data imported into a PostGIS database with osm2pgsql and I have noticed some values in the osm_id (which I assume is unique) are negative. Is that ok? asked 18 Jan '11, 13:28 Tomas Pajonk edited 21 Jan '11, 09:17 TomH ♦♦ |
One Answer:
osm_id is only unique within element types in OSM database (but not in osm2pgsql schema, see the comment from pnorman below). So the same osm_id can apply to a node, a way and a relation. That's why osm2pgsql polygon table changes the sign of the relation id when it comes from relations and the original positive way id when it comes from simple closed ways. answered 18 Jan '11, 13:49 Pieren edited 03 Jul '14, 12:12 |
Thank you.
More background Information is in Wiki https://wiki.openstreetmap.org/wiki/Osm2pgsql/schema#Processed_Data
osm_id is not unique in osm2pgsql's tables. Long ways are split by osm2pgsql into multiple rows with the same osm_id and multipolygons with distinct areas are also split into multiple rows.