Hi. So I have pre-rendered tiles on Windows using mapnik python scripts. Now I want to serve and route them somehow to our web application. I think we want to use leafLet.js or something like this. I've been googling for solutions and I found many and I think that TileCache will be best: http://tilecache.org/docs/README.html What is your experience with this? What would you recommend for Windows Server 2012 64-bit ?

P.S. Don't tell me to use Linux, I hate Linux, so I am only looking for Windows solutions.

Thank you :-)

asked 20 Jan '17, 22:29

Koles500's gravatar image

Koles500
53337
accept rate: 0%

I would suggest using Linux as base system! :-) SCNR Have a nice weekend, everyone!

(20 Jan '17, 22:34) aseerel4c26 ♦
1

I asked not to recommend me damn Linux. Please read carefuly and answer only if you have something worth sharing. Thank you.

(20 Jan '17, 22:36) Koles500
1

For various reasons, people doing stuff with Windows servers on OSM is fairly rare. However I'm not sure I understand the problem here. It sounds like you:

  • Don't have lots of zoom levels (based on the other question you asked)
  • Don't want to render tiles for a huge area (likewise), so no need to render on demand.
  • Don't want to update tiles based on live changes to OSM

In that case wouldn't you just copy the tiles you've generated to the web server that's serving them whenever you need to? Clearly I'm missing something here, because if that was the case you wouldn't be asking the question here :)

Would it be possible to explain in a bit more detail what you want the "missing bit in the middle" to do?

(20 Jan '17, 22:53) SomeoneElse ♦

Yes, I am getting over various difficulties with pre-rendering and we will have soon nice pre-rendered Europe with quite many zoom levels and symbols, etc. The thing is I have no idea o.O how to serve these tiles to our web application, in other words how to change data source to our other server where I keep these tiles. The tiles are generated in some weird folder structure e.g. C:\Tiles\10\486\330.png - how do I route this thing ?? leafLet.js seems to use X,Y,Z.png HTTP query which looks reasonable, but how to translate such query to tiles rendered by mapnik ?

(20 Jan '17, 22:57) Koles500
3

The good news is that the weird folder structure is what leaflet is expecting. For example, if I look at a tile being served by leaflet at osm.org that covers Tuam at zoom 9 I see https://a.tile.openstreetmap.org/9/243/165.png . That's what Leaflet expects, and you can (on Linux) have something that plugs into Apache to make that available from a more compact file format or (on any platform) just serve the file at that address.

The problem that you may have with this is that you'll have a lot of small files, possibly too many to reasonably manage on a web server. The Linux "mod_tile / renderd" combination solves this by only rendering tiles on demand, and storing them in larger metatiles (search for "metatile" at https://github.com/openstreetmap/mod_tile for more info). There may be something that does this for windows, but I doubt it. Leaflet itself does support various plugins though: http://leafletjs.com/plugins.html .

(20 Jan '17, 23:18) SomeoneElse ♦

Thank you. I am still positivly thinking about continuing this work on Windows and trying zoom levels 1-16 for whole Europe. What are your reasons to say that "having a lot of small files, possibly too many to reasonably manage on a web server" ?

(21 Jan '17, 00:05) Koles500

The "having a lot of small files" point was because I've seen that cause problems on some OSes (QNX most noticably, but also Linux I expect if you're not prepared for the number of inodes you'll need). I've no idea whether modern Windows filesystems would have that problem.

(23 Jan '17, 13:49) SomeoneElse ♦
2

You can use mbtiles with leaflet & should work OK with Windows. You will need a utility to convert your 'weird' directory structure to mbtiles. Take a look at this example https://gitlab.com/IvanSanchez/Leaflet.TileLayer.MBTiles/tree/master

(24 Jan '17, 10:02) SK53 ♦
showing 5 of 8 show 3 more comments

As you are familiar with python I would suggest to use SimpleHTTPServer.

And if you want to create your own http server using python here is the blog.

And for enterprise grade solution check nginx, please see the tutorial for serving static content

permanent link

answered 23 Jan '17, 11:55

Gagan's gravatar image

Gagan
2912413
accept rate: 14%

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:

×312
×156
×54
×42

question asked: 20 Jan '17, 22:29

question was seen: 2,810 times

last updated: 24 Jan '17, 10:02

powered by OSQA