[MapProxy] WMTS layers using different styles from WMS backend
Travis Kirstine
traviskirstine at gmail.com
Wed Sep 12 06:26:40 PDT 2018
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
On Mon, 10 Sep 2018 at 10:41, Trond Michelsen <trondmm-mapproxy at crusaders.no>
wrote:
> Hi.
>
> I'm setting up a mapproxy wmts service, and several of the layers I'm
> using should be available using different styles.
>
> Let's say I have a config like this:
>
> "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
> required, e.g.:
>
> "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
> MapProxy at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/mapproxy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapproxy/attachments/20180912/86a74558/attachment.html>
More information about the MapProxy
mailing list