3

I've a little problem with either the initial data (from Geofabrik) or the import (using osm2pgsql): I can't find some lines of a street in my city in the database while they are there on the OSM-Site (http://www.openstreetmap.org/).

So here is what I've done:

  • Downloaded the PBF from Geofabrik (karlsruhe-regbez-140706.osm.pbf)
  • Imported it using osm2pgsql (osm2pgsql -c -k -d osm -U postgres -H localhost -S openstreetmap-carto.style karlsruhe-regbez-140706.osm.pbf)
  • Trying to find a line which should be there (SELECT * FROM planet_osm_line WHERE "osm_id" = 132833416)

The line is part of a long street here in Karlsruhe and can be found via osm.org (http://www.openstreetmap.org/way/132833416#map=19/49.00566/8.40795&layers=D). The line "left" of the missing on is present in the database. The second next to it's right is there , too.

Versions used:

  • osm2pgsql SVN version af61cae663 (64bit id space)
  • PostgreSQL 9.3.4 x64
  • PostGIS 2.1.3 x64

Am I doing something wrong? No errors are shown, by the way. Any chance to find out if the line in question is in the PBF at all?

  • After using the 32Bit version of osm2pgsql I finally got the missing lines imported to PostgreSQL/PostGIS as well. I was forced to use the "slim mode" as of the 3GB RAM limit and the amount of data processed. Maybe this was/is the trick, too? I'll give it a try again with 64Bit and "slim mode" later the day. Thanks again Andre for raising my interest in the 32Bit versions ;) – GeneralOfTheFelixLegions Jul 8 '14 at 8:11
  • This sounds like it is to do with an unsorted pbf file and NOT using Slim Mode.There has been some discussion on GIT about this over the past couple of months. I use slim mode on the 64 bit anyway and you need it if you want to apply diff updates – Mark Cupitt Jul 9 '14 at 2:02
  • I haven't tried yet - been busy yesterday - but you're suggesting it will work using the 64Bit Version AND "slim mode"? So the solution IS using the "slim mode" as long as I have no control over the (un)sorted PBF-File, right? – GeneralOfTheFelixLegions Jul 9 '14 at 6:51
  • Thats my understanding. I have always used slim mode and flatnodes and so far, touch wood, no issues. There is some discussion [Here] (github.com/openstreetmap/osm2pgsql/issues/…) about it, but it seems so build and platform dependant. I use the 64bit version and have imported country and planet pbf files, so far no issues. My import osm2pgsql commands are here – Mark Cupitt Jul 9 '14 at 12:17
  • I am always using -s, that's why it worked for me from the start. – AndreJ Jul 10 '14 at 12:31
1

At least it is in the pbf file:

enter image description here

I filtered the file with osmosis for ref="B 10", and loaded the result into QGIS.

Osm2pgsql needs a bit longer, but has the line in the same way. Same osm2pgsql version, but with an extended default style, and 32bit PostgreSQL 9.3 using Windows 7.

EDIT

Mapnik for Windows is currently only available for 32bit, so you might not get lucky with 64bit builds of Postgis/PostgreSQL or python.

  • Thank you Andre for your post. I'll give the 32bit Versions of PostgreSQL/PostGIS a try to see if the problem sits there. I'm planning to create tiles using TileMill. So for the further processing the 32/64Bit shouldn't be the question. – GeneralOfTheFelixLegions Jul 8 '14 at 6:11
3

I Finally found the relevant post from Paul Norman and Andre Joost on a similar Question ..

What is occuring appears to be a somewhat subtle bug with osm2pgsql where osm2pgsql requires id-sorted nodes, but the API does not guarantee that.

The easiest solution is to import with --slim --drop. The --slim flag causes osm2pgsql to use the database instead of memory for temporary storage, which gives an option for coping with unordered files. The --drop flag causes the temporary information to be dropped from the database when osm2pgsql is finished.

Another option would be to use osmosis and --sort the XML file, but I don't suggest this as it's more complicated and requires installing osmosis.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.