Vector-Tiles-Reader-QGIS-Plugin icon indicating copy to clipboard operation
Vector-Tiles-Reader-QGIS-Plugin copied to clipboard

Support GeoServer Vector tile

Open sunshine0576 opened this issue 7 years ago • 65 comments

I want add Geoserver Vector tile layer to QGIS, How should I add a connection?

sunshine0576 avatar Nov 08 '17 06:11 sunshine0576

We did not yet test the plugin with a GeoServer connection. Can you provide us with remotely accessible source. A Vector Tile connection requires either a mbtiles file or a TileJSON file typically in the form https://yourdomain.xyz/data/v3.json according to TileJSON 2 spec: is here https://github.com/mapbox/tilejson-spec/tree/master/2.2.0 (which actually still has to be extended in order to reflect the add-ons Mapbox made in order to support Mapbox Vector Tiles, .mvt).

sfkeller avatar Nov 08 '17 07:11 sfkeller

The format of the request for Geoserver. http://localhost:8080/geoserver/gwc/service/wmts?REQUEST=GetTile&SERVICE=WMTS&VERSION=1.0.0&LAYER=sf:roads&STYLE=&TILEMATRIX=EPSG:900913:{z}&TILEMATRIXSET=EPSG:900913&FORMAT=application/x-protobuf;type=mapbox-vector&TILECOL={x}&TILEROW={y}

sunshine0576 avatar Nov 08 '17 07:11 sunshine0576

It could work if a TileJSON file is created and the tile url set to the link above. Additionally the required TileJSON values would have to be present (i.e. "vector_layers", "minzoom" and "maxzoom").

mnboos avatar Nov 08 '17 17:11 mnboos

Expect to be able to support Geoserver new features.

sunshine0576 avatar Nov 09 '17 07:11 sunshine0576

@sfkeller Should we implement GeoServer support?

mnboos avatar Nov 13 '17 11:11 mnboos

Yes, but not "directly" accessing zxy but as data source via the TileJSON metadata file.

sfkeller avatar Nov 15 '17 13:11 sfkeller

@sfkeller Geoserver support TileJSON metadata file.

sunshine0576 avatar Nov 17 '17 01:11 sunshine0576

We can't test GeoServer Support without an example of a remote server.

sfkeller avatar Nov 17 '17 06:11 sfkeller

@mtravis Are any of our Geoservers on versions recent enough to support vector tiles?

tomchadwin avatar Nov 17 '17 11:11 tomchadwin

I don't believe so. Let me check.

On 17 Nov 2017 11:13 am, "Tom Chadwin" [email protected] wrote:

@mtravis https://github.com/mtravis Are any of our Geoservers on versions recent enough to support vector tiles?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/geometalab/Vector-Tiles-Reader-QGIS-Plugin/issues/112#issuecomment-345216235, or mute the thread https://github.com/notifications/unsubscribe-auth/ABt0RgMHrjp7a_cTwdNxARi5JbQx9t6-ks5s3WpLgaJpZM4QV6pE .

mtravis avatar Nov 17 '17 11:11 mtravis

@sunshine0576 Do you know which Geoserver version introduced VT support?

tomchadwin avatar Nov 17 '17 11:11 tomchadwin

Its seems that the vt extension is only available with 2.11 onwards.

https://sourceforge.net/projects/geoserver/files/GeoServer/2.11.0/extensions/

@tomchadwin the shared geoserver is running 2.9

On Fri, Nov 17, 2017 at 11:18 AM, Tom Chadwin [email protected] wrote:

@sunshine0576 https://github.com/sunshine0576 Do you know which Geoserver version introduced VT support?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/geometalab/Vector-Tiles-Reader-QGIS-Plugin/issues/112#issuecomment-345217393, or mute the thread https://github.com/notifications/unsubscribe-auth/ABt0RpGmPGH2Dy3rXSQveY7aN9gfP1-Aks5s3WuWgaJpZM4QV6pE .

mtravis avatar Nov 17 '17 11:11 mtravis

And we can't use yours? @tomchadwin gives @mtravis a winningly persuasive smile

tomchadwin avatar Nov 17 '17 11:11 tomchadwin

image

Shamefully we are even further behind (need to upgrade ubunutu first). I've only just seen the whole thread so see that you need one for testing.

mtravis avatar Nov 17 '17 11:11 mtravis

And for fun...

tomchadwin avatar Nov 17 '17 11:11 tomchadwin

of course...

mtravis avatar Nov 17 '17 11:11 mtravis

Dear @flippmoke : Pls. allow me to bump on this again since here at Vector Tiles Reader for QGIS project (to be released end of 2017) we are heavily relying on remote TileJSON and mbtiles metadata, while TileJSON spec. still does not even mention Vector Tiles.

I'd really like to know now which metadata is going to be there - mandatory or optional.

Saying "we" I dare to include OpenMapTiles by @klokan, MapZen by @nvkelso, t-rex by @pka, as well as TileMaker by @systemed and others like GeoServer by @aaime (?) and PostGIS i.e. by @pnorman ...

sfkeller avatar Nov 19 '17 17:11 sfkeller

fwiw, I don't have any plans on including tilejson data with the projects I'm currently working on.

pnorman avatar Nov 19 '17 21:11 pnorman

@pnorman Thanks for the info (BTW you probably have been the first realizing this issue in 2014: https://github.com/mapbox/tilejson-spec/issues/14 !)

sfkeller avatar Nov 19 '17 21:11 sfkeller

Yes, would be good to get this finally sorted out - .mvt is in real danger of turning into the new Markdown (everyone uses it, no two clients parse/write it the same way).

systemed avatar Nov 19 '17 21:11 systemed

Hi, I had no part in adding MVT support for GeoServer, let me add into the loop @dblasby, @jodygarnett and @tbarsballe (sorry for the long lineup, I'm not sure who's maintaining vector tiles these days)

aaime avatar Nov 20 '17 07:11 aaime

The easiest way to connect to Geoserver vector tiles is via the standard OGC WMTS - you can use the GetCapabilies to get any meta data you need.

You can connect to it as a XYZ server, but (I believe) you have to use -Y ordinates.

There is a trivial example in the geoserver documentation - for OL3 (more on the OL3 site). You will need a recent geoserver, with the vector tiles plugin (extention) installed.

I don't think there is a tilejson meta data file - but not sure (that would be part of GeowebCache).

DBlasby avatar Nov 20 '17 07:11 DBlasby

I just wanted to let everyone know that we are working internally at Mapbox to update both the mbtiles and tilejson specs to be correct. Thanks you everyone for your notes about this, we definitely want to make sure it is all correct. If you have concerns for the individuals specs please add issues to the tilejson-spec (or a pull request is even better!). For mbtiles-spec the pull request that is listed above is being reviewed internally and we hope to release soon.

flippmoke avatar Nov 20 '17 21:11 flippmoke

@DBlasby Thanks for you answer.

Our VT QGIS client consumes three sources: Online (=TileJSON), File (mbtiles) and a local directory of unpacked vector tiles (still zipped PDFs but being in subdirectories according to the XYZ index).

The TileJSON contains metadata similar to WMTS GetCapabilies but not really. And I really prefer to build on a spec. which is aware of vector tiles - which is why I pushed tilejson-spec.

AFAIK GeowebCache has no support yet of TileJSON but probably can generate a local directory as described above. => Do you know who is the maintainer of GeoWebCache?

sfkeller avatar Nov 22 '17 10:11 sfkeller

Hi - @smithkm (kevin smith) is the GWC lead. You can contact him on the Geoserver-devel mailing list. http://geoserver.org/comm/

DBlasby avatar Nov 22 '17 16:11 DBlasby

That's the the current metadata read by this MBVT Reader QGIS plugin:

  • tiles: "https://domain.org/data/v3/{z}/{x}/{y}.pbf"
  • minzoom: 0
  • maxzoom: 14
  • bounds: [-180,-85.0511,180,85.0511] -- Synonym extent.
  • attribution: "<html_code>" -- optional, maybe empty string
  • crs: 3857 -- optional EPSG code; 3857 by default
  • vector_layers: -- List of layers, each described with id, description, minzoom, maxzoom and fields. For example (JSON): [{id: "road", description: "", minzoom: 7, maxzoom: 14, fields: {type:String, name:String}}, {id: "water", description: "", minzoom: 0, maxzoom: 14, fields: {name:String}}, ...]

sfkeller avatar Nov 22 '17 19:11 sfkeller

I'm not sure what kind of vector tile awareness you need in your protocol. WMTS doesn't require interaction with the content of the tiles so all it needs to support a format is the MIME type. GeoWebCache is able to handle all of its supported vector tile formats through WMTS. New tile protocols are fairly easy to plug in to GWC so if you want to implement this TileJSON protocol you are welcome to do so.

At the moment we recommend using the KVP profile of WMTS as the best tile protocol for most situations regardless of tile format. If you want to add additional metadata to WMTS capabilities, there is an extension point for that.

I'm not even sure what is meant by TileJSON being vector tile aware, the spec website just seems to be a lightly commented example and never even mentions formats other than that UTFGrid and GeoJSON for the interactivity and data sections. I'm not sure where vector_layers is coming from. I assume this is just something MapBox software uses but is not included in their published "spec"?

smithkm avatar Nov 24 '17 23:11 smithkm

Thanks @smithkm for your comments. You wrote:

I'm not sure what kind of vector tile awareness you need in your protocol.

It's currently really these attributes I listed before your comment:

  • tiles refers to the vector tile data (compressed pbf).
  • minzoom and maxzoom announce in which zoom levels there are tiles.
  • bounds and attribution (while attribution is IMHO the only optional attribute).
  • vector_layers contains the layers and their field names. This schema is used to prepare the layers e.g. of QGIS before vector tiles data is loaded.

I'm not even sure what is meant by TileJSON being vector tile aware ... I assume this is just something MapBox software uses but is not included in their published "spec"?

Exactly - and I hope Mapbox reads this ;-) That's what I'm saying since a long time! See https://github.com/geometalab/Vector-Tiles-Reader-QGIS-Plugin/issues/112#issuecomment-345535770 . Actually @flippmoke answered recently (see above) that they ...

are working internally at Mapbox to update both the mbtiles and tilejson specs to be correct.

sfkeller avatar Nov 25 '17 00:11 sfkeller

The WMTS capabilities document currently provides all of those except the attribute names. That could probably be added via the WMTS extension mechanism although it would require a mechanism for setting it (this would also be a problem for implementing TileJSON). This would be a somewhat similar issue to the handling of legend graphics. The underlying data for a layer might vary with zoom level or other things. I'm not sure but the details of what's included in a vector tile might also vary with the particular tile format. MapBox PBF vs GeoJSON, vs TopoJSON vs whatever. Also you can set the STYLE(S) parameter which at least in the case of GeoServer's vector tile implementation can alter the set of attributes returned. So a GWC TileLayer wouldn't have just one fixed set of attributes for its vector tiles.

smithkm avatar Nov 26 '17 01:11 smithkm

Yes, the nature of vector tiles (VT) is that the data and most probably the schema too changes at every zoom level. And the data and schema coming from different VT providers varies.

As said, vector_layers in de-facto TileJSON contains those field names for each zoom level. See e.g. https://gist.github.com/jatorre/6212354d5e023076797db7ea18540c33 . Without knowing these attributes a client has a hard time to prepare it's layers to load the data.

Regarding TileJSON the format is set/announced - most probably Mapbox pbf for Mapbox Vector Tiles (MVT) .

You wrote

Also you can set the STYLE(S) parameter which at least in the case of GeoServer's vector tile implementation can alter the set of attributes returned.

I can't follow here: Vector Tiles are not styled; styling is done by the client.

sfkeller avatar Nov 26 '17 02:11 sfkeller