Web Map Service Reference - Product Documentation - MapInfo
Web Map Service Reference - Product Documentation - MapInfo
Web Map Service Reference - Product Documentation - MapInfo
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
WEB MAP SERVICE REFERENCE
Information in this document is subject to change without notice and does not represent a commitment on the part of the vendor or its representatives. No part of this document<br />
may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, without the written permission of <strong>Map</strong>Info Corporation,<br />
One Global View, Troy, New York 12180-8399.<br />
© 2006 <strong>Map</strong>Info Corporation. All rights reserved. <strong>Map</strong>Info, the <strong>Map</strong>Info logo, <strong>Map</strong>Xtreme, <strong>Map</strong>Marker, miAware, Envinsa, and StreetPro are trademarks of <strong>Map</strong>Info<br />
Corporation and/or its affiliates.<br />
Copyright © 2006 The Legion Of The Bouncy Castle<br />
Copyright © 2000-2006 IPDR Organization All Rights Reserved<br />
Copyright © 2006, International Business Machines Corporation and others. All Rights Reserved.<br />
Copyright © 2006 Open GIS Consortium, Inc., All Rights Reserved.<br />
Copyright © 2006 World Wide <strong>Web</strong> Consortium, (Massachusetts Institute of Technology, European Research Consortium for Informatics and Mathematics, Keio University).<br />
All Rights Reserved.<br />
This product includes software developed by the Apache Software Foundation (http://www.apache.org/).<br />
Java and all Java-based trademarks and logos are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries.<br />
<strong>Map</strong>Info Corporate Headquarters:<br />
Voice: (518) 285-6000<br />
Fax: (518) 285-6070<br />
Sales Info Hotline: (800) 327-8627<br />
Government Sales Hotline: (800) 619-2333<br />
Technical Support Hotline: (518) 285-7283<br />
Technical Support Fax: (518) 285-6080<br />
Contact information for all <strong>Map</strong>Info offices is located at: http://www.mapinfo.com/contactus.<br />
Adobe Acrobat® is a registered trademark of Adobe Systems Incorporated in the United States.<br />
<strong>Product</strong>s named herein may be trademarks of their respective manufacturers and are hereby recognized. Trademarked names are used editorially, to the benefit of the trademark<br />
owner, with no intent to infringe on the trademark.<br />
January 2006
Table of Contents<br />
Chapter 1: Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4<br />
Overview. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5<br />
Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5<br />
Layers and Styles. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5<br />
WMS Servers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5<br />
Understanding the WMS Server Functionality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6<br />
How to Get Information About a WMS Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6<br />
How to Retrieve a <strong>Map</strong> From a WMS Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6<br />
How to Use the WMS Server GetFeatureInfo Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6<br />
Chapter 2: <strong>Web</strong> <strong>Map</strong> <strong>Service</strong> Capabilities. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7<br />
Getting <strong>Service</strong>-Level Metadata About a WMS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8<br />
Getting <strong>Map</strong>s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11<br />
Getting Information About <strong>Map</strong> Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13<br />
Chapter 3: <strong>Web</strong> <strong>Map</strong> <strong>Service</strong> Fundamentals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15<br />
WMS Server Technology. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16<br />
HTTP GET. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16<br />
HTTP POST. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16<br />
Basic Authentication. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17<br />
Layers and Styles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17<br />
Chapter 4: Configuration Settings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18<br />
Preferences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Introduction<br />
Welcome to the <strong>Map</strong>Info® Envinsa Location Platform <strong>Web</strong> <strong>Service</strong>s.<br />
This guide provides descriptions and examples for the developer who is<br />
writing applications that access the <strong>Web</strong> <strong>Map</strong> <strong>Service</strong>.<br />
The <strong>Web</strong> <strong>Map</strong> <strong>Service</strong> lets an application render layers of geographic<br />
data onto a map image. The OpenGIS Consortium (OGC) <strong>Web</strong> <strong>Map</strong><br />
<strong>Service</strong> standard (version 1.1.1 located at http://<br />
www.opengeospatial.org/specs) defines how a client can retrieve map<br />
images over the Internet or a private intranet by submitting XML requests<br />
through HTTP. <strong>Product</strong>s that can use results from an OGC compliant<br />
WMS server will work with the Envinsa OGC <strong>Web</strong> <strong>Map</strong> <strong>Service</strong>, such as<br />
<strong>Map</strong>Info Professional and <strong>Map</strong>Xtreme or other vendor software.<br />
In this section:<br />
� Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5<br />
� Understanding the WMS Server Functionality. . . . . . . . . . . . 6<br />
1
<strong>Web</strong> <strong>Map</strong> <strong>Service</strong> <strong>Reference</strong> Chapter 1: Introduction<br />
Overview<br />
Introduction<br />
The Envinsa <strong>Web</strong> <strong>Map</strong> <strong>Service</strong> (WMS) allows software clients to reference map images over the<br />
Internet or a private intranet. The Envinsa <strong>Web</strong> <strong>Map</strong> <strong>Service</strong> implementation is based on the WMS<br />
1.1.1 OGC specification. Using HTTP requests, the <strong>Web</strong> <strong>Map</strong> <strong>Service</strong> provides georeference data to a<br />
client that displays this data as an image. Georeference data is information associated with maps that<br />
describe the real world extents of specific features and the projection upon which it is based.<br />
The images can be provided as GIF, JPEG, PNG, and other image formats.<br />
Layers and Styles<br />
The images rendered can be made of layers that are hierarchical—an image can be served that is<br />
made up of a layer that is a collection of other layers. Since WMS renders layers, the characteristics<br />
that modify the view of layers, such as styles and coordinate systems, can also be included in the<br />
layers provided. This lets you customize images because each image can act as a separate layer<br />
within the client that is accessing these images.<br />
WMS Servers<br />
Aside from the servers provided by <strong>Map</strong>Info Corporation and any service that you provide through your<br />
own organization, there are many public access WMS servers available on the World Wide <strong>Web</strong>.<br />
There are WMS servers for LandSat data, USGS DOQ photos, bathymetry, weather, and many other<br />
data types. <strong>Map</strong>Info maintains a <strong>Web</strong> <strong>Map</strong> Server of many of our data products, available at http://<br />
www.mapinfo.com/wiwms.<br />
Note: This URI is not useful in a <strong>Web</strong> browser. Rather, use this URI in <strong>Map</strong>Info Professional or some<br />
other WMS client to access images from these data sets.<br />
If you are accessing maps from different sources, it is not a complicated task to combine the images<br />
into a single coherent image that your users can work with. It is important to keep the spatial<br />
information (bounding box, spatial reference system, height, and width) identical. This ensures that the<br />
different images align with each other properly.<br />
Note: Not all <strong>Web</strong> <strong>Map</strong> Servers adhere to the OGC standards and may or may not be compatible<br />
with your WMS client.<br />
Please refer to the OGC WMS 1.1.1 specification (http://www.opengeospatial.org/specs/) for more<br />
information about developing a WMS client to the WMS 1.1.1 specification.<br />
At the time of this manual’s writing, the most current specification for WMS is 1.3. The latest OpenGIS<br />
specifications can be found at http://www.opengeospatial.org/specs/.<br />
Envinsa Location Platform 4.0<br />
© 2006 <strong>Map</strong>Info Corporation. All rights reserved. 5 Envinsa40_<strong>Web</strong><strong>Map</strong>_<strong>Service</strong>.pdf
<strong>Web</strong> <strong>Map</strong> <strong>Service</strong> <strong>Reference</strong> Chapter 1: Introduction<br />
Understanding the WMS Server Functionality<br />
There are three WMS server-specific methods that provide the basis for the server implementation:<br />
• GetCapabilities<br />
• Get<strong>Map</strong><br />
• GetFeatureInfo<br />
Each of these methods is discussed below.<br />
Note: A basic <strong>Web</strong> <strong>Map</strong> <strong>Service</strong> classifies its georeferenced information holdings into “layers” and<br />
offers a number of predefined “styles” in which to display those layers.<br />
How to Get Information About a WMS Server<br />
When first finding a <strong>Web</strong> <strong>Map</strong> Server, it is necessary to find out the names of available layers, styles in<br />
use, spatial information in use, and other information that the server provides, in order to make a<br />
request for an image that is within the parameters of the server.<br />
The GetCapabilities request retrieves service-level metadata over the Internet or intranet, including the<br />
server name, the layer names, abstracts about the data, and valid request parameters, among other<br />
data. The following section highlights potential ways to apply this capability: Getting <strong>Service</strong>-Level<br />
Metadata About a WMS on page 8<br />
How to Retrieve a <strong>Map</strong> From a WMS Server<br />
Get<strong>Map</strong> retrieves the geospatial information, over the Internet or an intranet, based on a specific<br />
request of the data you want and returns it as a raster image. When invoking Get<strong>Map</strong> a WMS client<br />
can specify:<br />
• Layers<br />
• Styles<br />
• A bounding box (the area to be mapped)<br />
• A coordinate reference system (also known as the spatial reference system)<br />
• Output image format (JPEG, GIF, PNG. and others).<br />
• Output size (height and width of the returned image)<br />
• Background transparency and color<br />
The following section highlights potential ways to apply this capability: Getting <strong>Map</strong>s on page 11<br />
How to Use the WMS Server GetFeatureInfo Operations<br />
GetFeatureInfo returns request information for a feature at a given point on the map after a Get<strong>Map</strong><br />
has been called. This is a search-at-point operation in which, after a Get<strong>Map</strong> request, the<br />
GetFeatureInfo request supplies the X, Y pixel coordinates of the location about which you want more<br />
information. The following section highlights potential ways to apply this capability: Getting<br />
Information About <strong>Map</strong> Features on page 13<br />
Envinsa Location Platform 4.0<br />
© 2006 <strong>Map</strong>Info Corporation. All rights reserved. 6 Envinsa40_<strong>Web</strong><strong>Map</strong>_<strong>Service</strong>.pdf
<strong>Web</strong> <strong>Map</strong> <strong>Service</strong><br />
Capabilities<br />
The Envinsa <strong>Web</strong> <strong>Map</strong> <strong>Service</strong> supports three capabilities which are<br />
described in detail in this section.<br />
In accordance with the Open GIS Consortium’s <strong>Web</strong> <strong>Map</strong> <strong>Service</strong><br />
Implementation Specification, The Envinsa <strong>Web</strong> <strong>Map</strong> <strong>Service</strong> provides<br />
the following operations:<br />
GetCapabilities – This capability retrieves service-level metadata<br />
including the server name, the layer names, abstracts about the data, and<br />
the valid request parameters.<br />
Get<strong>Map</strong> – This capability is used to request a map image using welldefined<br />
geospatial and dimensional parameters containing layers, styles,<br />
boundaries, and the spatial reference system (coordinate system of the<br />
data being retrieved). You can also specify the image format (JPEG, GIF,<br />
PNG, and others) and styles.<br />
GetFeatureInfo – This capability is used to request information for a<br />
feature at a given point on the map after a Get<strong>Map</strong> has been called.<br />
All of these request types are case-sensitive.<br />
In this section:<br />
� Getting <strong>Service</strong>-Level Metadata About a WMS . . . . . . . . . . . 8<br />
� Getting <strong>Map</strong>s. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11<br />
� Getting Information About <strong>Map</strong> Features. . . . . . . . . . . . . . . 13<br />
2
<strong>Web</strong> <strong>Map</strong> <strong>Service</strong> <strong>Reference</strong> Chapter 2: <strong>Web</strong> <strong>Map</strong> <strong>Service</strong> Capabilities<br />
Getting <strong>Service</strong>-Level Metadata About a WMS<br />
Before obtaining a map from a WMS server, it is important to determine the names of available layers,<br />
their contents, their SRS (spatial reference system, or coordinate system) settings, and other<br />
information about the data. Use the GetCapabilities request to obtain this information from a server.<br />
The GetCapabilities request returns service-level metadata in XML format. This metadata is a<br />
description of the information content and valid request parameters of the service.<br />
Inputs and Behaviors<br />
The following table lists the possible request inputs:<br />
The request parameters are always sent as an HTTP query string. The following is a sample<br />
GetCapabilities request:<br />
Output<br />
Inputs Required Description<br />
VERSION=version No Request version. Envinsa currently supports version 1.1.1.<br />
SERVICE=WMS Yes <strong>Service</strong> type. The SERVICE attribute is always set to WMS<br />
because that is all Envinsa currently supports.<br />
REQUEST=GetCapabilities Yes Request name<br />
http://host:port/<strong>Web</strong><strong>Map</strong>/servlet/<strong>Web</strong><strong>Map</strong>?SERVICE=WMS&REQUEST=GetCapabilities<br />
After a successful GetCapabilities request, the service returns a GetCapabilities response which is a<br />
large XML file. The GetCapabilites.xml file contains the following information.<br />
General <strong>Service</strong> Metadata<br />
The first part of the response contains the name of the <strong>Web</strong> service (always OGC:WMS), the title of the<br />
<strong>Web</strong> service, and the URL of the service.<br />
Note: The Name is usually a single word read by a machine, while the Title is designed to be humanreadable.<br />
The following code illustrates an example of this section:<br />
<br />
OGC:WMS<br />
<strong>Map</strong>Info Corporation <strong>Map</strong> Server<br />
<br />
<br />
Envinsa Location Platform 4.0<br />
© 2006 <strong>Map</strong>Info Corporation. All rights reserved. 8 Envinsa40_<strong>Web</strong><strong>Map</strong>_<strong>Service</strong>.pdf
<strong>Web</strong> <strong>Map</strong> <strong>Service</strong> <strong>Reference</strong> Chapter 2: <strong>Web</strong> <strong>Map</strong> <strong>Service</strong> Capabilities<br />
Capabilities<br />
This section names the actual operations that are supported by the service, the output formats offered<br />
by these operations, and the URL prefix for each operation. For most WMS services this section has<br />
three parts, one for GetCapabilities, one for Get<strong>Map</strong>, and one for GetFeatureInfo. The following<br />
example illustrates the Get<strong>Map</strong> section:<br />
<br />
image/gif<br />
image/jpeg<br />
image/jpg<br />
image/png<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
Layers<br />
Within the Capabilities element is a Layer element for each map that can be provided by the service.<br />
WMS also allows layers to be made up of layers so some nesting of layers can also be seen in these<br />
elements.<br />
Each Layer element includes the following:<br />
• Title – a name of the layer that is readable by the user.<br />
• Name – a name of the layer that is used to reference the layer in requests.<br />
• Style – a predefined style that can be used with this particular layer.<br />
• SRS – the spatial reference system(s) that applies to this layer. If more than one SRS can be<br />
used on the layer, each one can be listed.<br />
• LatLonBoundingBox – a set of attributes that state the minimum bounding rectangle of the map<br />
data in the default coordinate system (EPSG:4326). These numbers are expressed in decimal<br />
degrees<br />
These values are important when making a Get<strong>Map</strong> request (see Getting <strong>Map</strong>s on page 11), as that<br />
request requires the correct values that are specific to each individual <strong>Web</strong> <strong>Map</strong> service.<br />
When layers are nested, the values set for a parent layer cascade down to subsidiary elements unless<br />
specifically set differently in the child layers. The example below shows portions of the layer element to<br />
illustrate the different settings.<br />
<br />
<strong>Map</strong>Info Corporation <strong>Map</strong> Server<br />
<br />
<br />
<br />
BigRedStar<br />
BigRedStar<br />
<br />
<br />
Envinsa Location Platform 4.0<br />
© 2006 <strong>Map</strong>Info Corporation. All rights reserved. 9 Envinsa40_<strong>Web</strong><strong>Map</strong>_<strong>Service</strong>.pdf
<strong>Web</strong> <strong>Map</strong> <strong>Service</strong> <strong>Reference</strong> Chapter 2: <strong>Web</strong> <strong>Map</strong> <strong>Service</strong> Capabilities<br />
POITextStyle<br />
POITextStyle<br />
<br />
<br />
PositionStyle<br />
PositionStyle<br />
<br />
<br />
RouteEndPointStyle<br />
RouteEndPointStyle<br />
<br />
<br />
FeatureLayers<br />
EPSG:4201<br />
EPSG:4205<br />
...<br />
<br />
PUBLIC<br />
<br />
uscity<br />
US Cities<br />
<br />
<br />
<br />
WorldCountries<br />
WorldCountries<br />
<br />
<br />
<br />
<br />
...<br />
<br />
Customizing <strong>Service</strong> Element Information<br />
To customize your WMS installation, you can supply a service.xml file that stores the <strong>Service</strong> element<br />
information you would like to have included in any GetCapabilities response from your server. This<br />
service.xml file should conform to the OGC DTD (listed in the WMS 1.1.1 specification) and it needs to<br />
be located in the <strong>Web</strong><strong>Map</strong> context in the WEB-INF folder. The root element of the XML file needs to be<br />
<strong>Service</strong> or the XML file is considered invalid and any GetCapabilities response lists the default<br />
information from your initial WMS installation. There are many optional elements that can be included<br />
within the <strong>Service</strong> element. However only a few are required. See the specification for details. The<br />
following is a sample service.xml file.<br />
<br />
OGC:WMS<br />
Custom <strong>Service</strong> title<br />
<br />
<br />
Envinsa Location Platform 4.0<br />
© 2006 <strong>Map</strong>Info Corporation. All rights reserved. 10 Envinsa40_<strong>Web</strong><strong>Map</strong>_<strong>Service</strong>.pdf
<strong>Web</strong> <strong>Map</strong> <strong>Service</strong> <strong>Reference</strong> Chapter 2: <strong>Web</strong> <strong>Map</strong> <strong>Service</strong> Capabilities<br />
Getting <strong>Map</strong>s<br />
The primary reason to use or establish a <strong>Web</strong> <strong>Map</strong> Server is to obtain or serve maps. Use the Get<strong>Map</strong><br />
request to obtain images from a WMS server. Get<strong>Map</strong> requests are always sent as HTTP strings and<br />
the response is a map image with well-defined geospatial and dimensional parameters in the image<br />
format specified in the request.<br />
Inputs and Behaviors<br />
When invoking Get<strong>Map</strong> a WMS query can specify:<br />
Inputs Required Description<br />
VERSION=version No Request version. Envinsa WMS only supports version<br />
1.1.1.<br />
SERVICE=WMS Yes <strong>Service</strong> type. This is always WMS.<br />
REQUEST=Get<strong>Map</strong> Yes Request name. For a Get<strong>Map</strong> request this is always<br />
Get<strong>Map</strong>.<br />
LAYERS=layer_list Yes The layer or layers to be included in the map image. Each<br />
layer should be separated by a comma. For example:<br />
LAYERS=Layer1,Layer2,Layer3<br />
STYLES=style_list Yes Comma-separated list of one rendering style per<br />
requested layer. A style is required for each layer<br />
requested. If no style is requested, the attribute must be<br />
present but without a value. If requesting multiple layers,<br />
the styles listed should be in the same order as the layers.<br />
For example:<br />
STYLES=Style1,,Style3<br />
In the above example the second style (for the second<br />
layer requested) is left blank, allowing the default style<br />
defined for the layer to be used.<br />
SRS=namespace:identifier Yes The coordinate reference system used in the map<br />
(numeric representation of the projection of the map, also<br />
known as the spatial reference system). If this is not specified,<br />
the default coordinate reference system, as defined<br />
in the default style of the layer, is used. This is also<br />
defined as the spatial reference system (SRS).<br />
BBOX=minx,miny,maxx,maxy Yes The area to be mapped. the bounding box is specified as<br />
the four coordinates of the corners of the box that bounds<br />
the map area to be included in the image. The BBOX<br />
coordinates are always expressed in the units of the SRS.<br />
WIDTH=output_width Yes Width in pixels of map picture.<br />
HEIGHT=output_height Yes Height in pixels of map picture.<br />
FORMAT=output_format Yes The format in which the map image is to be returned.<br />
Envinsa Location Platform 4.0<br />
© 2006 <strong>Map</strong>Info Corporation. All rights reserved. 11 Envinsa40_<strong>Web</strong><strong>Map</strong>_<strong>Service</strong>.pdf
<strong>Web</strong> <strong>Map</strong> <strong>Service</strong> <strong>Reference</strong> Chapter 2: <strong>Web</strong> <strong>Map</strong> <strong>Service</strong> Capabilities<br />
Sample Request<br />
The following is a sample Get<strong>Map</strong> request:<br />
http://host:port/<strong>Web</strong><strong>Map</strong>/servlet/<strong>Web</strong><strong>Map</strong>?<br />
SERVICE=WMS&REQUEST=Get<strong>Map</strong>&SRS=EPSG:4326&BBOX=-100,0,90,100&<br />
WIDTH=400&HEIGHT=300&Layers=WorldCountries&STYLES=PositionStyle&<br />
FORMAT=image/png<br />
Note: The code above should all be on a single line with no breaks. Due to space limitations, we<br />
cannot display the request in such a way in this document.<br />
Sample Response<br />
Inputs Required Description<br />
TRANSPARENT=TRUE|FALSE No The transparency and color of the background of the<br />
image. If nothing is specified, the value is FALSE.<br />
BGCOLOR=color_value No Hexadecimal red-green-blue color value for the background<br />
color (default=0xFFFFFF).<br />
EXCEPTIONS=exception_format No The format in which exceptions are to be reported by the<br />
WMS (default=SE_XML).<br />
WFS=web_feature_service_URL No URL of <strong>Web</strong> Feature <strong>Service</strong> providing features to be<br />
symbolized using Styled Layer Descriptor.<br />
After a successful Get<strong>Map</strong> request, the service returns a Get<strong>Map</strong> response that is an image of the map<br />
specified by the parameters in the request. The following is the response to the above request:<br />
Envinsa Location Platform 4.0<br />
© 2006 <strong>Map</strong>Info Corporation. All rights reserved. 12 Envinsa40_<strong>Web</strong><strong>Map</strong>_<strong>Service</strong>.pdf
<strong>Web</strong> <strong>Map</strong> <strong>Service</strong> <strong>Reference</strong> Chapter 2: <strong>Web</strong> <strong>Map</strong> <strong>Service</strong> Capabilities<br />
Getting Information About <strong>Map</strong> Features<br />
Once a Get<strong>Map</strong> request has been successfully completed the user may want further information about<br />
the features included in the map. Use the GetFeatureInfo request to get this further information from a<br />
server. A GetFeatureInfo request returns information regarding the layers in the map and the queryable<br />
attributes of each layer. This operation is optional. If GetFeatureInfo is employed, it must be issued<br />
after a Get<strong>Map</strong> request is sent, as the X/Y pixel coordinate of a point on that map is a required input of<br />
a GetFeatureInfo request. Refer to the <strong>Web</strong> <strong>Map</strong>ping <strong>Service</strong> OGC Specification for more information<br />
about this capability (http://www.opengeospatial.org/specs/).<br />
Inputs and Behaviors<br />
The following table lists the possible GetFeatureInfo request inputs.<br />
Sample Request<br />
Inputs Required Description<br />
VERSION=version Yes Request version. Envinsa only supports version 1.1.1.<br />
REQUEST=GetFeatureInfo Yes Request name. For a GetFeatureInfo request this is<br />
always GetFeatureInfo.<br />
Yes Partial copy of the Get<strong>Map</strong> request parameters that<br />
generated the map for which information is desired. The<br />
entire Get<strong>Map</strong> request is included except for the VER-<br />
SION and REQUEST parameters. See the sample<br />
request below.<br />
QUERY_LAYERS=layer_list Yes Comma-separated list of one or more layers to be queried.<br />
You do not need to include every layer included in<br />
the initial Get<strong>Map</strong> request.<br />
INFO_FORMAT=output_format No Return format of feature information (MIME type).<br />
FEATURE_COUNT=number No The maximum number of features about which to return<br />
information (default is FEATURE_COUNT=1).<br />
X=pixel_column Yes X-coordinate in pixels of feature (measured from the<br />
upper left corner which is 0).<br />
Y=pixel_row Yes Y-coordinate in pixels of feature (measured from the<br />
upper left corner which is 0).<br />
The following is a sample GetFeatureInfo request:<br />
http://host:port/<strong>Web</strong><strong>Map</strong>/servlet/<strong>Web</strong><strong>Map</strong>?<br />
SERVICE=WMS&REQUEST=GetFeatureInfo&SRS=EPSG:4326&BBOX=-180,-180,180,180&<br />
WIDTH=100&HEIGHT=100&Layers=WorldCountries&QUERY_Layers=WorldCountries&STYLES=&<br />
FORMAT=image/png&X=1&Y=1&FEATURE_COUNT=1<br />
Note: The code above should all be on a single line with no breaks. Due to space limitations, we<br />
cannot display the request in such a way in this document.<br />
Envinsa Location Platform 4.0<br />
© 2006 <strong>Map</strong>Info Corporation. All rights reserved. 13 Envinsa40_<strong>Web</strong><strong>Map</strong>_<strong>Service</strong>.pdf
<strong>Web</strong> <strong>Map</strong> <strong>Service</strong> <strong>Reference</strong> Chapter 2: <strong>Web</strong> <strong>Map</strong> <strong>Service</strong> Capabilities<br />
Output<br />
After a successful GetFeatureInfo request, the service returns a GetFeatureInfo response. A<br />
GetFeatureInfo response is an XML file. The returned file includes information about the layers in the<br />
map, the queryable attributes of those layers, and the bounding box and SRS information of the map.<br />
Envinsa Location Platform 4.0<br />
© 2006 <strong>Map</strong>Info Corporation. All rights reserved. 14 Envinsa40_<strong>Web</strong><strong>Map</strong>_<strong>Service</strong>.pdf
<strong>Web</strong> <strong>Map</strong> <strong>Service</strong><br />
Fundamentals<br />
The Hypertext Transfer Protocol (HTTP) is an application-level protocol<br />
for distributed, collaborative, hypermedia information systems. The<br />
Envinsa <strong>Web</strong> <strong>Map</strong> <strong>Service</strong> uses HTTP for the transfer of information.<br />
Specifically two methods are used. They are described in detail in this<br />
section.<br />
In this section:<br />
� WMS Server Technology . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16<br />
� HTTP GET . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16<br />
� HTTP POST . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16<br />
� Basic Authentication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17<br />
� Layers and Styles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17<br />
3
<strong>Web</strong> <strong>Map</strong> <strong>Service</strong> <strong>Reference</strong> Chapter 3: <strong>Web</strong> <strong>Map</strong> <strong>Service</strong> Fundamentals<br />
WMS Server Technology<br />
The Envinsa WMS server functions using the HTTP GET and HTTP POST methods. For a full<br />
discussion of HTTP and its methods, refer to the Internet Engineering Task Force HTTP specification<br />
(http://www.ietf.org).<br />
HTTP GET<br />
The GET method retrieves whatever information (in the form of an entity) is identified by the Request-<br />
URI. If the Request-URI refers to a data-producing process, it is the produced data that is returned as<br />
the entity in the response and not the source text of the process, unless that text happens to be the<br />
output of the process.<br />
For the <strong>Web</strong> <strong>Map</strong> <strong>Service</strong>, the GET method is used to retrieve entire images from whatever server is<br />
being accessed.<br />
HTTP POST<br />
The POST method is used to request that the origin server accept the entity enclosed in the request as<br />
a new subordinate of the resource identified by the Request-URI in the Request-Line. POST is<br />
designed to allow a uniform method to cover the following functions:<br />
• Annotation of existing resources.<br />
• Posting a message to a bulletin board, newsgroup, mailing list, or similar group of articles.<br />
• Providing a block of data, such as the result of submitting a form, to a data-handling process.<br />
• Extending a database through an append operation.<br />
The actual function performed by the POST method is determined by the server and is usually<br />
dependent on the Request-URI. The posted entity is subordinate to that URI in the same way that a file<br />
is subordinate to a directory containing it, a news article is subordinate to a newsgroup to which it is<br />
posted, or a record is subordinate to a database.<br />
In the context of the Envinsa <strong>Web</strong> <strong>Map</strong> <strong>Service</strong>, HTTP POST is used by the server and is not directly<br />
accessible by a client.<br />
Envinsa Location Platform 4.0<br />
© 2006 <strong>Map</strong>Info Corporation. All rights reserved. 16 Envinsa40_<strong>Web</strong><strong>Map</strong>_<strong>Service</strong>.pdf
<strong>Web</strong> <strong>Map</strong> <strong>Service</strong> <strong>Reference</strong> Chapter 3: <strong>Web</strong> <strong>Map</strong> <strong>Service</strong> Fundamentals<br />
Basic Authentication<br />
Usually a <strong>Web</strong> <strong>Map</strong> service is open to the general public and needs no authentication. From time to<br />
time, a server may limit access to only authorized users. As there is no capability to include IDs or<br />
passwords in a WMS request query, this must be set by the client and included in the HTTP header on<br />
the <strong>Web</strong> page. the following is a sample HTTP header that includes basic authorization information:<br />
GET /<strong>Web</strong><strong>Map</strong>/servlet/<strong>Web</strong><strong>Map</strong>?SERVER=WMS&REQUEST=GetCapabilities HTTP/1.1<br />
Authorization: BASIC YWRtaW46aDdhU1ZEd2o3RVd5a1gzRUhNbW5Pdz09<br />
User-Agent: Java/1.4.1<br />
Host: 127.0.0.1:8080<br />
Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2<br />
Connection: keep-alive<br />
WMS supports optional basic authorization that is managed through the Enterprise Manager. The<br />
following Java code provides an example of how to include this information a WMS client:<br />
URL url = new URL(wmsURL);<br />
HttpURLConnection uc = (HttpURLConnection)url.openConnection();<br />
if(secure) {<br />
uc.setUseCaches(true);<br />
uc.setRequestProperty("Authorization",<br />
EMEncoder.encryptBasicAuthorization("admin", EMEncoderPBE.encrypt("admin")));<br />
}<br />
Beside Basic Authorization, the WMS also provides enterprise access control based on the Username/<br />
Role. When the HTTP header contains authorization information, the service checks the user's role as<br />
it is defined in the Enterprise Manager. If the user has an Administrator role, the user can access all<br />
resources. Otherwise, the user can only access its own enterprise resources. For non-enterprise<br />
users, they can only access public resource. The PUBLIC directory is the only available directory so is<br />
not specified. For example, if you have a named layer under the JNDI root such as "PUBLIC/<br />
WorldCountries", it is displayed as WorldCountries without the PUBLIC prefix.<br />
Layers and Styles<br />
The images rendered can be made of layers that are hierarchical—an image can be served that is<br />
made up of a layer that is a collection of other layers. Since WMS renders layers, the characteristics<br />
that modify the view of layers, such as styles and coordinate systems, can also be included in the<br />
layers provided. This lets you customize images because each image can act as a separate layer<br />
within the client that is accessing these images.<br />
Envinsa Location Platform 4.0<br />
© 2006 <strong>Map</strong>Info Corporation. All rights reserved. 17 Envinsa40_<strong>Web</strong><strong>Map</strong>_<strong>Service</strong>.pdf
Configuration Settings<br />
Using the Enterprise Manager several characteristics can be set for the<br />
behavior of the <strong>Web</strong> <strong>Map</strong> <strong>Service</strong>. This section details those preferences.<br />
In this section:<br />
� Preferences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19<br />
4
<strong>Web</strong> <strong>Map</strong> <strong>Service</strong> <strong>Reference</strong> Chapter 4: Configuration Settings<br />
Preferences<br />
The following preferences can be set in the Enterprise Manager:<br />
Setting Required Description<br />
providerURL No The URL for the named resource’s JNDI root. By default this is<br />
left empty, allowing for the service to automatically use the<br />
Named Resource component. Fill in a value for this preference<br />
if you have your data located elsewhere.<br />
epsgOnly No Determines whether to return only EPSG:SRS names. If this is<br />
set to False, all names are returned, but only if the SRS has a<br />
name.<br />
generateImageUsing<br />
RequestedBounds<br />
No Determines whether to stretch the image; if not present, the<br />
default behavior is to use the requested bounds. Sometimes<br />
the provided image does not fill the requested bounds or the<br />
requested width and height settings have a different proportion<br />
than the requested bounds. In those cases, this preference<br />
forces the service to stretch the image to fill all the parameters.<br />
If this preference is set to “True,” the resulting images can show<br />
up with an inaccurate proportion.<br />
layerContextPrefix No This preference can be given a string that acts as a content prefix<br />
for named layers. This is useful for distinguishing layer<br />
names that can be confused with style names.<br />
styleContextPrefix No This preference can be given a string that acts as a content prefix<br />
for named styles. This is useful for distinguishing style<br />
names that can be confused with layer names.<br />
maxAgeOfCapabilitiesXML Yes Determines the maximum age of the capabilities.xml file. A<br />
value of -1 means that the capabilities.xml file never expires. A<br />
positive value is interpreted as the maximum allowed age of the<br />
file in hours. When the server is initialized, it checks the age of<br />
the file, and if it has become outdated, it regenerates a new version<br />
of the file. If the maximum age is set to -1, be sure to<br />
restart the service after changing anything with the data so that<br />
the GetCapabilities.xml file is accurate.<br />
hostmachinename No Determines the value of the machine name in the capabilities.xml.<br />
If this value is not specified, the capabilities.xml document<br />
uses the IP address of the server machine. It is strongly<br />
suggested that this preference be specified.<br />
disableFeatureInfo No Determines whether the GetFeature operation is available. Set<br />
this preference to False to disable the operation. This is useful<br />
if the metadata of the information needs to be kept private.<br />
Envinsa Location Platform 4.0<br />
Default<br />
Value<br />
© 2006 <strong>Map</strong>Info Corporation. All rights reserved. 19 Envinsa40_<strong>Web</strong><strong>Map</strong>_<strong>Service</strong>.pdf<br />
Null<br />
Null<br />
Null<br />
Null<br />
Null<br />
1<br />
Null<br />
False
<strong>Web</strong> <strong>Map</strong> <strong>Service</strong> <strong>Reference</strong> Chapter 4: Configuration Settings<br />
Setting Required Description<br />
serviceURL No This preference sets the return string for the end point of the<br />
servlet. The form should be http://host IP:servlet<br />
port/<strong>Web</strong><strong>Map</strong>/servlet/<strong>Web</strong><strong>Map</strong>?. You can also use this<br />
preference to set the proxy URL to override the default<br />
xlink:href attribute. The form is as follows: http://<br />
proxy:port/<strong>Web</strong><strong>Map</strong>/servlet/<strong>Web</strong><strong>Map</strong>?.<br />
Envinsa Location Platform 4.0<br />
Default<br />
Value<br />
© 2006 <strong>Map</strong>Info Corporation. All rights reserved. 20 Envinsa40_<strong>Web</strong><strong>Map</strong>_<strong>Service</strong>.pdf<br />
Null