How do I pre-generate raster map tiles (png) for zoom level 1-11 ?

Hi

I want to pre-generate raster map files (.png) for the whole world, and only for zoom-level 1-11, using the same style as used on the “standard” map on the openstreetmap.org website.

If possible I would like to extract the levels 1-11 from the planet osm file, or remove the other levels from that file, before starting to pre-generate the tiles.

I would like to generate the tiles on my local computer, and upload the generated image (png) tile to a web hotel.

What, preferabely free, software do I have to install and use, and what is the procedure on how to accomplish the above tasks?

I will use Leaflet to handle the display of the tiles in the browser.

The allocation of features to zoom levels is not encoded in planet.osm.

I believe all the tools commonly used are open source.

Have you read https://wiki.openstreetmap.org/wiki/Creating_your_own_tiles and if so what part of it is giving you problems?

Okay, so I then have to:
a) import whole planet or one or more sub regions into the database.
b) then use renderd to pregenerate tiles for a specific zoom range.

Is that correct?

A few thoughts:

For tile disk usage at any zoom level see https://wiki.openstreetmap.org/wiki/Tile_disk_usage .

If you just want to generate tiles and not update them then you can import Europe, generate tiles for that, throw that away, import North America, generate tiles for that, etc. That will mean that you don’t need to have hardware in place to handle the whole planet at once, but you’ll either still need quite a large server (for the larger continents) or lots of iterations (country by country).

As you’re only interested in up to zoom 11 you could edit your chosen style to not reference any features only displayed from z12 and above, and also edit the project.mml and osm2pgsql style file to neither extract not process data that you’ll never see. In addition you can use osmfilter to remove from the data that you import things that you are not interested in. However, this all requires a level of familiarity with osm2pgsql and carto-based style files that you probably do not have yet.

Thanks for your information. Looks like a good idea to import smaller planet areas instead of the whole planet and render the tiles area by area. But first I need to get to the point where I’m actually able to pre-generate raster tiles - that look good. On my first tries, I only got water color and white land area. The reason for that was probably because I did not use generate_xml.py before using generate_tiles.py. Now it’s starting to look like a map, but things get misaligned, lots of roads missing etc.

I have described my current problem in another thread - where I also show how the pre-generated tiles look in a map, and compared to the map in the openstreetmap.org - here:
https://forum.openstreetmap.org/viewtopic.php?pid=708828#p708828