4

I'm building some software that needs to download satellite map images to display behind some survey charts. I understand that, to download these images, I need access to a Web Map Service. The only problem is, I can't find any tutorials explaining how to use one.

Does anyone have any links to some basic tutorials on WMS? In addition, can anyone point me in the direction of some useful WMS services? Price/subscriptions shouldn't be too big of a problem.

Edit: The program is written in C++, if that has any affect on anything. It will need relatively high detail imagery, enough to make out roads and houses. I don't have any experience with XML, which it seems most (all?) WMS use.

3

Here's a simple tutorial:

A Web Map Service (WMS) is a web service that supplies georeferenced images to a client (viewer). The service supplies images based on a request that specifies, the dimensions, the coordinate reference system, the data, the output format and other criteria as required. The client builds a request based on information that is provided by the GetCapabilities response document (which is an XML document). The data that a WMS uses to create the images that it serves, may be a raster data or vector data, stored in files or in geospatial databases.

In addition a WMS can provide a legend for the images that it serves, or provide information for the underlying data at some point that is clicked on in the image (by providing image coordinates as well as the original request to generate the image), and with the help of SLD, a WMS can be responsive to queries of the underlying dataset to return an image that has a custom style applied rather than the default style.

WMS request terms:

GetCapabilities returns the metadata (XML) about the service

GetMap returns the image

GetLegendGraphic returns the legend for a map image

GetFeatureInfo returns the information from a point clicked on the map

Service endpoint the URL to which all request parameters should be added. In a client that understands the WMS interface standard, you would normally give the Service endpoint as the URL for the WMS.

Here are some example requests (using HTTP GET Key/Value Pair syntax):

http://ogc.bgs.ac.uk/cgi-bin/BGS_BGS-HPA_Radon_Potential/wms?service=WMS&request=GetCapabilities&

In the above request, the service endpoint is:

http://ogc.bgs.ac.uk/cgi-bin/BGS_BGS-HPA_Radon_Potential/wms?

and the one request parameter is:

service=WMS&

This parameter is required for all requests to a WMS.

and another request parameter is:

request=GetCapabilities&

Note that in WMS Key/Value Pair syntax we have a key such as 'service' or 'request' and a corresponding value such as WMS and GetCapabilities. In WMS the keys are NOT case sensitive, but the values are case sensitive, so you can have:

 service=WMS& or SerVice=WMS& or SERVICE=WMS&

but you can't (or at least shouldn't have):

service=wms& 

Furthermore the KVP parameters may be supplied in any order in the request.

If we click the above link we can see there is one actual map layer called:

GBR_BGS-HPA_625K_RADON_POTENTIAL

We can see that the service supports the following coordinate reference systems:

<CRS>CRS:84</CRS>
<CRS>EPSG:27700</CRS>
<CRS>EPSG:3031</CRS>
<CRS>EPSG:3034</CRS>
<CRS>EPSG:3413</CRS>
<CRS>EPSG:3857</CRS>
<CRS>EPSG:4258</CRS>
<CRS>EPSG:4326</CRS>
<CRS>EPSG:900913</CRS>

and we can see what the default legend is:

http://ogc.bgs.ac.uk/cgi-bin/BGS_BGS-HPA_Radon_Potential/wms?language=eng&version=1.3.0&service=WMS&request=GetLegendGraphic&sld_version=1.1.0&layer=BGS_BGS-HPA_ONEGEOLOGY_RADON_POTENTIAL&format=image/png&STYLE=default

Here's an example GetMap request for the service:

http://ogc.bgs.ac.uk/cgi-bin/BGS_BGS-HPA_Radon_Potential/wms?language=eng&VERSION=1.3.0&REQUEST=GetMap&CRS=EPSG:4326&BBOX=50.179445759563,-4.41340973640857,50.9615344710795,-3.2834397199341&WIDTH=877&HEIGHT=607&LAYERS=GBR_BGS-HPA_625K_RADON_POTENTIAL&STYLES=&EXCEPTIONS=XML&FORMAT=image/png&BGCOLOR=0xFEFFFF&TRANSPARENT=TRUE&

Here's an example GetFeatureInfo request:

http://ogc.bgs.ac.uk/cgi-bin/BGS_BGS-HPA_Radon_Potential/wms?language=eng&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetFeatureInfo&BBOX=52.804653,-1.577809,52.959911,-1.349062&CRS=EPSG:4326&WIDTH=662&HEIGHT=450&LAYERS=GBR_BGS-HPA_625K_RADON_POTENTIAL&STYLES=&FORMAT=image/png&TRANSPARENT=true&QUERY_LAYERS=GBR_BGS-HPA_625K_RADON_POTENTIAL&INFO_FORMAT=text/html&I=194&J=162&

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.