<div dir="ltr"><div dir="ltr">Trond</div><div dir="ltr"><br></div><div dir="ltr">From my experience to provide a layer in a tile based service you must have a cache defined, so you are correct.<br><div><br></div><div>If you are interested tagged source names in the layers to do this to some extent for WMS service</div><div><br></div><div><a href="https://mapproxy.org/docs/nightly/sources.html#tagged-source-names">https://mapproxy.org/docs/nightly/sources.html#tagged-source-names</a><br></div><div><br></div><div> "layers" : [<br> {<br> "name" : "testlayer"<br> "title" : "testlayer",<br> "sources" : [wms_myserver:testlayer<br> ],<br> },</div><div> {<br> "name" : "testlayer2"<br> "title" : "testlayer2",<br> "sources" : [wms_myserver:testlayer2<br> ],<br> } <br> ]</div><div><br></div><div>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.</div><div><br></div><div>You could then use the tile_source to define layers which would be available in the tile services</div><div><br></div><div><div> "layers" : [<br> {<br> "name" : "testlayer"<br> "title" : "testlayer",<br> "sources" : [wms_myserver:testlayer],</div><div> "tile_sources": [cache_testlayer],
# assuming you've defined a cache 'cache_testlayer' for only tile services <br> },</div><div> {<br> "name" : "testlayer2"<br> "title" : "testlayer2",<br> "sources" : [wms_myserver:testlayer2],<br> },</div><div> {</div> "name" : "alllayers"<br> "title" : "alllayers",<br> "sources" : [alllayers_cache], # assuming you've defined a cache 'alllayers' for both wms and tile <br><div> }, </div><div> ]<br></div></div><div><br></div><div><br></div><div>Regards</div><div><br></div><div><br></div></div></div><br><div class="gmail_quote"><div dir="ltr">On Mon, 10 Sep 2018 at 10:41, Trond Michelsen <<a href="mailto:trondmm-mapproxy@crusaders.no">trondmm-mapproxy@crusaders.no</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi.<br>
<br>
I'm setting up a mapproxy wmts service, and several of the layers I'm<br>
using should be available using different styles. <br>
<br>
Let's say I have a config like this:<br>
<br>
"layers" : [<br>
{<br>
"name" : "testlayer"<br>
"title" : "testlayer",<br>
"sources" : [<br>
"cache_testlayer"<br>
],<br>
}<br>
],<br>
<br>
"sources" : {<br>
"wms_myserver" : {<br>
"coverage" : {<br>
"bbox" : [<br>
-110000,<br>
6420000,<br>
1130000,<br>
7980000<br>
],<br>
"srs" : "EPSG:32633"<br>
},<br>
"concurrent_requests" : 16,<br>
"req" : {<br>
"transparent" : true,<br>
"url" : "<a href="http://myserver/wms" rel="noreferrer" target="_blank">http://myserver/wms</a>?"<br>
},<br>
"type" : "wms"<br>
},<br>
},<br>
<br>
"caches" : {<br>
"cache_testlayer" : {<br>
"cache" : {<br>
"use_grid_names" : true,<br>
"directory_layout" : "tms",<br>
"type" : "file"<br>
},<br>
"cache_dir" : "/vol/cache/",<br>
"sources" : [<br>
"wms_myserver:testlayer",<br>
],<br>
"grids" : [<br>
"utm33_norway"<br>
]<br>
},<br>
},<br>
<br>
Is it possible to add another layer, using the same WMS source, and<br>
the same WMS layer, but using a different style, without adding a new<br>
WMS source?<br>
<br>
At the moment, I've been adding WMS sources for each new style that's required, e.g.:<br>
<br>
"sources" : {<br>
"wms_myserver_style_fancy" : {<br>
"coverage" : {<br>
"bbox" : [<br>
-110000,<br>
6420000,<br>
1130000,<br>
7980000<br>
],<br>
"srs" : "EPSG:32633"<br>
},<br>
"concurrent_requests" : 16,<br>
"req" : {<br>
"styles" : "fancy",<br>
"transparent" : true,<br>
"url" : "<a href="http://myserver/wms" rel="noreferrer" target="_blank">http://myserver/wms</a>?"<br>
},<br>
"type" : "wms"<br>
},<br>
<br>
"wms_myserver_style_dull" : {<br>
"coverage" : {<br>
"bbox" : [<br>
-110000,<br>
6420000,<br>
1130000,<br>
7980000<br>
],<br>
"srs" : "EPSG:32633"<br>
},<br>
"concurrent_requests" : 16,<br>
"req" : {<br>
"styles" : "dull",<br>
"transparent" : true,<br>
"url" : "<a href="http://myserver/wms" rel="noreferrer" target="_blank">http://myserver/wms</a>?"<br>
},<br>
"type" : "wms"<br>
},<br>
},<br>
<br>
etc.<br>
<br>
But this doesn't scale very well, and it does feel a little bit<br>
illogical to do it like this. Is there a better way?<br>
<br>
-- <br>
Trond Michelsen<br>
_______________________________________________<br>
MapProxy mailing list<br>
<a href="mailto:MapProxy@lists.osgeo.org" target="_blank">MapProxy@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/mapproxy" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/mapproxy</a></blockquote></div>