My openstreetmap database have import the asia.osm.pbf, and the gis database have import the planet-lastest.osm.pbf, when i make an edit on the openstreetmap db by iD editor, and use osmosis command to produce a changes.osc.gz file, then i use the "osm2pgsql --append --slim -H 192.168.1.162 -P 5432 -d gis -U postgres -C 160 --number-processes 3 changes.osc.gz -e15 -o expire.list" command to import the changes.osc.gz into gis db, some error occurs, i don't know how to solve it. And i didn't find a solution on the internet, so i ask a question here, hope someone to help me. This error disappears when i add a projection parameter "-E 3857", but other error occurs, the detail error message is:
asked 30 Dec '16, 13:57 yuyy Frederik Ramm ♦ |
It appears that you have downgraded your osm2pgsql version from 0.92 or later to 0.82 after doing the first import. This would explain your initial problem (since 0.92 started using EPSG:3857 as the default, while earlier versions were using EPSG:900913), as well as your follow-on problem (because osm2pgsql 0.82 was using an additional column called "pending" on the database tables that was later removed). While you found a valid workaround for the projection issue, a workaround for the missing columns would be more cumbersome. (See https://github.com/openstreetmap/osm2pgsql/blob/master/docs/migrations.md for information on migrating osm2pgsql-imported data between versions, but note that 0.82 is so old that it might already warrant the attribute "ancient".) You should be able to solve your problem by using the same osm2pgsql version for the initial import and the subsequent updates. (Hat tip to lonvia and pnorman who told me this on IRC.) answered 02 Jan '17, 10:32 Frederik Ramm ♦ |
osm2pgsql's default projection is 900913, but your tables from first (and/or previous) import is in 3087. The simplest way round this is to add a projection parameter "-E 3857". (although 3857 & 900913 are for most purposes identical, PostGIS does not know this)