Permalink
Browse files

Merge pull request #5533 from yjacolin/wms_group_queryable

Enable WMS Layers group with GetMap request
  • Loading branch information...
rouault committed Dec 21, 2017
2 parents c5694f0 + 54c1c9b commit b7272c9fd8bcea5af74580ca086e81fcc53dee29
View
@@ -21,6 +21,8 @@ http://mapserver.org/development/changelog/
- Implement chainable compositing filters (RFC113)
- WMS layer groups are now requestable
7.0.0 release (2015/07/24)
--------------------------
View
@@ -2821,6 +2821,7 @@ void msWMSPrintNestedGroups(mapObj* map, int nVersion, char* pabLayerProcessed,
}
} else {
msIO_printf("%s <Layer>\n", indent);
msIO_printf("%s <Name>%s</Name>\n", indent, nestedGroups[index][level]);
msIO_printf("%s <Title>%s</Title>\n", indent, nestedGroups[index][level]);
groupAdded = 1;
}
@@ -74,6 +74,7 @@ Content-Type: text/xml; charset=UTF-8
<BoundingBox CRS="EPSG:4326"
minx="-1" miny="-1" maxx="-1" maxy="-1" />
<Layer>
<Name>roadgroup</Name>
<Title>roadgroup</Title>
<Layer queryable="1" opaque="0" cascaded="0">
<Name>road2</Name>
@@ -74,6 +74,7 @@ Content-Type: text/xml; charset=UTF-8
<BoundingBox CRS="EPSG:4326"
minx="-1" miny="-1" maxx="-1" maxy="-1" />
<Layer>
<Name>roadgroup</Name>
<Title>roadgroup</Title>
<Layer queryable="1" opaque="0" cascaded="0">
<Name>road2</Name>
@@ -73,6 +73,7 @@ Content-Type: text/xml; charset=UTF-8
<BoundingBox CRS="EPSG:4326"
minx="-1" miny="-1" maxx="-1" maxy="-1" />
<Layer>
<Name>roadgroup</Name>
<Title>roadgroup</Title>
<Layer queryable="1" opaque="0" cascaded="0">
<Name>road2</Name>
@@ -0,0 +1,167 @@
<?xml version='1.0' encoding="UTF-8" standalone="no" ?>
<!DOCTYPE WMT_MS_Capabilities SYSTEM "http://schemas.opengis.net/wms/1.1.1/WMS_MS_Capabilities.dtd"
[
<!ELEMENT VendorSpecificCapabilities EMPTY>
]> <!-- end of DOCTYPE declaration -->
<WMT_MS_Capabilities version="1.1.1">
<Service>
<Name>OGC:WMS</Name>
<!-- WARNING: Mandatory metadata '..._title' was missing in this context. -->
<Title>TESTGROUP</Title>
<OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://foo?"/>
<ContactInformation>
</ContactInformation>
</Service>
<Capability>
<Request>
<GetCapabilities>
<Format>application/vnd.ogc.wms_xml</Format>
<DCPType>
<HTTP>
<Get><OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://foo?"/></Get>
<Post><OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://foo?"/></Post>
</HTTP>
</DCPType>
</GetCapabilities>
<GetMap>
<Format>image/png</Format>
<Format>image/jpeg</Format>
<Format>image/png; mode=8bit</Format>
<Format>image/vnd.jpeg-png</Format>
<Format>image/vnd.jpeg-png8</Format>
<Format>application/x-pdf</Format>
<Format>image/svg+xml</Format>
<Format>image/tiff</Format>
<Format>application/vnd.google-earth.kml+xml</Format>
<Format>application/vnd.google-earth.kmz</Format>
<DCPType>
<HTTP>
<Get><OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://foo?"/></Get>
<Post><OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://foo?"/></Post>
</HTTP>
</DCPType>
</GetMap>
<GetFeatureInfo>
<Format>text/plain</Format>
<Format>application/vnd.ogc.gml</Format>
<DCPType>
<HTTP>
<Get><OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://foo?"/></Get>
<Post><OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://foo?"/></Post>
</HTTP>
</DCPType>
</GetFeatureInfo>
<DescribeLayer>
<Format>text/xml</Format>
<DCPType>
<HTTP>
<Get><OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://foo?"/></Get>
<Post><OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://foo?"/></Post>
</HTTP>
</DCPType>
</DescribeLayer>
<GetLegendGraphic>
<Format>image/png</Format>
<Format>image/jpeg</Format>
<Format>image/png; mode=8bit</Format>
<Format>image/vnd.jpeg-png</Format>
<Format>image/vnd.jpeg-png8</Format>
<DCPType>
<HTTP>
<Get><OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://foo?"/></Get>
<Post><OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://foo?"/></Post>
</HTTP>
</DCPType>
</GetLegendGraphic>
<GetStyles>
<Format>text/xml</Format>
<DCPType>
<HTTP>
<Get><OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://foo?"/></Get>
<Post><OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://foo?"/></Post>
</HTTP>
</DCPType>
</GetStyles>
</Request>
<Exception>
<Format>application/vnd.ogc.se_xml</Format>
<Format>application/vnd.ogc.se_inimage</Format>
<Format>application/vnd.ogc.se_blank</Format>
</Exception>
<VendorSpecificCapabilities />
<UserDefinedSymbolization SupportSLD="1" UserLayer="0" UserStyle="1" RemoteWFS="0"/>
<Layer>
<Name>TESTGROUP</Name>
<!-- WARNING: Mandatory metadata '..._title' was missing in this context. -->
<Title>TESTGROUP</Title>
<Abstract>TESTGROUP</Abstract>
<SRS>EPSG:4326</SRS>
<LatLonBoundingBox minx="0" miny="0" maxx="100" maxy="100" />
<BoundingBox SRS="EPSG:4326"
minx="0" miny="0" maxx="100" maxy="100" />
<Layer>
<Name>g1</Name>
<Title>g1</Title>
<Layer>
<Name>sg1</Name>
<Title>sg1</Title>
<Layer queryable="0" opaque="0" cascaded="0">
<Name>g1sg1l1</Name>
<!-- WARNING: Mandatory metadata '..._title' was missing in this context. -->
<Title>g1sg1l1</Title>
<!-- WARNING: Optional LatLonBoundingBox could not be established for this layer. Consider setting the EXTENT in the LAYER object, or wms_extent metadata. Also check that your data exists in the DATA statement -->
<MetadataURL type="ISOTC211/19115">
<Format>text/xml</Format>
<OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" xlink:href="http://foo?request=GetMetadata&amp;layer=g1sg1l1"/>
</MetadataURL>
</Layer>
<Layer queryable="0" opaque="0" cascaded="0">
<Name>g1sg1l2</Name>
<!-- WARNING: Mandatory metadata '..._title' was missing in this context. -->
<Title>g1sg1l2</Title>
<!-- WARNING: Optional LatLonBoundingBox could not be established for this layer. Consider setting the EXTENT in the LAYER object, or wms_extent metadata. Also check that your data exists in the DATA statement -->
<MetadataURL type="ISOTC211/19115">
<Format>text/xml</Format>
<OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" xlink:href="http://foo?request=GetMetadata&amp;layer=g1sg1l2"/>
</MetadataURL>
</Layer>
</Layer>
<Layer>
<Name>sg2</Name>
<Title>sg2</Title>
<Layer queryable="0" opaque="0" cascaded="0">
<Name>g1sg2l1</Name>
<!-- WARNING: Mandatory metadata '..._title' was missing in this context. -->
<Title>g1sg2l1</Title>
<!-- WARNING: Optional LatLonBoundingBox could not be established for this layer. Consider setting the EXTENT in the LAYER object, or wms_extent metadata. Also check that your data exists in the DATA statement -->
<MetadataURL type="ISOTC211/19115">
<Format>text/xml</Format>
<OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" xlink:href="http://foo?request=GetMetadata&amp;layer=g1sg2l1"/>
</MetadataURL>
</Layer>
</Layer>
</Layer>
<Layer>
<Name>g2</Name>
<Title>g2</Title>
<Layer>
<Name>sg3</Name>
<Title>sg3</Title>
<Layer queryable="0" opaque="0" cascaded="0">
<Name>g2sg3l1</Name>
<!-- WARNING: Mandatory metadata '..._title' was missing in this context. -->
<Title>g2sg3l1</Title>
<!-- WARNING: Optional LatLonBoundingBox could not be established for this layer. Consider setting the EXTENT in the LAYER object, or wms_extent metadata. Also check that your data exists in the DATA statement -->
<MetadataURL type="ISOTC211/19115">
<Format>text/xml</Format>
<OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" xlink:href="http://foo?request=GetMetadata&amp;layer=g2sg3l1"/>
</MetadataURL>
</Layer>
</Layer>
</Layer>
</Layer>
</Capability>
</WMT_MS_Capabilities>
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,107 @@
#
# Test WMS layer groups
#
# REQUIRES: INPUT=GDAL OUTPUT=PNG SUPPORTS=WMS
#
# Capabilities 1.1.1 Default
# RUN_PARMS: wms_layer_groups_caps111.xml [MAPSERV] QUERY_STRING="map=[MAPFILE]&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetCapabilities" > [RESULT_DEVERSION] [RESULT_DEMIME]
# GetMap all
# RUN_PARMS: wms_layer_groups_map_all.png [MAPSERV] QUERY_STRING="map=[MAPFILE]&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&CRS=EPSG:4326&BBOX=0,0,100,100&WIDTH=100&HEIGHT=100&LAYERS=TESTGROUP&STYLES=&FORMAT=image/png" > [RESULT_DEMIME]
# RUN_PARMS: wms_layer_groups_map_g1.png [MAPSERV] QUERY_STRING="map=[MAPFILE]&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&CRS=EPSG:4326&BBOX=0,0,100,100&WIDTH=100&HEIGHT=100&LAYERS=g1&STYLES=&FORMAT=image/png" > [RESULT_DEMIME]
# RUN_PARMS: wms_layer_groups_map_sg1.png [MAPSERV] QUERY_STRING="map=[MAPFILE]&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&CRS=EPSG:4326&BBOX=0,0,100,100&WIDTH=100&HEIGHT=100&LAYERS=sg1&STYLES=&FORMAT=image/png" > [RESULT_DEMIME]
# RUN_PARMS: wms_layer_groups_map_sg2.png [MAPSERV] QUERY_STRING="map=[MAPFILE]&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&CRS=EPSG:4326&BBOX=0,0,100,100&WIDTH=100&HEIGHT=100&LAYERS=sg2&STYLES=&FORMAT=image/png" > [RESULT_DEMIME]
# RUN_PARMS: wms_layer_groups_map_g2sg3l1.png [MAPSERV] QUERY_STRING="map=[MAPFILE]&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&CRS=EPSG:4326&BBOX=0,0,100,100&WIDTH=100&HEIGHT=100&LAYERS=g2sg3l1&STYLES=&FORMAT=image/png" > [RESULT_DEMIME]
MAP
NAME "TESTGROUP"
STATUS ON
MAXSIZE 2048
SIZE 100 100
EXTENT 0 0 100 100
UNITS dd
WEB
METADATA
"ows_onlineresource" "http://foo"
"wms_enable_request" "*"
END
END
PROJECTION
"+init=epsg:4326"
END
IMAGECOLOR 255 255 255
LAYER
TYPE POINT
NAME "g1sg1l1"
STATUS ON
METADATA
"wms_layer_group" "/g1/sg1"
END
CLASS
LABEL
TEXT "g1/sg1/l1"
COLOR 0 0 0
SIZE 8
POSITION cc
END
END
FEATURE POINTS 50 10 END END
END
LAYER
TYPE POINT
NAME "g1sg1l2"
STATUS ON
METADATA
"wms_layer_group" "/g1/sg1"
END
CLASS
LABEL
TEXT "g1/sg1/l2"
COLOR 0 0 0
SIZE 8
POSITION cc
END
END
FEATURE POINTS 50 30 END END
END
LAYER
TYPE POINT
NAME "g1sg2l1"
STATUS ON
METADATA
"wms_layer_group" "/g1/sg2"
END
CLASS
LABEL
TEXT "g1/sg2/l1"
COLOR 0 0 0
SIZE 8
POSITION cc
END
END
FEATURE POINTS 50 50 END END
END
LAYER
TYPE POINT
NAME "g2sg3l1"
STATUS ON
METADATA
"wms_layer_group" "/g2/sg3"
END
CLASS
LABEL
TEXT "g2/sg3/l1"
COLOR 0 0 0
SIZE 8
POSITION cc
END
END
FEATURE POINTS 50 70 END END
END
END

0 comments on commit b7272c9

Please sign in to comment.