maptiler / tileserver-gl

Vector and raster maps with GL styles. Server side rendering by MapLibre GL Native. Map tile server for MapLibre GL JS, Android, iOS, Leaflet, OpenLayers, GIS via WMTS, etc.
https://tileserver.readthedocs.io/en/latest/
Other
2.24k stars 639 forks source link

Dynamic layer loading #20

Closed manueltimita closed 8 years ago

manueltimita commented 8 years ago

Is there any way to dynamically change any of the configuration (data & styles) without restarting the server?

Great work, by the way!

klokan commented 8 years ago

Thanks for praising. A pleasure to hear you find our work useful...

No, this feature is not available yet. What is your exact use case?

A clean contribution would be welcome! ;-)

At @klokantech, we need something like #21

manueltimita commented 8 years ago

Thank you for the quick reply.

The praise is more than deserved. Been testing it last night and it works beautifully, and with such low consumption of RAM and CPU, even when having to pre-render the tiles on the server side. Slick!

My use case is not yet very well defined, but with the other two tiling technologies that I'm using (Mapnik and Geoserver), you get this flexibility: dynamically adding/changing/removing layers, and adding/changing/removing styles. Think of an app that has several users: they will be creating and editing these resources, and publish them as they wish. The server should, ideally, pick up the changes on the fly.

Anyways, a simple workflow would be like this: the user has data in PostGIS, for slicing, dicing and other operations. They would then use SQL queries to export various views of this data as JSON, to the disk. On Node, tippecanoe could be spawned as a child process, and convert the JSON to .mbtiles, create a basic style, and then notify tileserver-gl about the new config. The user can then use a UI to view the newly created vector tiles, edit the style, etc.

I am just getting my head around the concept of vector tiles from .mbtiles (as opposed to having them cut dynamically, like with Mapnik) learning as fast as I can, so it would be a little while until I could contribute a PR. I just realised today that one downside of them is that features inside the vector tile cannot be filtered out before serving (unless the tile is pre-rendered, as raster, with something like tileserver-gl). You know, like a quick and dirty row-level security baked into the tile ;-)

Regarding your last point, I didn't realise, but is it possible with vtiles to 'attach' arbitrary GeoJSON to a style?

Thanks!

klokan commented 8 years ago

Sounds like your request asks for "reload" of the config on submitting of a SIGHUB or similar event, instead of restart of the server.

klokan commented 8 years ago

For config reload there is #22 ticket now.

You have been interested in dynamic data source. Your GL JSON styles may contain a link to load vector tiles from a remote URLs with .pbf. In such case you can setup a vector tile server serving vector tiles directly from you PostGIS.

I think GeoServer can do that now (including caching). See: https://2016.foss4g-na.org/session/vector-tiles-geoserver-and-openlayers https://github.com/stefan0722/gs-mvt

Then TileServer-GL can be used just as a GL renderer - serving MapBox GL JSON styles as raster tiles. We internally use TileServer-GL for prerendered MBTiles in basemaps and other applications, where data are not updated that often (nightly or weekly updates for example).

Mapnik can generate MVT tiles on demand as well - from your PostGIS.

I don't see any other action on this ticket.