OGC WMS
From MapbenderWiki
Lesen Sie hier die deutsche Version
Contents |
Description
The OGC (Open Geospatial Consortium) has created the Web Map Service (WMS) specification. Read all the details of the OGC Specifications. The OGC WMS specifies several request types, some of them are optional and not always implemented:
- getCapabilities
- getMap
- getFeatureInfo (optional)
- getLegendURL (optional)
The server returns a map image or XML document to the requests. They can be put together manually (as described below) but that is a rather tedious and error prone task. WMS clients help to access OGC WMS services by providing user interfaces for zooming in and out, activating layers, etc.
Mapbender extends basic WMS client functionality with a full fledged web based user administration and access control modules. The Mapbender Security Proxy allows to restrict access to OGC WMS servers using standard IT security technology.
GetCapabilities Roulette
Google for an OGC WMS Capabilities document.
GetCapabilities
The GetCapabilities request returns an OGC WMS Capabilities Document (XML) which contains all information that an OGC WMS Client needs to request the server for a map. This is an example of a static WMS Capabilities Document of Germany Free Data. The XML document contains all information which is necessary to put together the getMap request. The URL specified in the 'Online Resource' tag points to the server that hosts the service and answers to getMap requests. Alternate request format: http://wms.wheregroup.com/1.1.1/germany/capabilities.
GetMap
The GetMap request will return a map image with the specified layers, bounding box, format and coordinate system. Click on WMS Germany getMap to see the result of the GetMap request. Below you see the request details:
http://wms1.ccgis.de/germany? SERVICE=WMS& REQUEST=GetMap& VERSION=1.1.1& LAYERS=topography,cities,post_codes,railroad_line,rivers,roads,city_points,post_code_labels,city_labels& STYLES=,,,,,,,,& SRS=EPSG:31467& BBOX=3105881.5384615385,5248260,4088808.4615384615,6100130& WIDTH=150& HEIGHT=130& FORMAT=image/png& BGCOLOR=0xffffff& TRANSPARENT=TRUE& EXCEPTIONS=application/vnd.ogc.se_xml
GetFeatureInfo (optional)
This optional request returns information about features. The request is usually started from a map browser by clicking into the map. The click position is sent to the server together with the real world coordinates of the lower left and upper right corners of the current extent. The size of the image in pixels is also passed along as parameter. That way the server can calculate the real world coordinates of the mouse position and request a datasource for features (geometries) in that region. The click position is usually buffered with a few pixels to enlarge the chance of hitting a point or line object. The GetFeatureInfo request looks like this:
http://wms1.ccgis.de/cgi-bin/germany? SERVICE=WMS& REQUEST=GetFeatureInfo& VERSION=1.1.1& SRS=EPSG:31467& BBOX=3360900,5618658.75,3367600,5628541.25& WIDTH=400& HEIGHT=590& LAYERS=post_codes& STYLES=& FORMAT=image/png& INFO_FORMAT=text/html& FEATURE_COUNT=30& QUERY_LAYERS=post_codes& X=313& Y=237
The follwing example of a GetFeatureInfo request requests for a HTML page. The GetCapabilities document specifies which additional formats are supported.
GetLegendGraphics (optional)
Legend images can also be requested using WMS syntax. The legend for every layer has to be requested individually. Check out this getLegendGraphics Example it returns an image showing the legend for postal areas of the GNU FDL Germany project.
http://wms1.ccgis.de/germany? format=image/png& REQUEST=getlegendgraphic& VERSION=1.1.1&SERVICE=WMS& layer=post_codes
Important Notice
The OGC specification WMS 1.1.1 is ambiguous regarding the axis order in a coordinate tuple. The referenced EPSG code 4326 which is the basis to all services is specified with the mathematical y-axis first and x-axis second. More than 99% of all currently active servers do it the other (wrong) way. So watch out in which order you request, send or receive coordinates. Read more about the Axis Order Confusion in the OSGeo Foundation Wiki.

