NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

I have my style sheet the way I want, and was able to use generate_tiles_multiprocess.py to generate my png tiles for zoom levels 4-12.

My thought was to have the "big picture" be static png files, and then only query the database when someone zooms in past that since I don't need high detail of deserts, oceans and such. I have been having a hard time though where I can get it to work one way or the other, but it isn't working as I expected.

What I thought was an incoming request would come for tile http://127.0.0.1/tiles/6/5/5.png If that file existed, Apache would serve it up, if it doesn't it would hand off the request to mod_tile / renderd to render the view, which was then stored as a .meta file.

[renderd]
num_threads=8
tile_dir=/home/renderaccount
stats_file=/var/run/renderd/renderd.stats

[mapnik]
plugins_dir=/usr/lib/mapnik/3.0/input
font_dir=/usr/share/fonts/truetype
font_dir_recurse=1

[tiles]
URI=/tiles/
TILEDIR=/home/renderaccount
XML=/home/renderaccount/openstreetmap-carto/mapnik.xml
HOST=*
TILESIZE=256
MAXZOOM=20

Apache conf:

    ServerAdmin webmaster@localhost
    LoadTileConfigFile /usr/local/etc/renderd.conf
    ModTileRenderdSocketName /var/run/renderd/renderd.sock
    ModTileRequestTimeout 10
    ModTileMissingRequestTimeout 50
    DocumentRoot /home/renderaccount/
    LogLevel info 
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

asked 17 Aug '18, 00:03

AlanHalls's gravatar image

AlanHalls
16445
accept rate: 0%

Can you explain what "it isn't working as I expected" means? When you request a tile, do you get a "not found" error, or does it time out, or...? Anything in Apache's error log or in the syslog?

(17 Aug '18, 00:52) Frederik Ramm ♦

Great question. I have renderd running in debug mode so I can see what is happening. When I have it working with the png files, then nothing seems to get passed to renderd. When it works with meta files, it ignores the .png files. I have been using sysdig -c echo_fds proc.name=apache2 to watch what is happening to see even stuff that wouldn't get logged, but it isn't providing the insight needed to solve it.

(17 Aug '18, 01:10) AlanHalls

When looking at the output from renderd, I shouldn't see any output for anywhere on the map at zoom levels 5-12 since those are already rendered as PNG files right? And why do I have files like ./6/0/0/0/2/128.meta and ./6/0/0/0/1/136.meta If you check the webhost http://64.72.211.216 you can see all the files are there for that zoom level, why would it create a meta?

(17 Aug '18, 04:42) AlanHalls

Ah, I see now what has happened. proper answer following.

(17 Aug '18, 09:49) Frederik Ramm ♦

You have misunderstood how mod_tile and renderd are supposed to work.

The generate_tiles_multiprocess.py script would not normally be used by someone who wants to set up a tile server.

Instead, you would run a command like render_list which would generate meta tiles for the area and zoom levels specified. These meta tiles contain 8x8 PNG files each but the PNGs are never stored on disk directly. Instead, when a certain tile is requested through the web server, mod_tile will open the requisite .meta file, exrtact the PNG from there, and serve it. Only if the meta file is not there will mod_tile send a request to renderd to create it.

The tile directory that you have built with generate_tiles_multiprocess.py could be used to run a tile server completely without renderd and database - simply point DocumentRoot to your tile directory - but of course that server would be fully static, and not support updating or on-the-fly rendering of tiles.

permanent link

answered 17 Aug '18, 09:48

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
82.5k927201273
accept rate: 23%

Thank you so much for teaching me the difference. render_list is doing a great job and seems to be processing much faster than the png files.

(17 Aug '18, 17:39) AlanHalls
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×105
×80
×3

question asked: 17 Aug '18, 00:03

question was seen: 3,671 times

last updated: 17 Aug '18, 17:39

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum