# WMS 1.1.1

WMS提供如下操作:

GetCapabitities:返回服务级元数据,它是对服务信息内容和要求参数的一种描述。

GetMap:返回一个地图影像,其地理空间参考和大小参数是明确定义了的。

GetFeatureInfo:返回显示在地图上的某些特殊要素的信息。

参照文档:

06-042_OpenGIS_Web_Map_Service_WMS_Implementation_Specification.pdf(https://portal.ogc.org/files/?artifact_id=14416)

# GetCapabitities

# 请求

请求参数

参数名称 是否必填 描述
VERSION=version 请求版本号,必须是1.1.1。
SERVICE=WMS 服务类型,必须是WMS。
REQUEST=GetCapabilities 请求名称,必须是GetCapabilities。
UPDATESEQUENCE=string 控制缓存的序列号,当返回结果有变更时该序号递增,IGServer暂不支持该参数。

请求示例

{{server}}/igs/rest/services/:serverName/WMSServer?version=1.1.1&service=WMS&request=GetCapabilities
1

# 响应

响应示例
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE WMT_MS_Capabilities SYSTEM 'http://localhost:8089/igs/rest/ogc/schemas/wms/1.1.1/capabilities_1_1_1.dtd'>
<WMT_MS_Capabilities version="1.1.1">
    <Service>
        <Name>OGC:WMS</Name>
        <Title>Zondy Company Map Server</Title>
        <Abstract>WMT Map Server maintained by Zondy Corporation. Contact: mapgis@public.wh.hb.cn</Abstract>
        <KeywordList>
            <Keyword>MapGIS</Keyword>
            <Keyword>DCS</Keyword>
            <Keyword>WMS</Keyword>
        </KeywordList>
        <OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" xlink:href="http://localhost:8089/igs/rest/services/%E4%B8%96%E7%95%8C%E5%9C%B0%E5%9B%BE/WMSServer"/>
        <ContactInformation>
            <ContactPersonPrimary>
                <ContactPerson>吴信才</ContactPerson>
                <ContactOrganization>武汉中地数码科技有限公司</ContactOrganization>
            </ContactPersonPrimary>
            <ContactPosition>集团董事长</ContactPosition>
            <ContactAddress>
                <AddressType>mail</AddressType>
                <Address>湖北省武汉市光谷软件园A10</Address>
                <City>Wuhan</City>
                <StateOrProvince>Hubei</StateOrProvince>
                <PostCode>430074</PostCode>
                <Country>China</Country>
            </ContactAddress>
            <ContactVoiceTelephone>027-87785588</ContactVoiceTelephone>
            <ContactFacsimileTelephone>027-87785588</ContactFacsimileTelephone>
            <ContactElectronicMailAddress>mapgis@public.wh.hb.cn</ContactElectronicMailAddress>
        </ContactInformation>
        <Fees>none</Fees>
        <AccessConstraints>none</AccessConstraints>
    </Service>
    <Capability>
        <Request>
            <GetCapabilities>
                <Format>text/xml</Format>
                <Format>application/vnd.ogc.wms_xml</Format>
                <DCPType>
                    <HTTP>
                        <Get>
                            <OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" xlink:href="http://localhost:8089/igs/rest/services/%E4%B8%96%E7%95%8C%E5%9C%B0%E5%9B%BE/WMSServer?SERVICE=WMS&amp;"/>
                        </Get>
                        <Post>
                            <OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" xlink:href="http://localhost:8089/igs/rest/services/%E4%B8%96%E7%95%8C%E5%9C%B0%E5%9B%BE/WMSServer?SERVICE=WMS&amp;"/>
                        </Post>
                    </HTTP>
                </DCPType>
            </GetCapabilities>
            <GetMap>
                <Format>image/gif</Format>
                <Format>image/jpg</Format>
                <Format>image/png</Format>
                <DCPType>
                    <HTTP>
                        <Get>
                            <OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" xlink:href="http://localhost:8089/igs/rest/services/%E4%B8%96%E7%95%8C%E5%9C%B0%E5%9B%BE/WMSServer?SERVICE=WMS&amp;"/>
                        </Get>
                    </HTTP>
                </DCPType>
            </GetMap>
            <GetFeatureInfo>
                <Format>application/vnd.ogc.gml</Format>
                <Format>text/html</Format>
                <Format>text/plain</Format>
                <Format>application/json</Format>
                <DCPType>
                    <HTTP>
                        <Get>
                            <OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" xlink:href="http://localhost:8089/igs/rest/services/%E4%B8%96%E7%95%8C%E5%9C%B0%E5%9B%BE/WMSServer?SERVICE=WMS&amp;"/>
                        </Get>
                    </HTTP>
                </DCPType>
            </GetFeatureInfo>
        </Request>
        <Exception>
            <Format>application/vnd.ogc.se_blank</Format>
            <Format>application/vnd.ogc.se_xml</Format>
            <Format>application/vnd.ogc.se_inimage</Format>
        </Exception>
        <UserDefinedSymbolization RemoteWFS="1" SupportSLD="0" UserLayer="1" UserStyle="0"/>
        <Layer>
            <Title>世界地图</Title>
            <Abstract>A compliant implementation of WMS</Abstract>
            <SRS>EPSG:4326</SRS>
            <SRS>EPSG:3857</SRS>
            <LatLonBoundingBox minx="-180.0" miny="-90.0" maxx="180.0" maxy="90.0"/>
            <BoundingBox minx="-180.0" miny="-90.0" maxx="180.0" maxy="90.0" SRS="EPSG:4326"/>
            <BoundingBox minx="-2.0037508342789248E7" miny="-2.003750834278924E7" maxx="2.0037508342789248E7" maxy="2.0037508342789248E7" SRS="EPSG:3857"/>
            <Layer queryable="1">
                <Name>世界地图:t0</Name>
                <Title>世界地图:海洋陆地</Title>
                <Abstract></Abstract>
                <SRS>EPSG:4326</SRS>
                <SRS>EPSG:3857</SRS>
                <LatLonBoundingBox minx="-180.0" miny="-90.0" maxx="180.0" maxy="90.0"/>
                <BoundingBox minx="-180.0" miny="-90.0" maxx="180.0" maxy="90.0" SRS="EPSG:4326"/>
                <BoundingBox minx="-2.0037508342789248E7" miny="-2.003750834278924E7" maxx="2.0037508342789248E7" maxy="2.0037508342789248E7" SRS="EPSG:3857"/>
            </Layer>
        </Layer>
    </Capability>
</WMT_MS_Capabilities>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103

# GetMap

# 请求

请求参数

参数名称 是否必填 描述
VERSION=1.1.1 请求版本号,必须是1.1.1。
REQUEST=GetMap 请求名称,必须是GetMap。
LAYERS=layer_list 地图图层列表。
地图图层之间以半角英文逗号进行分隔。最左边的图层在最 底,下一个图层放到前一个的上面,依次类推。
图层名称是服务元数据中的Layer—>Name元素中的内容。
服务元数据中的可选元素指定了能够请求的最大图层个数。
STYLES=style_list 请求图层的样式列表,图层样式之间以英文逗号分隔。
STYLES 值与 LAYERS 参数值是一一对应的。图层名称是服务元数据中定义的元素值。
如果请求不存在的 Style,服务器将返回一个 服务异常(code=StyleNotDefined)。
SLD=sld_xml_uri SLD 文档的 URI
SLD_BODY=sld_xml_body SLD 文档的具体内容
SRS=namespace:identifier 空间坐标参考系统。
BBOX=minx,miny,maxx,maxy 边界框。
如果WMS的版本是1.3.0且参考系采用的是EPSG系统,则客户端传入的坐标点是纬经度的形式,在交给服务器处理时需要变成经纬度的形式。
WIDTH=output_width 地图图片的像素宽度。
HEIGHT=output_height 地图图片的像素高度。
FORMAT=output_format 地图的输出格式。
服务元数据中的 GetMap 中的 Format 之一。
TRANSPARENT=TRUE|FALSE 地图的背景是否透明,默认为FALSE。
BGCOLOR=color_value 背景色的十六进制红绿蓝颜色值(默认为 0xFFFFFF)。
EXCEPTIONS=exception_format WMS 的异常错误报告格式(默认为 XML)。
服务元数据中的 Exception 之一。
TIME=time 获取图层的时间值,IGServer暂不支持该参数。
ELEVATION=elevation 获取的图层的高程,IGServer暂不支持该参数。
Other sample dimension(s) 其他合适的维度值,IGServer暂不支持该参数。

请求示例

{{server}}/igs/rest/services/:serverName/WMSServer?layers=t0&version=1.1.1&srs=EPSG:4326&service=WMS&request=GetMap&format=image/png&bbox=-180,-90,180,90&width=512&height=256
1

# 响应

响应示例

# GetFeatureInfo

# 请求

请求参数

参数名称 是否必填 描述
VERSION=1.1.1 请求版本号,必须是1.1.1。
REQUEST=GetFeatureInfo 请求名称,必须是GetFeatureInfo。
LAYERS=layer_list 地图图层列表。
地图图层之间以半角英文逗号进行分隔。最左边的图层在最 底,下一个图层放到前一个的上面,依次类推。
图层名称是服务元数据中的Layer—>Name元素中的内容。
服务元数据中的可选元素指定了能够请求的最大图层个数。
BBOX=minx,miny,maxx,maxy 边界框。
如果WMS的版本是1.3.0且参考系采用的是EPSG系统,则客户端传入的坐标点是纬经度的形式,在交给服务器处理时需要变成经纬度的形式。
WIDTH=output_width 地图图片的像素宽度。
HEIGHT=output_height 地图图片的像素高度。
QUERY_LAYERS=layer_list 待查询的图层列表,图层之间以英文逗号分隔,IGServer暂不支持该参数。
INFO_FORMAT=output_format 要素信息的返回格式(MIME 类型)。
FEATURE_COUNT=number 返回要素数量(默认为1)。
X=pixel_column 像素表示的要素 X 坐标(最左侧为0,向右递增)。
Y=pixel_row 像素表示的要素 Y 坐标(最上侧为0,向下递增)。
EXCEPTIONS=exception_format WMS 的异常错误报告格式(默认为 application/vnd.ogc.se_xml)。

请求示例

{{server}}/igs/rest/services/:serverName/WMSServer?layers=t0&version=1.1.1&srs=EPSG:4326&service=WMS&request=GetFeatureInfo&format=image/png&bbox=-180,-90,180,90&width=512&height=256&query_layers=t0&info_format=text/html&i=85&j=43&x=0&y=0
1

# 响应

响应示例

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
        <title>ZDOGCServer GetFeatureInfo Output</title>
    </head>
    <style type="text/css">table.featureInfo, table.featureInfo td, table.featureInfo th {border:1px solid #ddd;border-collapse:collapse;margin:0;padding:0;font-size: 90%;padding:.2em .1em;}table.featureInfo th {padding:.2em .2em;font-weight:bold;background:#eee;text-align:center; }table.featureInfo td{ background:#fff;text-align:center;}table.featureInfo tr.odd td{background:#eee;}table.featureInfo
caption{text-align:left;font-size:100%;font-weight:bold;text-transform:uppercase;padding:.2em .2em; }</style>
    <body>
        <div align="left">
            <table class="featureInfo">
                <th colspan="10">图层名称:t0</th>
                <tr>
                    <td>ID</td>
                    <td>mpArea</td>
                    <td>mpPerimeter</td>
                    <td>WRLD30_ID</td>
                    <td>SQKM</td>
                    <td>SQMI</td>
                    <td>COLOR_MAP</td>
                    <td>POP_1994</td>
                    <td>COLOR_INDEX</td>
                    <td>mpLayer</td>
                </tr>
                <tr>
                    <td>1</td>
                    <td>722.176422952306</td>
                    <td>250.04617880497992</td>
                    <td>1</td>
                    <td>0.0</td>
                    <td>0.0</td>
                    <td>999</td>
                    <td>0.0</td>
                    <td>0</td>
                    <td>1</td>
                </tr>
            </table>
        </div>
    </body>
</html>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39