Skip to content

WMS 1.3.0

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.3.0。
SERVICE=WMS服务类型,必须是WMS。
REQUEST=GetCapabilities请求名称,必须是GetCapabilities。
FORMAT=MIME_type服务元数据信息的输出格式,默认是text/xml,其它格式可选,必须是完整的MIME类型,IGServer暂不支持该参数。
UPDATESEQUENCE=string控制缓存的序列号,当返回结果有变更时该序号递增,IGServer暂不支持该参数。

请求示例

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

响应

响应示例
xml
<?xml version='1.0' encoding='utf-8'?>
<WMS_Capabilities xmlns="http://www.opengis.net/wms" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wms http://localhost:8089/igs/rest/ogc/schemas/wms/1.3.0/capabilities_1_3_0.xsd" version="1.3.0">
    <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/beijing_w17_test/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>
        <MaxWidth>2048</MaxWidth>
        <MaxHeight>2048</MaxHeight>
    </Service>
    <Capability>
        <Request>
            <GetCapabilities>
                <Format>text/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/beijing_w17_test/WMSServer?SERVICE=WMS&"/>
                        </Get>
                        <Post>
                            <OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" xlink:href="http://localhost:8089/igs/rest/services/beijing_w17_test/WMSServer?SERVICE=WMS&"/>
                        </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/beijing_w17_test/WMSServer?SERVICE=WMS&"/>
                        </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/beijing_w17_test/WMSServer?SERVICE=WMS&"/>
                        </Get>
                    </HTTP>
                </DCPType>
            </GetFeatureInfo>
        </Request>
        <Exception>
            <Format>BLANK</Format>
            <Format>XML</Format>
            <Format>INIMAGE</Format>
        </Exception>
        <Layer>
            <Title>beijing_w17_test</Title>
            <Abstract>A compliant implementation of WMS</Abstract>
            <CRS>EPSG:4326</CRS>
            <CRS>EPSG:3857</CRS>
            <EX_GeographicBoundingBox>
                <westBoundLongitude>115.40448659815915</westBoundLongitude>
                <eastBoundLongitude>117.46520008794508</eastBoundLongitude>
                <southBoundLatitude>39.41781726044531</southBoundLatitude>
                <northBoundLatitude>41.05780257931024</northBoundLatitude>
            </EX_GeographicBoundingBox>
            <BoundingBox minx="39.41781726044531" miny="115.40448659815915" maxx="41.05780257931024" maxy="117.46520008794508" CRS="EPSG:4326"/>
            <BoundingBox minx="1.2846768683366247E7" miny="4781698.251970508" maxx="1.3076166259720044E7" maxy="5020871.273225116" CRS="EPSG:3857"/>
            <Layer queryable="1">
                <Name>beijing_w17_test:t0</Name>
                <Title>beijing_w17_test:北京市</Title>
                <Abstract></Abstract>
                <CRS>EPSG:4326</CRS>
                <CRS>EPSG:3857</CRS>
                <EX_GeographicBoundingBox>
                    <westBoundLongitude>115.40448659815915</westBoundLongitude>
                    <eastBoundLongitude>117.46520008794508</eastBoundLongitude>
                    <southBoundLatitude>39.41781726044531</southBoundLatitude>
                    <northBoundLatitude>41.05780257931024</northBoundLatitude>
                </EX_GeographicBoundingBox>
                <BoundingBox minx="39.41781726044531" miny="115.40448659815915" maxx="41.05780257931024" maxy="117.46520008794508" CRS="EPSG:4326"/>
                <BoundingBox minx="1.2846768683366247E7" miny="4781698.251970508" maxx="1.3076166259720044E7" maxy="5020871.273225116" CRS="EPSG:3857"/>
            </Layer>
            <Layer queryable="1">
                <Name>beijing_w17_test:t1</Name>
                <Title>beijing_w17_test:绿地_1</Title>
                <Abstract></Abstract>
                <CRS>EPSG:4326</CRS>
                <CRS>EPSG:3857</CRS>
                <EX_GeographicBoundingBox>
                    <westBoundLongitude>115.6942631</westBoundLongitude>
                    <eastBoundLongitude>116.8830574</eastBoundLongitude>
                    <southBoundLatitude>39.6979361</southBoundLatitude>
                    <northBoundLatitude>40.5512486</northBoundLatitude>
                </EX_GeographicBoundingBox>
                <BoundingBox minx="39.6979361" miny="115.6942631" maxx="40.5512486" maxy="116.8830574" CRS="EPSG:4326"/>
                <BoundingBox minx="1.2879026455995021E7" miny="4822143.779443616" maxx="1.301136243212897E7" maxy="4946374.57330774" CRS="EPSG:3857"/>
            </Layer>
            <Layer queryable="1">
                <Name>beijing_w17_test:t2</Name>
                <Title>beijing_w17_test:绿地_2</Title>
                <Abstract></Abstract>
                <CRS>EPSG:4326</CRS>
                <CRS>EPSG:3857</CRS>
                <EX_GeographicBoundingBox>
                    <westBoundLongitude>115.6942631</westBoundLongitude>
                    <eastBoundLongitude>117.0179376</eastBoundLongitude>
                    <southBoundLatitude>39.6979361</southBoundLatitude>
                    <northBoundLatitude>40.5512486</northBoundLatitude>
                </EX_GeographicBoundingBox>
                <BoundingBox minx="39.6979361" miny="115.6942631" maxx="40.5512486" maxy="117.0179376" CRS="EPSG:4326"/>
                <BoundingBox minx="1.2879026455995021E7" miny="4822143.779443616" maxx="1.3026377227311065E7" maxy="4946374.57330774" CRS="EPSG:3857"/>
            </Layer>
            <Layer queryable="1">
                <Name>beijing_w17_test:t3</Name>
                <Title>beijing_w17_test:绿地_3</Title>
                <Abstract></Abstract>
                <CRS>EPSG:4326</CRS>
                <CRS>EPSG:3857</CRS>
                <EX_GeographicBoundingBox>
                    <westBoundLongitude>115.8147476</westBoundLongitude>
                    <eastBoundLongitude>117.4187314</eastBoundLongitude>
                    <southBoundLatitude>39.4529452</southBoundLatitude>
                    <northBoundLatitude>40.8621987</northBoundLatitude>
                </EX_GeographicBoundingBox>
                <BoundingBox minx="39.4529452" miny="115.8147476" maxx="40.8621987" maxy="117.4187314" CRS="EPSG:4326"/>
                <BoundingBox minx="1.2892438729183504E7" miny="4786761.329183959" maxx="1.3070993389040168E7" maxy="4992037.2019703295" CRS="EPSG:3857"/>
            </Layer>
        </Layer>
    </Capability>
</WMS_Capabilities>

GetMap

请求

请求参数

参数名称是否必填描述
VERSION=1.3.0请求版本号,必须是1.3.0。
REQUEST=GetMap请求名称,必须是GetMap。
LAYERS=layer_list地图图层列表。
地图图层之间以半角英文逗号进行分隔。最左边的图层在最 底,下一个图层放到前一个的上面,依次类推。
图层名称是服务元数据中的Layer—>Name元素中的内容。
服务元数据中的可选元素指定了能够请求的最大图层个数。
STYLES=style_list请求图层的样式列表,图层样式之间以英文逗号分隔。
STYLES 值与 LAYERS 参数值是一一对应的。图层名称是服务元数据中定义的元素值。
如果请求不存在的 Style,服务器将返回一个 服务异常(code=StyleNotDefined)。
CRS=namespace:identifier坐标参考系。
该参数值应该是 GetCapabilities 操作中服务器声明的 CRS。
如果请求包含了一个服务器不支持的 CRS,服务器将抛出一个服务异常(code = "InvalidCRS")。
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_formatWMS 的异常错误报告格式(默认为 XML)。
服务元数据中的 Exception 之一。
TIME=time获取图层的时间值,IGServer暂不支持该参数。
ELEVATION=elevation获取的图层的高程,IGServer暂不支持该参数。
Other sample dimension(s)其他合适的维度值,IGServer暂不支持该参数。

请求示例

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

响应

响应示例

GetFeatureInfo

请求

请求参数

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

请求示例

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

响应

响应示例
html
<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>264</td>
                    <td>1264.454883790575</td>
                    <td>591.919791231547</td>
                    <td>0</td>
                    <td>9901803.0</td>
                    <td>3823086.25</td>
                    <td>1</td>
                    <td>2.840232E+7</td>
                    <td>0</td>
                    <td>1</td>
                </tr>
            </table>
        </div>
    </body>
</html>