Writing a tile server in Python

  • Having used raster MBTiles a lot for offline mapping, I would truly love a generic process that could take vector MBTiles, and then create a fully rendered raster tile from that data with the given stylesheet. If anyone knows of such a cross platform library, I would really like to hear about it. I know of a few projects, but they always have very platform specific code. My use case is multiple platforms, but using the same mapping engine. Something like Skia for rendering and handing back a Skia Canvas/Image with the rendered tile would work very well. We still need "tiles" in other words, but the source would be generated on the fly and cached to reduce overhead,

    Raster tiles get huge at level 12 onwards. For generic usage it is hard to take the entire planet and make it available in a way where any user can use the same file at any zoom level in any location. For me, vector would solve this in a much better way, as we have a lot more control over which features to include and what level of detail to have in specific areas to reduce the overall size of the data.

  • This like protomaps? https://protomaps.com/

  • >But Flask does not give control of what happens when the client suddenly closes the connection.

    It is so annoying that they don't give you a way to do this. I built an LLM inference API but am still working on how to cancel an inference job if a client cancels. I really don't want to rewrite my entire server in Twisted so I'll probably end up just building the HTTP responses like you did.

  • Note that titiler[0] exists, which is doing a pretty nice job.

    [0] https://github.com/developmentseed/titiler

  • [dead]