1

Question: Is there a reason to use a TMS over WMTS call to GeoServer to pull vector tiles?

My goal is to pull vector tiles from my Geoserver to my Leaflet-based web application. Unfortunately, the Geoserver docs only explain something for OpenLayers (example using TMS), so I'm unsure what is good practice. I have installed Vector Tiles Extension into Geoserver and L.vectorGrid.protobuf into my Leaflet application.

My options for retrieving these vector tiles seem to be between TMS and WMTS, but I don't know why I would choose one over the other.

My calls are in this format:

  • WMTS L.vectorGrid.protobuf: var myLayer = L.vectorGrid.protobuf('http://localhost:8000/geoserver/gwc/service/wmts/rest/city:roads/line/EPSG:900913/EPSG:900913:{z}/{y}/{x}?format=application/vnd.mapbox-vector-tile').addTo(this.map);

  • TMS L.vectorGrid.protobuf call: var myLayer = L.vectorGrid.protobuf('http://localhost:8000/geoserver/gwc/service/tms/1.0.0/city:roads@EPSG:900913@pbf/{z}/{x}/{-y}.pbf').addTo(this.map);

Both seem to render the same, just a slight difference in the response when there is an out-of-bound tile requested:

TMS: gives a 404 response for out-of-bound tiles
WMTS: gives a 400 response for out-of-bound tiles

So why choose TMS or WMTS when retrieving vector tiles from GeoServer?


Updates to prior text:

As mentioned by @TomazicM, L.tileLayer renders only raster layers, so is not appropriate for vector tiles (also briefly mentioned in Leaflet under the Raster heading).

Logreen
  • 41
  • 4
  • 1
    Preference, for which version of WMST URL pattern to use (KVP or RESTful) just like the output format, is for the client (software). The service provides multiple ways to satisfy as many different types of clients as possible. – nmtoken Mar 16 '23 at 13:24
  • Your first 2 questions will be answered by reading the standards documents. – Ian Turton Mar 16 '23 at 13:28
  • Please limit you question to only one question, otherwise it's most likely be closed as not compliant with the site policy of focused questions. – TomazicM Mar 16 '23 at 13:29
  • i'd avoid using geoserver for vt's. look into martin or pg_tileserv..MUCH easier to setup and implement into the web map – ziggy Mar 16 '23 at 13:49
  • Thanks for the comments, that helps with some of the confusion.

    @TomazicM, would you recommend I remove this question and ask them separately?

    – Logreen Mar 16 '23 at 20:56
  • First edit this one and leave only one focused question, then post the other two as separate questions. – TomazicM Mar 16 '23 at 21:18
  • Ok great, thanks. Updated the post to hopefully be clearer and more focused. – Logreen Mar 17 '23 at 01:11
  • No, it's still a way to broad. And it's event not clear what exactly the focused question is. Try something and if it doesn't work, describe what you have tried and how to make it work. And by the way, L.tileLayer is for raster layers, so you can't use it for vector layers. – TomazicM Mar 17 '23 at 09:06
  • I tried several things over the past 2 weeks, and only now have gotten to this. There is no documentation of a Geoserver-Vector Tile-Leaflet implementation (maybe because as @ziggy said it's something to avoid). But now it renders and I am not sure after reading through the TMS doc (https://wiki.osgeo.org/wiki/Tile_Map_Service_Specification) and some of the 190 pages of the WMTS doc (https://www.ogc.org/standard/wmts/) about why one would choose TMS over WMTS or vice versa. Thank you for the tip about the L.tileLayer - I see that now in the docs, makes sense now. – Logreen Mar 17 '23 at 09:56
  • See https://gis.stackexchange.com/questions/132242/what-are-the-differences-between-tms-xyz-wmts – TomazicM Mar 18 '23 at 21:08
  • Thanks, I saw that, so guess that it's just a matter of which protocal you would like to use (and which is supported by your frontend). They seem to do the same thing anyway, just different sponsors. Beyond that, I'm not aware of the nuances to choose one over the other. – Logreen Mar 19 '23 at 09:45
  • Seems like in GeoServer's main list of services, the WMTS is provided, while TMS is not. So seems like TMS is there for more compatibility. – Logreen Mar 19 '23 at 09:59

0 Answers0