wiki:UserDocs/WebMapService

The Web Map Service file format

Accessing several different types of web image services is possible using the WMS format in GDAL. Services are accessed by creating a local service description XML file.

The official GDAL documentation for the WMS file format is http://www.gdal.org/frmt_wms.html.

Introduction

Given a particular WMS server, it should always be possible to query its capabilities through the GetCapabilities request. From this information it is possible to build a reasonable service description XML file for GDAL. In particular, the following relevant data is usually discernible:

  • server URL and version (<ServiceURL> and <Version> tags);
  • image projection (<SRS>, <CRS>, <Projection> tags);
  • image extent (<UpperLeftX>, <UpperLeftY>, <LowerRightX>, <LowerRightY> tags);
  • available layers (<Layers> tag);
  • available styles (<Styles> tag)

What is missing is the image size in pixels (<SizeX> and <SizeY> tags) and, since it is a mandatory parameter, it should be found somewhere else or... 'guessed'.

In the following, there are some examples of complete service description XML files ready to be used with GDAL, using different WMS mini-drivers. This list is meant to extend the examples given in the official documentation at http://www.gdal.org/frmt_wms.html

TerraServer-USA (US)

The main website is http://terraservice.net/ and the web services are described at http://terraservice.net/webservices.aspx

The capabilities url is http://terraservice.net/ogccapabilities.ashx?version=1.1.1&request=getcapabilities&service=wms

All maps can be reprojected on the fly to EPSG:4326, but the image size in pixels is easily derivable only for the single UTM zones: 2m/pixel, EPSG:26904 - EPSG:26919, i.e. NAD83 / UTM Zone 4N-19N. So, instead of a single XML file, we need a specific file for each zone.

In the following, the files for accessing the DRG layer (USGS Raster Graphics Topo Maps) with default style:

Portale Cartografico Nazionale (Italy)

The main website is http://www.pcn.minambiente.it/PCN/ and the web services are described at http://www.pcn.minambiente.it/PCNDYN/catalogowms.jsp?lan=en

The following files provide topo maps at 1:25000 and 1:100000 scales for Italy. The image size in pixel is just an almost random guess.

Last modified 14 years ago Last modified on Dec 22, 2009, 5:01:51 AM

Attachments (14)

Download all attachments as: .zip

Note: See TracWiki for help on using the wiki.