GetMap is used to request a map image using well-defined geospatial and dimensional parameters containing layers, styles, boundaries, image format, and a spatial reference system (coordinate system of the data being retrieved).
The primary reason to establish a WMS service is to serve maps to others who use them in their own applications. Use the GetMap request to obtain images from a WMS server. GetMap requests are always sent as HTTP strings and the response is a map image with well-defined geospatial and dimensional parameters in the image format specified in the request.
Request Format
https://api.cloud.precisely.com/v1/Spatial/WMS?VERSION={version}&SERVICE=WMS&REQUEST=GetMap&{SRS or CRS}={namespace}:{identifier}&BBOX={min_x},{min_y},{max_x},{max_y}&WIDTH={output_width}&HEIGHT={output_height}&Layers={layer1},...,{layerX}&STYLES={style1},...,{styleX}&FORMAT={output_format}&TRANSPARENT={TRUE or FALSE}&BGCOLOR={color_value}&RESOLUTION={resolution}&EXCEPTIONS={exception_format}Request parameters
The following table lists the possible request inputs. The request parameters are always sent as an HTTP query string.
| Input | Type | Required | Description |
|---|---|---|---|
| VERSION=version | String | Yes | Request version. Private Spatial APIs WMS supports both version 1.1.1 and 1.3.0 of the OGC specification. |
| SERVICE=WMS | String | Yes | Service type. This is always WMS. |
| REQUEST=GetMap | String | Yes | Request name. For a GetMap request, this is always GetMap. |
| LAYERS=layer_list | String | Yes |
The layer or layers to be included in the map image. Each layer should be separated by a comma. For example:
|
| STYLES=style_list | String | Yes |
Comma-separated list of one rendering style per requested layer. A style is required for each layer requested. If no style is requested, the attribute must be present but without a value. If requesting multiple layers, the styles listed should be in the same order as the layers. For example:
In the above example the second style (for the second layer requested) is left blank, allowing the default style defined for the layer to be used. |
| SLD_BODY = style_description | String, representing an encoded JSON | No |
A URL-encoded style conforming to the Precisely JSON style structure. Used to apply custom override and thematic styling to WMS layers. Note:
For the examples which control or enhance map layers and styling, see the section below. |
| SRS=namespace:identifier | String | Required for 1.1.1 | The spatial reference system used in the map (numeric representation of the projection of the map, also known as the coordinate reference system). This parameter is only used for 1.1.1 versions of the OGC specification. Note: For the Precisely Enrich Data resources we support EPSG:3857, EPSG:4326 and CRS:84.
|
| CRS=namespace:identifier | String | Required for 1.3.0 | The coordinate reference system used in the map (numeric representation of the projection of the map, also known as the spatial reference system). This parameter is only used for 1.3.0 versions of the OGC specification. Note: For the Precisely Enrich Data resources we support EPSG:3857, EPSG:4326 and CRS:84.
|
| BBOX=min_x,min_y,max_x,max_y | String | Yes | The area to be mapped. The bounding box is specified as the four coordinates of the corners of the box that bounds the map area to be included in the image. The BBOX coordinates are always expressed in the units of the SRS or CRS. The axis order (which axis is x and which axis is y) is determined by the authority who owns the coordinate system definition. This is most frequently EPSG, whose definitions are available at www.epsg-registry.org. For the GetMap operation, you need to be aware of the axis order for each coordinate system when you construct the BBOX. For example WMS 1.3's CRS:84 and EPSG:4326 both refer to the same WGS84 geographic coordinate system, but they specify different axis orders. EPSG:4326 is typically Latitude-Longitude (Lat-Lon), while CRS:84 uses Longitude-Latitude (Lon-Lat). This distinction is crucial for WMS 1.3, as it requires you to use the correct axis order for bounding box requests, otherwise, you may receive incorrectly rendered maps. |
| WIDTH=output_width | Integer | Yes | Width in pixels of map image. |
| HEIGHT=output_height | Integer | Yes | Height in pixels of map image. |
| FORMAT=output_format | String | Yes | The format in which the map image is to be returned. |
| TRANSPARENT=TRUE|FALSE | Boolean | No | The transparency and color of the background of the image. If nothing is specified, the value is FALSE. |
| BGCOLOR=color_value | String | No | Hexadecimal red-green-blue color value for the background color (default=0xFFFFFF). |
| RESOLUTION=resolution | Integer | No | The DPI of the map image. If less than 72 dpi, an exception is thrown. |
| EXCEPTIONS=exception_format | String | No | The format in which exceptions are to be reported by the WMS (default=XML). |
Examples
Request
WMS version 1.1.1 (SRS parameter for EPSG:4326. Axis order lon-lat for BBOX)
https://api.cloud.precisely.com/v1/Spatial/WMS?VERSION=1.1.1&SERVICE=WMS&REQUEST=GetMap&SRS=EPSG:4326&BBOX=-30,20,50,80&WIDTH=400&HEIGHT=300&Layers=World&STYLES=AreaStyleGreen&FORMAT=image/pngWMS version 1.3.0 (CRS parameter for CRS:84. Axis order lon-lat for BBOX)
https://api.cloud.precisely.com/v1/Spatial/WMS?VERSION=1.3.0&SERVICE=WMS&REQUEST=GetMap&CRS=CRS:84&BBOX=-30,20,50,80&WIDTH=400&HEIGHT=300&Layers=World&STYLES=AreaStyleGreen&FORMAT=image/pngWMS version 1.3.0 (CRS parameter for EPSG:4326. Axis order lat-lon for BBOX)
https://api.cloud.precisely.com/v1/Spatial/WMS?VERSION=1.3.0&SERVICE=WMS&REQUEST=GetMap&CRS=EPSG:4326&BBOX=20,-30,80,50&WIDTH=400&HEIGHT=300&Layers=World&STYLES=AreaStyleGreen&FORMAT=image/pngResponse
After a successful GetMap request, the service returns a GetMap response that is an image of the map specified by the parameters in the request. For more information, see WMS GetMap Response Details.
In all 3 cases above the map image would be the same extending from longitude -100 degrees (west) to 100 degrees (east) in the x-axis and from latitude 0 degrees (bottom) to 90 degrees (top) in the y-axis