Hi Tom, > osm_id field contains non-unique values as well as negative values
This is normal. Osm2pgsql optimised for rendering. - The osm2pgsql program now spliting long ways after around 1 degree or 100km https://github.com/openstreetmap/osm2pgsql/search?utf8=%E2%9C%93&q=Split+long+ways - "--multi-geometry (-G) is necessary for most analysis as it prevents MULTIPOLYGONs from being split into multiple POLYGONs ..." https://github.com/openstreetmap/osm2pgsql/blob/master/docs/analysis.md - negative values: relations https://help.openstreetmap.org/questions/2259/is-there-a-reason-why-osm2pgsql-produces-negative-osm_id-values The easy solution for a primary key : ALTER TABLE tablename ADD COLUMN gid SERIAL UNIQUE; (from https://github.com/openstreetmap/osm2pgsql/issues/446 ) Regards, Imre 2015-11-23 20:23 GMT+01:00 Thomas Endres <[email protected]>: > Hi, > I have a couple post-import questions regarding North America osm data - > hoping someone can help. > Using the following with Postgres 9.4.5 and PostGIS 2.2 on an ubuntu > instance. > > osm2pgsql --create --slim --cache 14000 --number-processes 4 --hstore -d > osm --flat-nodes /usr/local/osm/flat_nodes.bin --style > /usr/local/osm/default.style --multi-geometry > /tmp/north-america-latest.osm.pbf > > 1- I'm trying to add a primary key on a few tables (on the osm_id field) > for use in QGIS. Problem is the planet_osm_line table for example errors > as the osm_id field contains non-unique values as well as negative > values.(?) > Is the slim mode or flat-nodes causing me problems? > > 2- Should I have used the -l switch on import for epsg:4326 - I used > nothing and assumed it would default to 900913? > > Thanks! > -tom > > _______________________________________________ > postgis-users mailing list > [email protected] > http://lists.osgeo.org/mailman/listinfo/postgis-users >
_______________________________________________ postgis-users mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/postgis-users
