osm2pgsql-dev / osm2pgsql

OpenStreetMap data to PostgreSQL converter

Home Page:https://osm2pgsql.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

osm2pgsql not able to convert geometry in pbf to db , but if I import to qgis ,jsom its opening correctly

RakeshGupta-TomTom opened this issue · comments

osm2pgsql version 1.6.0
osm2pgsql not able to convert pbf containing multi geometry to db
same pbf if uploaded to qgis / josm its valid geometry
importing pbf to db get all the information on planet_osm_rels table but planet_osm_polygon table does not have data

to reproduce the issue attaching pbf
test.pbf.zip
I did command

osm2pgsql -c -d test -U postgres -H localhost -P 5432 -E 4326 --hstore --output-pgsql-schema test --middle-schema test --slim -C 8000 -r pbf ~/test.pbf -W

use above command and check in db relation table will have all the info but polygon table does not have data

let me know if you need more information

Chances are your multipolygon is invalid for some reason. Different tools have different ideas on what constitutes a valid multipolygon in OSM. You can use the oat_create_areas tool from https://github.com/osmcode/osm-area-tools to check your data for validity. It can produce all sorts of debug output.

i tried using qgis check validity its not finding any error

I am not sure how to use oat_create_areas
can you provide command to run

The node IDs are in the 9E+18 range and way and relation IDs are in the 6E+18 range. Do you get the same results if you have more normal IDs?

we have same id in another pbf but thats working correctly

can we see error while using osm2pgsql command , i tried debug option but that not giving any error

Can you reduce this to a testcase with with just the offending relation and dependent objects? The PBF has lots of nodes unrelated to the relation which makes it difficult to see what's going on.

Like I asked above, if you have more normal IDs with this data, do you get a polygon? You can test this with osmium renumber.

sharing again t
test-working.pbf.zip
est file which has same id range and able to convert to polygon

@pnorman I did as per your suggestion used osmium renumbered id range 2000049000000000,2000049000000000,2000049000000000
osmium renumber -s 2000049000000000,2000049000000000,2000049000000000 test_notworking.pbf -o test_notworking_renum.osm.pbf --overwrite

still its not converting to polygon table

if you want can share the renumbered pbf

@pnorman @joto any update on this , have you guys found out the issue

Please don't ping maintainers on your issue asking for an update. If you need faster support, you could pay someone to provide it.

Please build oat_create_areas and run it on your PBF. The command provides its own documentation.

I've tried this now and can't reproduce the issue. Polygon imports fine on 1.6.0, 1.7.2 and master. Also no further information was provided by the reporter.

Closing as not reproducible.