Geographic Information Systems Asked on April 21, 2021
recently I have installed the Geoserver with vector tile layer extension, getting the data in pbf (Mapbox vector tile format).
http://localhost:8080/geoserver/gwc/service/wmts?REQUEST=GetTile&SERVICE=WMTS&VERSION=1.0.0&LAYER=VectorTileLayer:tbl__analysis&STYLE=&TILEMATRIX=EPSG:4326:{z}&TILEMATRIXSET=EPSG:4326&FORMAT=application/json;type=geojson&TILECOL={x}&TILEROW={y}
I want to convert this request URL to RESTfull like this.
http://localhost:8080/geoserver/gwc/service/wmts/1.0.0/blocks/{z}/{x}/{-y}.pbf
I have tried many methods but none of them working
My goal is to get the data in RESTful link for vector tiles .pbf layer
Geoserver currently doesn't support any restful service for URL mapping for wmts.
To use mapbox vector tiles served by GeoServer, you can do it like this:
// First the layer URL pattern
var layerWMTS = 'http://localhost:8080/geoserver/gwc/service/wmts?layer=public:list_parcels_hobart_4326&tilematrixset=EPSG:900913&Service=WMTS&Request=GetTile&Version=1.0.0&Format=application/x-protobuf;type=mapbox-vector&TileMatrix=EPSG:900913:{z}&TileCol={x}&TileRow={y}'
// Now add the layer
map.addLayer({
'id': 'geoserver',
'type': 'fill',
'source': {
'type': 'vector',
'tiles': [
layerWMTS
]
},
'layout': {
'visibility': 'visible'
},
'source-layer': 'list_parcels_hobart_4326',
'paint': {
'fill-color': 'rgba(244, 131, 66, 0.4)',
'fill-outline-color': 'rgba(244, 131, 66, 0.9)'
}
})
This is about as simple as it gets. Note that some of the keywords need to be changed, soch as the layer=public:list_parcels_hobart_4326
section of the layer URL, and the 'source-layer': 'list_parcels_hobart_4326'
of the layer parameter object. These can be taken from what you have configured in GeoServer.
And just a note to say that I think that GeoServer's vector tiles are pretty good, but it doesn't seem configurable, so you can't change simplification and such. I have a bit of exploration over here, although it's probably not well documented and a bit messy!
Answered by Alex Leith on April 21, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP