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.
URL FormatPermalink to URL Format
You can load maps through WMS using URLs just like you do when you load a webpage. URLs will take the form:
- Typically https, although on older sites you may still find http. The protocol is separate from the rest of the URL by ://
- This will be the domain name that you typically think of as the website’s address such as neowms.sci.gsfc.nasa.gov in the above example
- This is the part of the URL that begins with a /, such as /wms/wms in the above example. The path may or may not also end with a /
- 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 http, the host is neowms.sci.gsfc.nasa.gov the path is /wms/wms 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