3

Is there any difference in rendering performance between using a osm2pgsql vs imposm imported PostGIS DB in Mapnik? Or asking it differently, is there any downside of using imposm if I only want to support full imports?

I'd be using OSM Bright style, which supports both, and I've seen that there is a big difference in import speed between the two, but I haven't found any information about how is the rendering part.

2 Answers 2

7

Besides hardware and other software, rendering performance depends on the database, custom indexes, and the SQL in the style rendered. The style makes a huge difference, and badly written layer definitions can result in abysmal performance.

If you change the database schema, it requires changing both the custom indexes and layer SQL, so it's not possible to directly compare.

Both imposm and osm2pgsql can import the data into tables in a way you define, so there's more overlap than not. This wasn't always the case, as osm2pgsql used to only support the standard schema.

Imposm has some features to do more import-time processing like simplification, and in the right conditions this can lead to some speed increases, particularly on middle zooms. This mainly matters when rendering for a WMS server, not a typical tile server.

My advice would be to go with whichever you find easier to develop with. When you start to worry about performance, you'll find it more productive to optimize the queries and custom indexes.

osm2pgsql has been around longer and is more commonly used, so you'll find more documentation and resources for it. The downside is there's more information around that was accurate 5 or more years ago, but is outdated now.

If you're looking to pay someone for work, Omniscale provides commercial support for Imposm, but there are more independent consultants who are familiar with osm2pgsql - including myself, so both have good options.

-1

Necromancing.
For the differences in rendering, the answer from Paul Norman applies.

But there is another difference between the two:

According to ninefinity.org, for an import of planet-latest.osm.pbf, the following applies:

Imposm3:

A full import takes around 6 hours on my server and about 10 hours with the diff feature enabled. I’ve done a full import with osm2pgsql once that took a whopping 10 days!

So, since Paul Norman says imposm might actually increase rendering performance, I'd argue that there is a strong case for going with imposm3. Time is money.

Also, about rendering performance, the only way to be sure is testing it on the hardware and software you use.

2
  • 1
    The site you’ve quoted is almost four years old. It doesn’t cover all those large scale changes in Osm2pgsql during the last years, i.e. this comparison is hardly representative of today’s situation.
    – mmd
    May 31, 2020 at 16:54
  • Second that.., severely outdated, and it doesn't even mention when and with what hardware the 10 day import was executed.
    – Marco_B
    Nov 30, 2020 at 12:46

Your Answer

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

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