Skip to main content

WMS — Web Map Service

The WMS (Web Map Service) allows you to render styled map tiles from GeoServer layers. This guide covers all five WMS operations and their parameters.

All requests go to: https://graph.quarticle.ro/graph/layers/wms/

Authentication: Add the Authorization: YOUR_API_KEY header to all requests.


GetCapabilities

Discover available layers, styles, projections, and output formats published in GeoServer.

Purpose: Metadata discovery — understand what layers are available and what operations they support.

Required Parameters

ParameterValueExample
serviceWMSservice=WMS
version1.3.0version=1.3.0
requestGetCapabilitiesrequest=GetCapabilities

Response

Returns an XML document listing all available layers with their:

  • Bounding boxes (spatial extent)
  • Available projections (SRS)
  • Styles
  • Data types
curl -X GET "https://graph.quarticle.ro/graph/layers/wms/GetCapabilities" \
-H "Authorization: YOUR_API_KEY" \
--data-urlencode "service=WMS" \
--data-urlencode "version=1.3.0" \
--data-urlencode "request=GetCapabilities"

DescribeLayer

Get metadata about a specific layer's WFS or WCS source.

Purpose: Find the corresponding WFS typeNames parameter for a WMS layer.

Required Parameters

ParameterDescription
serviceWMS
version1.1.1
requestDescribeLayer
layersComma-separated layer names. Example: GRAPHRASTER:light_pollution

Optional Parameters

ParameterDescription
exceptionsException format. Default: application/vnd.ogc.se_xml

Example

curl -X GET "https://graph.quarticle.ro/graph/layers/wms/DescribeLayer" \
-H "Authorization: YOUR_API_KEY" \
--data-urlencode "service=WMS" \
--data-urlencode "version=1.1.1" \
--data-urlencode "request=DescribeLayer" \
--data-urlencode "layers=GRAPHRASTER:light_pollution"

GetMap

Render a map tile (PNG image) for a given area, layers, and style.

Purpose: Generate styled map images for display on web maps or in applications.

Required Parameters

ParameterDescriptionExample
serviceWMSWMS
version1.3.01.3.0
requestGetMapGetMap
layersComma-separated layer namesGRAPHRASTER:light_pollution
stylesComma-separated style names (or empty for defaults)`` (empty) or light_style
srs / crsSpatial Reference System (EPSG code)EPSG:3857 (Web Mercator)
bboxBounding box: minx,miny,maxx,maxy in SRS units975947.9771,6657970.9118,1533632.5355,7037098.5720
widthWidth of output in pixels256
heightHeight of output in pixels256
formatOutput formatimage/png

Optional Parameters

ParameterDescriptionExample
transparentWhether background is transparenttrue
bgcolorBackground color in RRGGBB hex formatFFFFFF
exceptionsException formatapplication/json
timeTime value for temporal layers2023-01-01T00:00:00Z
sldURL to external SLD documenthttps://example.com/style.sld
sld_bodyURL-encoded SLD XML(see examples)

Example: Basic 256×256 Tile

curl -X GET "https://graph.quarticle.ro/graph/layers/wms/GetMap" \
-H "Authorization: YOUR_API_KEY" \
--data-urlencode "service=WMS" \
--data-urlencode "version=1.3.0" \
--data-urlencode "request=GetMap" \
--data-urlencode "layers=GRAPHRASTER:light_pollution" \
--data-urlencode "styles=" \
--data-urlencode "srs=EPSG:3857" \
--data-urlencode "bbox=975947.9771,6657970.9118,1533632.5355,7037098.5720" \
--data-urlencode "width=256" \
--data-urlencode "height=256" \
--data-urlencode "format=image/png" \
--data-urlencode "transparent=true" \
-o tile.png

Tips

  • EPSG:3857: Use for web map tiles (Web Mercator projection)
  • EPSG:4326: Use for reprojected data (lat/lon, rarely for tiles)
  • SRS vs CRS: WMS 1.1.x uses srs, WMS 1.3.0 uses crs (GeoServer accepts both)
  • format=image/png: Produces smaller, 8-bit PNG tiles
  • transparent=true: Allows background to show through (useful for overlays)
  • Multiple layers: Separate with commas: layers=layer1,layer2,layer3

GetFeatureInfo

Query feature attributes at a pixel location on a rendered map.

Purpose: "Click to query" — get attribute values from a location on a map.

Required Parameters

All GetMap parameters, plus:

ParameterDescriptionExample
query_layersLayers to query (subset of layers)GRAPHRASTER:light_pollution
xX coordinate of query point (in pixels)5
yY coordinate of query point (in pixels)5

Optional Parameters

ParameterDescription
info_formatResponse format: text/html, application/json, text/plain
feature_countMax features to return. Default: 1

Example

curl -X GET "https://graph.quarticle.ro/graph/layers/wms/GetFeatureInfo" \
-H "Authorization: YOUR_API_KEY" \
--data-urlencode "service=WMS" \
--data-urlencode "version=1.3.0" \
--data-urlencode "request=GetFeatureInfo" \
--data-urlencode "layers=GRAPHRASTER:light_pollution" \
--data-urlencode "query_layers=GRAPHRASTER:light_pollution" \
--data-urlencode "styles=" \
--data-urlencode "srs=EPSG:3857" \
--data-urlencode "bbox=975947.9771,6657970.9118,1533632.5355,7037098.5720" \
--data-urlencode "width=256" \
--data-urlencode "height=256" \
--data-urlencode "x=128" \
--data-urlencode "y=128" \
--data-urlencode "info_format=application/json"

GetLegendGraphic

Retrieve a rendered legend image for a layer and style.

Purpose: Display layer legend in your application.

Required Parameters

ParameterDescriptionExample
serviceWMSWMS
version1.0.01.0.0
requestGetLegendGraphicGetLegendGraphic
layerLayer nameGRAPHRASTER:light_pollution
stylesStyle namelight_style or empty
formatImage formatimage/png

Optional Parameters

ParameterDescription
widthWidth in pixels (default: 20)
heightHeight in pixels (default: 20)
ruleSpecific rule from style (if applicable)
scaleStandardized scale denominator
sldURL to external SLD document
sld_bodyURL-encoded SLD XML
languageLanguage for labels

Example

curl -X GET "https://graph.quarticle.ro/graph/layers/wms/GetLegendGraphic" \
-H "Authorization: YOUR_API_KEY" \
--data-urlencode "service=WMS" \
--data-urlencode "version=1.0.0" \
--data-urlencode "request=GetLegendGraphic" \
--data-urlencode "layer=GRAPHRASTER:light_pollution" \
--data-urlencode "format=image/png" \
--data-urlencode "width=40" \
--data-urlencode "height=40" \
-o legend.png

Error Handling

If a GetMap or GetCapabilities request fails, the error is returned in the requested exception format:

<?xml version="1.0" encoding="UTF-8"?>
<ServiceExceptionReport version="1.3.0">
<ServiceException>
Layer 'invalid_layer' not found
</ServiceException>
</ServiceExceptionReport>

Or as JSON if exceptions=application/json:

{
"code": "InvalidLayer",
"message": "Layer 'invalid_layer' not found"
}

Common errors:

  • InvalidLayer: Layer name doesn't exist. Check GetCapabilities.
  • InvalidSRS: SRS/CRS code not supported. Typical: EPSG:3857, EPSG:4326.
  • InvalidBBox: Bounding box format incorrect or out of range.
  • Unauthorized: API key is missing or invalid.

Next Steps