How Does it Work, Exactly?
WMS requests are made up of the address of the server the request is being sent to and a series of parameters. There are two types of request that are required for any WMS request: GetMap and GetCapabilities. Although GetCapabilities is usually the first request sent, it’s simpler than GetMap and not always required.
We’ll begin by looking at an example GetCapabilities request, since they’re less complicated, just to familiarize ourselves with the parts of a URL. THen we’ll look at how to make a GetMap request, because that’s the request you’ll be making most often, and then we’ll come back to GetCapabilities to learn how to use it.
https://www.gebco.net/data_and_products/gebco_web_services/web_map_service/mapserv?request=getcapabilities&service=wms&version=1.3.0
An example of a GetCapabilities request
URL Format
Permalink to URL FormatYou can load maps through WMS using URLs just like you do when you load a webpage. URLs will take the form:
PROTOCOL://HOST/PATH?QUERY
- PROTOCOL
- Typically https, although on older sites you may still find http. The protocol is separate from the rest of the URL by ://
- HOST
- This will be the domain name that you typically think of as the website’s address such as gebco.net in the above example
- PATH
- This is the part of the URL that begins with a /, such as /data_and_products/gebco_web_services/web_map_service/mapserv in the above example. The path may or may not also end with a /
- QUERY
- The query string is separated from the rest of the URL by a ?. It is composed of parameters for the request along with the values assigned to those parameters. Parameters take the form NAME=VALUE and each name-value pair is separated by an &
In our previous example, the protocol is https, the host is gebco.net the path is /data_and_products/gebco_web_services/web_map_service/mapserv and the query contains three parameters
- version, which is set to 1.3.0
- service, which is set to WMS
- REQUEST, which is set to GetCapabilities