1.3.2. GetMap
"The GetMap operation returns a map. Upon receiving a GeetMap request, a WMS shall either satisfy the request or issue a service exception." (OGC 2004)
The following line shows a GetMap request (the URL is all one line, broken up here for readability):
http://www2.dmsolutions.ca/cgi-bin/mswms_gmap?SERVICE=WMS&VERSION=1.1.1
&REQUEST=getmap
&layers=prov_bound,popplace&STYLES=&SRS=EPSG:4326
&BBOX=-173.537,35.8775,-11.9603,83.8009
&WIDTH=1024&HEIGHT=768
&FORMAT=image/png
Copy the request parameters into the address bar of your browser and send the request yourself or click the following link to execute the request above valid request
The parameters "http://www2.dmsolutions.ca/cgi-bin/mswms_gmap? indicate the location of the map server. The parameters for the GetMap request follow after the server location definition.
A GetMap request consists of the following mandatory request parameters
Request Parameter | Description |
---|---|
VERSION=version | Request version |
REQUEST=GetMap | Request name |
LAYERS=layer_list | Comma-separated list of one or more map layers. |
STYLES=style_list | Comma-separated list of one rendering style per requested layer. |
CRS=namespace:identifier | Coordinate reference system. |
BBOX=minx,miny,maxx,maxy | Bounding box corners (lower left, upper right) in CRS units. |
WIDTH=output_width | Width in pixels of map picture. |
HEIGHT=output_height | Height in pixels of map picture. |
FORMAT=output_format | Output format of map. |
There are six more GetMap parameters that can be declared in the URL, but those parameters are optional. Please have a look at the following pdf file (page 26) if you are interested in those parameters: OGC Web Map Service Interface
The result of a GetMap request is a raster image.
Result of a GetMap request (UMN MapServer)GetMap Exercise
Check out the GetMap request by
typing the request string in the address bar of your browser. Watch out that
there are no spaces within your URL string. You will get a raster image that
you
can save on your computer.
To get a new image, you have to change the
parameter values of the GetMap request. The parameters version, request, and coordinate system are fix for each
request. All other parameters are changeable. But since at the moment, you do
not know neither the minimum and maximum coordinates nor the names of the
available layers or the available image formats, you can only change the width
and height of the requested map (you will be able to change all values after
the
GetCapabilities chapter). Try it out!
You have no idea how to do it? (Click here for more information)
Take into account that the changing of the width and height parameters only change the width and height of the output image. If their proportion (width / height of output image) is different from the proportion of the original bounding box (width / height of bounding box measured in real coordinates) the content of the output image is distorted. Try it out by taking arbitrary numbers for width and height!