WMS imagery

 

WMS

WMS stands for “Web Mapping Service”, which is a protocol for requesting and downloading georeferenced map images over a computer network.  A WMS server stores map data, assembles map images based on specific requests from client computers, and delivers these images back to the clients over a network.  While some companies have their own in-house WMS servers, most users will be downloading images from a server on the Internet.  

WMS imagery underneath wellspots in the Map Module

WMS and Petra

Petra’s Map Module acts as the client that requests data from a WMS server.  With a WMS connection active, Petra sends a request for a map to the WMS server every time the user moves the screen, zooms in/out, or redraws, Petra requests a new map from the server.  The WMS assembles a map based on the requested layers, map boundaries, and map projection and sends it back to Petra.  Petra then draws the received WMS map in the map module.  Since each image is already georeferenced, Petra can display these maps in the proper scale and place automatically.  Petra draws WMS images underneath other map features such as landgrids and wellspots.  Importantly, these images are only stored temporarily.

WMS and Map Projection

Just like all other geospatial data, WMS data rely on map projections to convert information on the round shape of the earth to a flat image on a computer screen or piece of paper.  WMS data store map projection information for each image in a series of “EPSG codes.”  Each EPSG code records the reference datum and coordinate system used to create the image.  Similarly, a Petra project’s reference datum and coordinate system can also be described as an EPSG code.  

Both the WMS EPSG code and the Petra project’s EPSG code need to match for WMS data to plot correctly. Petra actually requests a map based on the location of the NW and SE corners of the map.  The more precisely the WMS and Petra agree on the location of these two points, the more accurate the WMS data is in the Map Module.  If Petra and the WMS server can agree on an EPSG code with both a reference datum and coordinate system, Petra can request images with foot/meter precision.  Conversely, If Petra and the WMS server can only agree on an EPSG code with a reference datum but not a coordinate system, Petra can request images with LatLon precision.  Note that Petra will try to find the best common map projection on its own.

Standard Coordinate Systems

Petra projects using “standard” (Blue Marble) map projections tend to have the best results with WMS data.  Standard projections already have EPSG codes, so the translation is more precise, assuming there’s an equivalent EPSG code available on the WMS server.  In this case, Petra and the WMS will both use the same reference datum and coordinate system, so the XY values of the boundaries of the map will agree.

Custom Coordinate Systems

Petra projects with “custom” map projections are usually older Petra projects created before the Blue Marble map projection system was implemented.   For custom coordinate systems, Petra will use the reference datum’s ESPG code.  Without agreement on the coordinate system that converts LatLons to XYs, Petra and the WMS can only use LatLons to establish the boundary of the requested map image.  This method is less precise.

When there is no Match

Remember that not all WMS Servers support all map projections.  Occasionally, Petra and the WMS just won’t have an EPSG code in common.  

Important: Petra does not re-project WMS maps out of the original projection since the task of repeatedly downloading and re-projecting every pixel on the image would simply take too long.  The only solutions are to contact the WMS administrator to support the Petra project’s projection, or re-project the entire Petra project to use one of the available WMS projections.  

Some servers do not publish all the projections they support in the capabilities file.  By disregarding error messages, Petra will still request the map using the best EPSG code it can resolve with the server.

The EPSG registry at http://www.epsg-registry.org/ provides a lookup feature to search for EPSG codes by location or name, or to translate EPSG codes directly into datum and coordinate systems.

Related Topics: