2

I try download OSM planet into PostgreSQL database.

I do all steps from instruction http://switch2osm.org/serving-tiles/manually-building-a-tile-server-12-04/

I also modify string "kernel.shmmax"

Now I try download:

osm2pgsql --slim -d gis -C 800 --number-processes 4 planet-latest.osm.pbf

But I have error:

Reading in file: planet-latest.osm.pbf
Processing: Node(2041920k 189.9k/s) Way(199297k 3.39k/s) Relation(47930 14.42/s)osm2pgsql: PolygonBuilder.cpp:261: geos::geomgraph::EdgeRing* geos::operation::overlay::PolygonBuilder::findShell(std::vector<geos::operation::overlay::MinimalEdgeRing*>*): Assertion `shellCount <= 1' failed.

Emergency stop(made a memory dump)

How can I solve this problem?

UPDATE

It is important to know, that the problem is in data. I use planet-latest.osm.pbf 10-Oct-2013 13:29 22G

When I download rostov.osm.bz2 there are no problem.

Which version of libgeos is usefull for me?

UPDATE 2

Well. It is interesting to know, that I try to download planet-131002.osm.pbf file. I verify md5. It is equal.

UPDATE 3

I instal the latest version of libgeos. It is 3.3.3-1. Then I try download planet-131002.osm.pbf, and then planet-130614.osm.pb

But I have the same problem.

asked Oct 15, 2013 at 5:42
3
  • I am having the exact same problem with the planet-latest.osm.pbf from Sept 25 2013. I am also using the guide mentioned. Where can I find rostov.osm.bz2? Is that an entire planet file? Thanks Commented Oct 15, 2013 at 11:56
  • This does not really answer the question. If you have a different question, you can ask it by clicking Ask Question. You can also add a bounty to draw more attention to this question once you have enough reputation. Commented Oct 15, 2013 at 12:23
  • Yes, sorry about that. I really wanted to post a comment, but it ended up an answer. That was not my intent. Commented Oct 15, 2013 at 12:35

1 Answer 1

4

I had the same problem, and here is how I solved it:

The problem lies in PolygonBuilder.cpp within the libgeos library. The line causing the problem has actually been fixed already, but the fix is not in the current ubuntu/debian repository that is installed via apt-get. Details of the change can be found here.

I downloaded the libgeos from github and built the package from source using their instructions. I then removed the installed version of libgeos-dev using apt-get autoremove. This actually removed a few other dependent packages that I later had to reinstall. (libgdal-dev) The important thing here is to rebuild the osm2pgsql package which links against libgeos library. I also recompiled mapnik, which needed the libgdal-dev library that I previously removed when autoremoving libgeos-dev. This step may or may not be necessary, but I wanted to make sure everything that used libgeos was recompiled. After these steps I got past roadblock.

Overall I wasted a couple weeks of effort since it took so long to load the planet file into the database. (Increasing the memory cache configuration really speeds things up.) I ran this command when importing.

osm2pgsql --silm -d gis -C 28000 --number-processes 8 /tile/planet-latest.osm.bz2

Recap.

  1. Remove installed version of libgeos-dev

    apt-get remove libgeos-dev

  2. Download and install libgeos from github

  3. Recompile and install osm2pgsql and possibly other packages that use libgeos.

  4. Import the database and wait...

Hopefully this will help you and others.

answered Oct 16, 2013 at 1:27
5
  • I can see that you wanted to share your experience, and tell us how you solved the problem. Hence I took the liberty of editing it, to structure it like an Answer. Commented Oct 16, 2013 at 2:57
  • Please delete this answer. I responded too hastily. The process went much further along, but did crash with the same error during the Relation section of loading the data. I have confirmed that the build instructions do not work with the entire planet file. A smaller file such as the North America continent does work. Please delete my answer. I'll crawl back into my hole and wait for a resolution myself. Commented Oct 21, 2013 at 14:38
  • You can delete it yourself. Just press 'Delete' link beneath the answer. Commented Oct 21, 2013 at 15:35
  • I have created a chef-solo app based on switch2osm.org/serving-tiles/… and incorporating the fix suggested by Joe Y. It's a very much work in progress. It's available here: github.com/radekg/osm Commented Dec 1, 2013 at 14:32
  • Jesus! -C 28000 --number-processes 8 !! How much memory have you? Commented Apr 5, 2017 at 11:26

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.