0

I am working with osm2psql and imposm3 to load a postgres db with OSM data.

The performance of imposm3 is seemingly far in advance of osm2psql (to a factor of 4 i am finding).

However I cannot find a supported conversion to mapnik xml/json anywhere.

Has anyone any advice as to how to generate this, or if there's a good online source?

  • 1
    Have you checked github.com/mapbox/osm-bright? – user30184 May 11 at 15:25
  • Yes, but it doesn't take into account the imposm import with its simplified geometry tables. – Hairy May 12 at 10:35
  • 1
    It is hard work to write styles. Hopefully you'll find ready work by someone else to use as a template so you do not need to do all work for small scales yourself. Or then you can consider to use MapServer github.com/mapserver/basemaps or GeoServer geosolutionsgroup.com/blog/… instead of Mapnik. – user30184 May 12 at 10:46
  • I am looking for a style, but feel resigned to building my own. – Hairy May 12 at 11:28
2

Not sure what you mean by "conversion to mapnik xml/json", imposm3 is a tool to import osm data into postgresql, mapnik create tiles from postgresql data using an xml to describe what to display and how. You can specify the way imposm import data, and you can specify the way mapnik read and display data, so there is not really a conversion here.

I'm guessing you want a style that uses imposm default import. You can find an old exemple using toner light here (not sure if this still works): https://github.com/jplusplus/mapnik-styles or as user30184 said osm-bright: https://github.com/mapbox/osm-bright/blob/master/imposm-mapping.py

Usually, imposm is more commonly used to import data for analysis, and osm2pgsql is used when you want a classic tile server, which explain why there is not much out-of-the-box solutions. There shouldn't really be a need to use imposm if osm2pgsql does works, if you just need to tweak a little the display, you can just either modify the style or just add another layer with what you want to display. At least most people just use osm2pgsql for this reason.

I suppose you try to have fast rendering, but I'm not sure if the pre-processing of imposm with simplified geometry does a big difference on a classical tile server, mapnik is usually pretty fast and there should be more to gain elsewhere with cache and optimizing the style for exemple.

If you want to make your own style or personnalise one, you can look into mapbox studio, or the not maintained anymore tilemill (which I still use personally and works well), or magnacarto which is made by omniscale, the ones that makes imposm.

| improve this answer | |
  • magnacarto is not really helpfull to developp the style, it's more to convert it in mapserver or mapnik style – robin loche May 14 at 14:07
  • 1
    We had a look at all of those and they're just not quite right. Geoserver with Imposm3 and OSM styling through MapProxy is looking a winner at the moment. However, I will keep digging. – Hairy May 15 at 20:06

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.