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

I would like to be able to send single tile requests to mod_tile locally. Ideally, I would like to do this without going through apache since it is a waste of CPU time for my application : the request is coming from the same machine where the tile server is installed and the tiles are used locally.

From what I understood I can communicate with renderd via a UNIX socket. I'm ok with that, there's no real documentation but since I have access to the source code I think I can create a client socket, send the correct message and receive a reply from renderd.

Before I start implementing anything, I would like to ask if this is the correct way to proceed. I'm only interested in requesting a single tile at a time (meta-tiles are not good for me). If I'm communicating with renderd directly, without going through mod_tile, then this would imply that the tiles would always be rendered without profiting from mod_tile's cache, am I right?

Does mod_tile have a way to receive commands from either the command line or via a socket? Are there any tools available that allow to send a single tile request to mod_tile ? If not, how can I request a single tile from my tile server ?

Thank you for your time.

asked 16 Nov '15, 21:53

kgaitanis's gravatar image

accept rate: 0%

edited 16 Nov '15, 21:56

You should be able to use render_list or at least its code, see: bottom of the page.

permanent link

answered 16 Nov '15, 22:25

SimonPoole's gravatar image

SimonPoole ♦
accept rate: 18%

Thank you for your answer, however render_list generates meta-tiles. I'm interested in single tiles (in .png format). Generating meta-tiles and then extracting a single tile seems a little too long. Isn't there a way to get a single tile?

(17 Nov '15, 09:55) kgaitanis

Since mod_tile is an Apache module, it's not surprising that requests to mod_tile have to go via Apache.

Renderd generates metatiles on-disk, and doesn't send any image information in response to any requests - it takes a rendering request, puts the metatile on disk, and tells you that the request is complete. While you can take the metatile and decode it to fetch an image, there is a much easier way - just ask mod_tile for the image.

It's possible to set up renderd to use alternate sized metatiles, but I wouldn't recommend it.

I'm intrigued as to what you're rendering. You say that going via mod_tile is a waste of CPU time, but I would guess the overhead is less than 1% compared to the rendering time. Have you measured it? Perhaps you are optimising something that isn't really a problem?

permanent link

answered 17 Nov '15, 10:29

Andy%20Allan's gravatar image

Andy Allan
accept rate: 28%

That's the correct answer : mod_tile is an apache module. I'm just trying to avoid going through the localhost loop but apparently it is not possible. Thanks

(17 Nov '15, 10:33) kgaitanis

Follow this question

By Email:

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



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "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:


question asked: 16 Nov '15, 21:53

question was seen: 3,160 times

last updated: 17 Nov '15, 10:33

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