Discussion:
[MapProxy] WMTS layers using different styles from WMS backend
Travis Kirstine
2018-09-12 13:26:40 UTC
Permalink
Trond

From my experience to provide a layer in a tile based service you must have
a cache defined, so you are correct.

If you are interested tagged source names in the layers to do this to some
extent for WMS service

https://mapproxy.org/docs/nightly/sources.html#tagged-source-names

"layers" : [
{
"name" : "testlayer"
"title" : "testlayer",
"sources" : [wms_myserver:testlayer
],
},
{
"name" : "testlayer2"
"title" : "testlayer2",
"sources" : [wms_myserver:testlayer2
],
}
]

However since there is no cache defined for the layers these layers would
only be available in a WMS service, request to this service would simply be
proxied to the backend source wms.

You could then use the tile_source to define layers which would be
available in the tile services

"layers" : [
{
"name" : "testlayer"
"title" : "testlayer",
"sources" : [wms_myserver:testlayer],
"tile_sources": [cache_testlayer], # assuming you've defined a
cache 'cache_testlayer' for only tile services
},
{
"name" : "testlayer2"
"title" : "testlayer2",
"sources" : [wms_myserver:testlayer2],
},
{
"name" : "alllayers"
"title" : "alllayers",
"sources" : [alllayers_cache], # assuming you've defined a cache
'alllayers' for both wms and tile
},
]


Regards
Hi.
I'm setting up a mapproxy wmts service, and several of the layers I'm
using should be available using different styles.
"layers" : [
{
"name" : "testlayer"
"title" : "testlayer",
"sources" : [
"cache_testlayer"
],
}
],
"sources" : {
"wms_myserver" : {
"coverage" : {
"bbox" : [
-110000,
6420000,
1130000,
7980000
],
"srs" : "EPSG:32633"
},
"concurrent_requests" : 16,
"req" : {
"transparent" : true,
"url" : "http://myserver/wms?"
},
"type" : "wms"
},
},
"caches" : {
"cache_testlayer" : {
"cache" : {
"use_grid_names" : true,
"directory_layout" : "tms",
"type" : "file"
},
"cache_dir" : "/vol/cache/",
"sources" : [
"wms_myserver:testlayer",
],
"grids" : [
"utm33_norway"
]
},
},
Is it possible to add another layer, using the same WMS source, and
the same WMS layer, but using a different style, without adding a new
WMS source?
At the moment, I've been adding WMS sources for each new style that's
"sources" : {
"wms_myserver_style_fancy" : {
"coverage" : {
"bbox" : [
-110000,
6420000,
1130000,
7980000
],
"srs" : "EPSG:32633"
},
"concurrent_requests" : 16,
"req" : {
"styles" : "fancy",
"transparent" : true,
"url" : "http://myserver/wms?"
},
"type" : "wms"
},
"wms_myserver_style_dull" : {
"coverage" : {
"bbox" : [
-110000,
6420000,
1130000,
7980000
],
"srs" : "EPSG:32633"
},
"concurrent_requests" : 16,
"req" : {
"styles" : "dull",
"transparent" : true,
"url" : "http://myserver/wms?"
},
"type" : "wms"
},
},
etc.
But this doesn't scale very well, and it does feel a little bit
illogical to do it like this. Is there a better way?
--
Trond Michelsen
_______________________________________________
MapProxy mailing list
https://lists.osgeo.org/mailman/listinfo/mapproxy
Loading...