WMS是Web Map Service(网络地图服务)的缩写,是开放地理空间联盟 (OGC) 定义提供和使用动态地图时需遵守的国际规范。到目前为止,已发布了四个版本的 WMS 规范:1.0.0、1.1.0、1.1.1 和1.3.0(最新)。
它是利用具有地理空间位置信息的数据制作地图,其中将地图定义为地理数据的可视化表现,能够根据用户的请求,返回相应的地图,包括PNG、GIF、JPEG等栅格形式,或者SVG或者WEB CGM等矢量形式。WMS支持HTTP协议,所支持的操作是由URL决定的。WMS提供如下操作:
参数名称 | 必选参数 | 默认值 | 备注 |
---|---|---|---|
SERVICE | Y | WMS | 参数值不可改 |
REQUEST | Y | getCapabilities | 参数值不可改 |
VERSION | N | 1.3.0 | 无 |
<WMS_Capabilities>
<Service>
<!-- -->
</Service>
<Capability>
<!-- -->
</Capability>
</WMS_Capabilities>
service
节点内容如下:
<Service>
<Name>WMS</Name>
<Title>GeoServer Web Map Service</Title>
<Abstract>A compliant implementation of WMS plus most of the SLD extension (dynamic styling). Can also generate PDF, SVG, KML, GeoRSS</Abstract>
<KeywordList>
<Keyword>WFS</Keyword>
<Keyword>WMS</Keyword>
<Keyword>GEOSERVER</Keyword>
</KeywordList>
<OnlineResource xlink:type="simple" xlink:href="http://geoserver.org"/>
<ContactInformation>
<ContactPersonPrimary>
<ContactPerson>Claudius Ptolomaeus</ContactPerson>
<ContactOrganization>The Ancient Geographers</ContactOrganization>
</ContactPersonPrimary>
<ContactPosition>Chief Geographer</ContactPosition>
<ContactAddress>
<AddressType>Work</AddressType>
<Address/>
<City>Alexandria</City>
<StateOrProvince/>
<PostCode/>
<Country>Egypt</Country>
</ContactAddress>
<ContactVoiceTelephone/>
<ContactFacsimileTelephone/>
<ContactElectronicMailAddress>claudius.ptolomaeus@gmail.com</ContactElectronicMailAddress>
</ContactInformation>
<Fees>NONE</Fees>
<AccessConstraints>NONE</AccessConstraints>
</Service>
Capability
节点内容如下:
<Capability>
<Request>
<GetCapabilities>
<Format>text/xml</Format>
<DCPType>
<HTTP>
<Get>
<OnlineResource xlink:type="simple" xlink:href="http://localhost:8086/geoserver/easygis/ows?SERVICE=WMS&"/>
</Get>
<Post>
<OnlineResource xlink:type="simple" xlink:href="http://localhost:8086/geoserver/easygis/ows?SERVICE=WMS&"/>
</Post>
</HTTP>
</DCPType>
</GetCapabilities>
<GetMap>
<Format>image/png</Format>
<Format>application/atom+xml</Format>
<Format>application/json;type=geojson</Format>
<Format>application/json;type=topojson</Format>
<Format>application/json;type=utfgrid</Format>
<Format>application/pdf</Format>
<Format>application/rss+xml</Format>
<Format>application/vnd.google-earth.kml+xml</Format>
<Format>application/vnd.google-earth.kml+xml;mode=networklink</Format>
<Format>application/vnd.google-earth.kmz</Format>
<Format>application/x-protobuf;type=mapbox-vector</Format>
<Format>image/geotiff</Format>
<Format>image/geotiff8</Format>
<Format>image/gif</Format>
<Format>image/jpeg</Format>
<Format>image/png; mode=8bit</Format>
<Format>image/svg+xml</Format>
<Format>image/tiff</Format>
<Format>image/tiff8</Format>
<Format>image/vnd.jpeg-png</Format>
<Format>text/html; subtype=openlayers</Format>
<DCPType>
<HTTP>
<Get>
<OnlineResource xlink:type="simple" xlink:href="http://localhost:8086/geoserver/easygis/ows?SERVICE=WMS&"/>
</Get>
</HTTP>
</DCPType>
</GetMap>
<GetFeatureInfo>
<Format>text/plain</Format>
<Format>application/vnd.ogc.gml</Format>
<Format>text/xml</Format>
<Format>application/vnd.ogc.gml/3.1.1</Format>
<Format>text/xml; subtype=gml/3.1.1</Format>
<Format>text/html</Format>
<Format>application/json</Format>
<DCPType>
<HTTP>
<Get>
<OnlineResource xlink:type="simple" xlink:href="http://localhost:8086/geoserver/easygis/ows?SERVICE=WMS&"/>
</Get>
</HTTP>
</DCPType>
</GetFeatureInfo>
</Request>
<Exception>
<Format>XML</Format>
<Format>INIMAGE</Format>
<Format>BLANK</Format>
<Format>JSON</Format>
</Exception>
<Layer>
<Title>GeoServer Web Map Service</Title>
<Abstract>A compliant implementation of WMS plus most of the SLD extension (dynamic styling). Can also generate PDF, SVG, KML, GeoRSS</Abstract>
<!--All supported EPSG projections:-->
<CRS>AUTO:4326</CRS>
<CRS>AUTO:3857</CRS>
<EX_GeographicBoundingBox>
<westBoundLongitude>-180.0</westBoundLongitude>
<eastBoundLongitude>180.00000033527613</eastBoundLongitude>
<southBoundLatitude>-90.00000000000003</southBoundLatitude>
<northBoundLatitude>83.6236001622701</northBoundLatitude>
</EX_GeographicBoundingBox>
<BoundingBox CRS="CRS:84" minx="-180.0" miny="-90.00000000000003" maxx="180.00000033527613" maxy="83.6236001622701"/>
<Layer queryable="1" opaque="0">
<Name>layer_china_boundry</Name>
<Title>layer_china_boundry</Title>
<Abstract/>
<KeywordList>
<Keyword>features</Keyword>
<Keyword>layer_china_boundry</Keyword>
</KeywordList>
<CRS>EPSG:4326</CRS>
<CRS>CRS:84</CRS>
<EX_GeographicBoundingBox>
<westBoundLongitude>73.44696044921875</westBoundLongitude>
<eastBoundLongitude>135.08583068847656</eastBoundLongitude>
<southBoundLatitude>3.408477306365967</southBoundLatitude>
<northBoundLatitude>53.557926177978516</northBoundLatitude>
</EX_GeographicBoundingBox>
<BoundingBox CRS="CRS:84" minx="73.44696044921875" miny="3.408477306365967" maxx="135.08583068847656" maxy="53.557926177978516"/>
<BoundingBox CRS="EPSG:4326" minx="3.408477306365967" miny="73.44696044921875" maxx="53.557926177978516" maxy="135.08583068847656"/>
<Style>
<Name>line</Name>
<Title>Default Line</Title>
<Abstract>A sample style that draws a line</Abstract>
<LegendURL width="20" height="20">
<Format>image/png</Format>
<OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" xlink:href="http://localhost:8086/geoserver/easygis/ows?service=WMS&request=GetLegendGraphic&format=image%2Fpng&width=20&height=20&layer=layer_china_boundry"/>
</LegendURL>
</Style>
</Layer>
</Layer>
</Capability>
http://localhost:8086/geoserver/easygis/wms?service=WMS&request=getCapabilities
参数名称 | 必选参数 | 默认值 | 备注 |
---|---|---|---|
SERVICE | Y | WMS | 参数值不可改 |
REQUEST | Y | GetMap | 参数值不可改 |
VERSION | N | 1.3.0 | 无 |
FORMAT | N | image/png | 无 |
TRANSPARENT | N | true | 无 |
LAYERS | Y | 无 | 无 |
SRS | Y | EPSG:4326 | 无 |
WIDTH | Y | 无 | 无 |
HEIGHT | Y | 无 | 无 |
BBOX | Y | 无 | xmin,ymin,xmax,ymax |
STYLES | N | 无 | 无 |
CQL_FILTER | N | 无 | 无 |
http://localhost:8086/geoserver/easygis/wms?SERVICE=WMS&REQUEST=GetMap&FORMAT=image/png&TRANSPARENT=true&LAYERS=easygis:layer_china_province&SRS=EPSG:4326&WIDTH=768&HEIGHT=589&BBOX=70.48828125,8.1298828125,137.98828125,59.89746&VERSION=1.1.1
参数名称 | 必选参数 | 默认值 | 备注 |
---|---|---|---|
SERVICE | Y | WMS | 参数值不可改 |
REQUEST | Y | GetFeatureInfo | 参数值不可改 |
VERSION | N | 1.3.0 | 无 |
SRS | Y | EPSG:4326 | 无 |
WIDTH | Y | 无 | 无 |
HEIGHT | Y | 无 | 无 |
BBOX | Y | 无 | xmin,ymin,xmax,ymax |
CQL_FILTER | N | 无 | 无 |
INFO_FORMAT | Y | text/html | 无 |
FEATURE_COUNT | Y | 50 | 无 |
X | Y | 50 | 无 |
Y | Y | 50 | 无 |
http://localhost:8086/geoserver/easygis/wms?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetFeatureInfo&FORMAT=image/png&TRANSPARENT=true&QUERY_LAYERS=easygis:layer_china_province&STYLES&LAYERS=easygis:layer_china_province&INFO_FORMAT=text/html&FEATURE_COUNT=50&X=50&Y=50&SRS=EPSG:4326&WIDTH=101&HEIGHT=101&BBOX=88.6376953125,25.224609375000007,97.5146484375,34.10156250000001
参数名称 | 必选参数 | 默认值 | 备注 |
---|---|---|---|
REQUEST | Y | GetStyles | 参数值不可改 |
VERSION | N | 1.3.0 | 无 |
LAYER | Y | 无 | 无 |
http://localhost:8086/geoserver/jtmet/wms?request=GetStyles&layers=layer_china_province&VERSION=1.3.0
参数名称 | 必选参数 | 默认值 | 备注 |
---|---|---|---|
REQUEST | Y | GetLegendGraphic | 参数值不可改 |
VERSION | N | 1.3.0 | 无 |
LAYER | Y | 无 | 无 |
FORMAT | N | image/png | 无 |
`http://localhost:8086/geoserver/easygis/wms?request=GetLegendGraphic&VERSION=1.3.0&layer=easygis:base_capital&FORMAT=image/png