18.11.2012 Views

Geomatica WebServer Installation Guide.book - UNBC GIS / Remote ...

Geomatica WebServer Installation Guide.book - UNBC GIS / Remote ...

Geomatica WebServer Installation Guide.book - UNBC GIS / Remote ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Geomatica</strong> ® <strong>WebServer</strong> Suite<br />

<strong>Installation</strong> and Configuration <strong>Guide</strong><br />

Version 10.1.1


©2007 PCI Geomatics Enterprises Inc.®. All rights reserved.<br />

COPYRIGHT NOTICE<br />

Software copyrighted © by PCI Geomatics, 50 West Wilmot St., Suite 200, Richmond Hill,<br />

ON CANADA L4B 1M5<br />

Telephone number: (905) 764-0614<br />

RESTRICTED RIGHTS<br />

Canadian Government<br />

Use, duplication, or disclosure by the Government is subject to restrictions as set forth in DSS<br />

9400-18 "General Conditions - Short Form - Licensed Software".<br />

U.S. Government<br />

Use, duplication, or disclosure by the Government is subject to restrictions set forth in<br />

subparagraph (b)(3) of the Rights in Technical Data and Computer Software clause of<br />

DFARS 252.227-7013 or subparagraph (c)(1) and (2) of the Commercial Computer Software-<br />

Restricted Rights clause at 48 CFR 52.227-19 as amended, or any successor regulations<br />

thereto.<br />

PCI, PCI Geomatics, PCI and design (logo), <strong>Geomatica</strong>, Committed to GeoIntelligence<br />

Solutions, GeoGateway, FLY!, OrthoEngine, RADARSOFT, EASI/PACE, ImageWorks,<br />

GCPWorks, PCI Author, PCI Visual Modeler, and SPANS are registered trademarks of PCI<br />

Geomatics Enterprises, Inc.<br />

Sentinel is a registered® trademark of SafeNet, Inc.<br />

All other trademarks and registered trademarks are the property of their respective owners.<br />

The <strong>Geomatica</strong> <strong>WebServer</strong> Suite was developed with the generous support of Natural Resources<br />

Canada GeoConnections program.<br />

http://www.geoconnections.org


Table of Contents<br />

Chapter 1<br />

INTRODUCTION TO GEOMATICA WEBSERVER SUITE<br />

Introducing <strong>Geomatica</strong> <strong>WebServer</strong> Suite ..................................................................................................................................................... 7<br />

Intended Audience................................................................................................................................................................................ 7<br />

System Requirements .......................................................................................................................................................................... 7<br />

Contacting PCI Geomatics Support.............................................................................................................................................................. 8<br />

Understanding How the Web Services Work ............................................................................................................................................... 8<br />

Understanding the <strong>Geomatica</strong> Web Feature Service ........................................................................................................................... 9<br />

Understanding the <strong>Geomatica</strong> Web Coverage Service...................................................................................................................... 10<br />

Understanding the <strong>Geomatica</strong> Web Mapping Service........................................................................................................................ 10<br />

Chapter 2<br />

INSTALLING THE SERVLETS<br />

Installing <strong>Geomatica</strong> ................................................................................................................................................................................... 13<br />

Installing the HTTP Server and Servlets .................................................................................................................................................... 13<br />

Installing the Java SE Development Kit on a Windows System ......................................................................................................... 14<br />

Installing the Tomcat Server on a Windows System .......................................................................................................................... 14<br />

Testing the Tomcat Server ................................................................................................................................................................. 15<br />

Installing .JAR Files .................................................................................................................................................................................... 16<br />

iii


iv<br />

Installing Oracle® .JAR Files ..............................................................................................................................................................16<br />

Installing .WAR Files...................................................................................................................................................................................16<br />

Exploring the WCS Folder...........................................................................................................................................................................16<br />

Exploring the WFS Folder...........................................................................................................................................................................17<br />

Exploring the WMS Folder ..........................................................................................................................................................................17<br />

Stopping and Restarting Tomcat.................................................................................................................................................................18<br />

Troubleshooting Low Memory Error in Tomcat...........................................................................................................................................18<br />

Chapter 3<br />

CONFIGURING THE SERVLET FOR THE WEB FEATURE SERVICE (WFS)<br />

Configuring the WFS Servlet.......................................................................................................................................................................21<br />

Exploring the Web.xml for the WFS ....................................................................................................................................................22<br />

Setting the Initialization Properties......................................................................................................................................................23<br />

Testing the WFS Servlet .....................................................................................................................................................................26<br />

Publishing Your Data on the WFS Servlet ..................................................................................................................................................26<br />

Exploring the Data Source Configuration File .....................................................................................................................................27<br />

Modifying the Data Source Configuration File.....................................................................................................................................27<br />

WFS Troubleshooting Checklist..................................................................................................................................................................28<br />

Chapter 4<br />

CONFIGURING THE SERVLET FOR THE WEB COVERAGE SERVICE (WCS)<br />

Configuring the WCS Servlet ......................................................................................................................................................................31<br />

Exploring the config.xml for the WCS .................................................................................................................................................31<br />

Testing the WCS Servlet.....................................................................................................................................................................34<br />

Publishing Your Data on the WCS Servlet..................................................................................................................................................35<br />

Modifying the WCS Deployment File ..................................................................................................................................................35<br />

WCS Troubleshooting Checklist .................................................................................................................................................................38<br />

Chapter 5<br />

CONFIGURING THE SERVLET FOR THE WEB MAPPING SERVICE (WMS)<br />

Configuring the WMS Servlet......................................................................................................................................................................39<br />

Using the Self-Configured Method ......................................................................................................................................................39


Using the Assisted Method................................................................................................................................................................. 40<br />

Using the Customized Method ........................................................................................................................................................... 40<br />

Creating the Servlet Configuration File....................................................................................................................................................... 41<br />

Exporting the XML Project.................................................................................................................................................................. 41<br />

Exploring the Initialization Parameters ............................................................................................................................................... 41<br />

Setting Parameters in Tomcat ............................................................................................................................................................ 43<br />

Reconfiguring <strong>Geomatica</strong> Focus Project Using EASI................................................................................................................................. 43<br />

Resetting the Servlet from a <strong>Remote</strong> Location........................................................................................................................................... 43<br />

Exploring the Syntax of the Servlet’s Configuration File............................................................................................................................. 44<br />

Exploring the Contents of the Servlet’s DTD .............................................................................................................................................. 45<br />

Viewing the MapService-Config DTD ......................................................................................................................................................... 47<br />

Chapter 6<br />

PUBLISHING YOUR MAPS ON THE WMS SERVLET OR A WEB PAGE<br />

Publishing Your Data on the WMS Servlet................................................................................................................................................. 49<br />

Starting the <strong>Geomatica</strong> <strong>WebServer</strong> Monitor............................................................................................................................................... 49<br />

Publishing Your Maps in a Web Page ........................................................................................................................................................ 50<br />

Introducing the Templates .......................................................................................................................................................................... 51<br />

Using the Basic Template to Display Your Project ..................................................................................................................................... 52<br />

Using the Templates for Your Web Page ................................................................................................................................................... 52<br />

Creating Your Applet’s XML File......................................................................................................................................................... 52<br />

Creating Your HTML File from an Example........................................................................................................................................ 53<br />

Making Your Own Web Page ..................................................................................................................................................................... 54<br />

Displaying Layers ............................................................................................................................................................................... 55<br />

Creating Queryable Layers................................................................................................................................................................. 55<br />

Adding Buttons ................................................................................................................................................................................... 56<br />

Providing a Tool to Build Query Expressions ..................................................................................................................................... 63<br />

Adding Shortcuts to Saved Queries ................................................................................................................................................... 63<br />

Adding a Tool to Display the Coordinates in the Status Bar............................................................................................................... 64<br />

Displaying an Overview of Your Project ............................................................................................................................................. 64<br />

Chapter 7<br />

CONFIGURING THE WMS MAPVIEWER APPLET<br />

Configuring the MapViewer Applet ............................................................................................................................................................. 67<br />

v


vi<br />

Creating the Applet’s Configuration File......................................................................................................................................................67<br />

Adding Several Map Layers ................................................................................................................................................................68<br />

Defining the “Mapviewer-Config” Root Element..................................................................................................................................69<br />

Using the Viewport Element................................................................................................................................................................69<br />

Using the “Extent” Child Element ........................................................................................................................................................69<br />

Setting the “SRS” Attribute..................................................................................................................................................................69<br />

Using the WMSProvider Element........................................................................................................................................................70<br />

Setting WMSProvider Attributes..........................................................................................................................................................70<br />

Using the “Map” Element ....................................................................................................................................................................71<br />

Using the “Maplayer” Child Element ...................................................................................................................................................71<br />

Determining the Supported-Styles ......................................................................................................................................................72<br />

Changing the Supported-Bbox............................................................................................................................................................72<br />

Setting the “Maplayer” Attributes.........................................................................................................................................................73<br />

Generating a Capabilities File.....................................................................................................................................................................73<br />

Viewing the MapViewer DTD ......................................................................................................................................................................74<br />

Chapter 8<br />

API REFERENCE FOR THE WMS<br />

Class MapViewerApplet..............................................................................................................................................................................77<br />

Class Layer .................................................................................................................................................................................................88<br />

Class LayerInfoFilterConfig.........................................................................................................................................................................97<br />

Class Extent..............................................................................................................................................................................................110<br />

Class Point2d............................................................................................................................................................................................113<br />

Class RectangleDouble.............................................................................................................................................................................118<br />

Index ........................................................................................................................................................................................................131


Introduction to <strong>Geomatica</strong> <strong>WebServer</strong> Suite<br />

Introducing <strong>Geomatica</strong> <strong>WebServer</strong> Suite<br />

Welcome to <strong>Geomatica</strong> ® <strong>WebServer</strong> Suite. <strong>Geomatica</strong> <strong>WebServer</strong><br />

Suite contains three services designed for sharing geospatial<br />

information over the Web.<br />

With the Web Feature Service (WFS) you can open features in<br />

<strong>Geomatica</strong> Focus from any Web feature service on the Web, and you<br />

can provide others with access to your project’s features through the<br />

Internet.<br />

With the Web Coverage Service (WCS) you can open coverages in<br />

<strong>Geomatica</strong> Focus from any Web coverage service on the Web, and<br />

you can provide others with access to your coverages through the<br />

Internet.<br />

With the Web Mapping Service (WMS) you can open map layers<br />

in <strong>Geomatica</strong> Focus from any Web map service on the Web, and you<br />

can make your maps layers available to anyone on the Internet<br />

through the server or your Web page.<br />

C HAPTER<br />

1<br />

Intended Audience<br />

The <strong>Geomatica</strong> <strong>WebServer</strong> Suite <strong>Guide</strong> is intended for those who are<br />

tasked with installing and configuring the components of the Web<br />

servers or designing the Web page. Although most of the guide is<br />

written with the assumption that you have basic knowledge of the<br />

various Web technologies, such as HTML, XML, JavaScript, Web<br />

servers, applets and servlets, some basic concepts are explained. So,<br />

even if you possess only a rudimentary knowledge of the<br />

technologies and basic programming skills, you can install the<br />

<strong>Geomatica</strong> <strong>WebServer</strong> Suite and certainly create a Web page.<br />

This guide also assumes that you are familiar with <strong>Geomatica</strong>, the<br />

software program used to create the projects. For details on how to<br />

use <strong>Geomatica</strong> Focus, refer to the <strong>Geomatica</strong> Focus User <strong>Guide</strong>.<br />

System Requirements<br />

PCI <strong>Geomatica</strong> software is distributed on ISO9660 format CD-<br />

ROMs. The PCI software requires a valid license; otherwise it will<br />

run in demo mode with limited functionality.<br />

7


Chapter 1 - Introduction to <strong>Geomatica</strong> <strong>WebServer</strong> Suite<br />

You must have the following system requirements for the<br />

<strong>WebServer</strong> Suite:<br />

Microsoft® Windows®<br />

• Windows NT 4.0, Windows 2000, or Windows XP.<br />

• Pentium III 600 MHz processor, or greater.<br />

• CD-ROM drive.<br />

• 800 MB of free hard disk space, plus space for data.<br />

• 512 MB of RAM, or greater.<br />

• 24-bit Windows graphics card or accelerator, running at 1280 x 1024<br />

pixels. The minimum is a 16-bit graphics card or accelerator, running<br />

at 1024 x 768.<br />

• SentinelPro hardware key (included).<br />

HTTP Server<br />

• Servlet 2.2 compliant Web server, such as Tomcat.<br />

• Java version 1.5 or higher<br />

Contacting PCI Geomatics Support<br />

On the Web<br />

• http://www.pcigeomatics.com/services/support_center/<br />

contact_support.php<br />

Call Us<br />

• 1-877-RING-PCI (1-877-746-4724) (North America)<br />

• 905-764-0614 (Direct to our main office in Richmond Hill,<br />

Ontario, Canada)<br />

Write Us<br />

• Fax 1-905-764-9604 (Attention: Support Department)<br />

• Email a Customer Service Request to support@pcigeomatics.com<br />

• Email a Customer License Request to license@pcigeomatics.com<br />

FTP Instructions<br />

1. FTP to ftp.pcigeomatics.com<br />

2. Login: anonymous<br />

3. Password: email address<br />

4. Upload files to "/pub/incoming"<br />

5. E-mail support@pcigeomatics.com with the exact file name (note:<br />

you cannot view the content of "/pub/incoming")<br />

Please include the following information with all your<br />

correspondence with PCI Geomatics technical support:<br />

• your customer number<br />

• the type of operating system you are using<br />

• the version number of the product<br />

• a description of the problem<br />

Understanding How the Web Services<br />

Work<br />

As shown in Figure 1.1, a client is a program on a computer that is<br />

connected to a network which has access to the Web. The client<br />

sends requests for information to a server through the Web using<br />

HTTP. A server is a program that receives the request from the client<br />

and transfers the request to a servlet. The servlet is a small Java<br />

program that runs on the server. The servlet obtains the information<br />

from the data source and then sends the result back to the HTTP<br />

server, which transfers the information back to the client.<br />

8 PCI Geomatics


Understanding How the Web Services Work<br />

Figure 1.1: Understanding Web services<br />

Data<br />

Source<br />

Client<br />

Servlet<br />

HTTP Server<br />

1. The client sends a request to an<br />

HTTP server.<br />

2. The HTTP server passes the<br />

request to the servlet.<br />

3. The servlet obtains the<br />

requested file from the source<br />

and returns it to the HTTP<br />

server.<br />

4. The HTTP server sends the file<br />

back to the client.<br />

Understanding the <strong>Geomatica</strong> Web Feature Service<br />

A Web feature service provides access to features available on the<br />

Web. As described by the Open <strong>GIS</strong> Consortium (OGC), a feature<br />

is “a digital representation of a real world entity or an abstraction of<br />

the real world. It has a spatial domain, a temporal domain, or a<br />

spatial/temporal domain as one of its attributes. Examples of<br />

features include almost anything that can be placed in time and<br />

space, including . . . cities, trees, forest stands, ecosystems, . . . ". 1<br />

The Web Feature Service (WFS) available in the <strong>Geomatica</strong><br />

<strong>WebServer</strong> Suite consists of a WFS client and a WFS servlet as<br />

shown in Figure 1.2. The WFS client (1) is accessed through<br />

<strong>Geomatica</strong> Focus. Using the WFS client, you send a request to any<br />

compatible Web feature service on the Web, it returns the results of<br />

the request to the WFS client, and then the features are displayed as<br />

1. The Open Geospatial Abstract Specification Topic 6: The Coverage Type and<br />

its Subtypes Version 6 Open <strong>GIS</strong> Consortium. January 2004, http://<br />

www.opengeospatial.org/techno/abstract/00-106.pdf<br />

a layer in <strong>Geomatica</strong> Focus. With the WFS servlet (2) you can make<br />

your geospatial features available to others through the Web.<br />

Figure 1.2: How the WFS works<br />

<strong>Geomatica</strong> Focus as<br />

the WFS client<br />

Using the WFS Client<br />

A Web feature service<br />

somewhere on the Web<br />

HTTP Server<br />

A client somewhere<br />

on the Web<br />

WFS servlet<br />

Data sources containing<br />

the features that you want<br />

to publish<br />

The WFS client is accessed through the <strong>Remote</strong> Data Wizard<br />

dialog box in <strong>Geomatica</strong> Focus. To open the <strong>Remote</strong> Data Wizard<br />

dialog box, select File in the main menu, click Open, and click the<br />

<strong>Remote</strong> Data button. You do not need to configure the WFS client.<br />

For information about how to use the WFS client, refer to the<br />

<strong>Geomatica</strong> Focus User <strong>Guide</strong>.<br />

<strong>Geomatica</strong> <strong>WebServer</strong> Suite <strong>Installation</strong> <strong>Guide</strong> 9


Chapter 1 - Introduction to <strong>Geomatica</strong> <strong>WebServer</strong> Suite<br />

Understanding the <strong>Geomatica</strong> Web Coverage<br />

Service<br />

A Web coverage service provides access to coverages available on<br />

the Web. As described by the Open <strong>GIS</strong> Consortium (OGC), a<br />

coverage is “a feature that associates positions within a bounded<br />

space (its spatiotemporal domain) to feature attribute values (its<br />

range). <strong>GIS</strong> coverages (including the special case of Earth images)<br />

are two- (and sometimes higher) dimensional metaphors for<br />

phenomena found on or near a portion of the Earth's surface. A<br />

coverage can consist of a set of features . . .”. 1 Unlike a map, which<br />

is a static two-dimensional representation of geospatial data, a<br />

coverage contains intact geospatial data.<br />

The Web Coverage Service (WCS) available in the <strong>Geomatica</strong><br />

<strong>WebServer</strong> Suite consists of a WCS client and a WCS servlet as<br />

shown in Figure 1.3. The WCS client (1) is accessed through<br />

<strong>Geomatica</strong> Focus. Using the WCS client, you send a request to any<br />

compatible Web coverage service on the Web, it returns the results<br />

of the request to the WCS client, and then the coverage is displayed<br />

as a layer in the <strong>Geomatica</strong> Focus. With the WCS servlet (2) you can<br />

make your coverages available to others through the Web.<br />

Using the WCS Client<br />

The WCS client is accessed through the <strong>Remote</strong> Data Wizard<br />

dialog box in <strong>Geomatica</strong> Focus. To open the <strong>Remote</strong> Data Wizard<br />

dialog box, select File in the main menu, click Open, and click the<br />

<strong>Remote</strong> Data button. You do not need to configure the WCS client.<br />

For information, refer to the <strong>Geomatica</strong> Focus User <strong>Guide</strong>.<br />

1. The Open Geospatial Abstract Specification Topic 6: The Coverage Type and<br />

its Subtypes Version 6 Open <strong>GIS</strong> Consortium. January 2004, http://www.opengeospatial.org/techno/abstract/00-106.pdf<br />

Figure 1.3: How the WCS works<br />

<strong>Geomatica</strong> Focus as<br />

the WCS client<br />

A Web coverage service<br />

somewhere on the Web<br />

HTTP Server<br />

Data sources containing<br />

the coverages that you<br />

want to publish<br />

A client somewhere<br />

on the Web<br />

WCS servlet<br />

Understanding the <strong>Geomatica</strong> Web Mapping<br />

Service<br />

A Web mapping service provides access to maps available on the<br />

Web. As described by the Open <strong>GIS</strong> Consortium (OGC), a map is<br />

“a two-dimensional visual portrayal of geospatial data. A map is not<br />

the data itself.” 2<br />

2. Open <strong>GIS</strong> Consortium (OGC) Web site, Glossary, January 2004, http://<br />

www.opengeospatial.org/resources/?page=glossary#M<br />

10 PCI Geomatics


Understanding How the Web Services Work<br />

The Web Mapping Service (WMS) available in the <strong>Geomatica</strong><br />

<strong>WebServer</strong> Suite consists of two WMS clients and a WMS servlet as<br />

shown in Figure 1.4. One of the WMS clients is accessed through<br />

<strong>Geomatica</strong> Focus, and the other is the combination of an applet and<br />

a browser.<br />

Through the WMS client (1) in <strong>Geomatica</strong> Focus, you send a request<br />

to any compatible Web mapping service on the Web, it returns the<br />

results of the request to the WMS client, and then the map is<br />

displayed as a layer in <strong>Geomatica</strong> Focus.<br />

With the WMS servlet (2) you can make your maps available to<br />

others through the Web. Instead of placing your maps in a folder,<br />

you create a shortcut to your project which serves the maps to the<br />

servlet.<br />

The other WMS client (3), the applet and browser, displays your map<br />

project in a Web page. You can use one of the Web page templates<br />

provided in <strong>Geomatica</strong> <strong>WebServer</strong> Suite or build your own.<br />

Using the WMS Clients<br />

The WMS client in <strong>Geomatica</strong> Focus is accessed through the<br />

<strong>Remote</strong> Data Wizard dialog box. To open the <strong>Remote</strong> Data<br />

Wizard dialog box, select File in the main menu, click Open, and<br />

click the <strong>Remote</strong> Data button. You do not need to configure<br />

<strong>Geomatica</strong> Focus’s WMS client. For information about how to use<br />

it, refer to the <strong>Geomatica</strong> Focus User <strong>Guide</strong>.<br />

If you want to publish your maps on a Web page, see “Publishing<br />

Your Maps on the WMS Servlet or a Web Page” on page 49.<br />

Figure 1.4: How the WMS works<br />

<strong>Geomatica</strong> Focus as<br />

the WMS client<br />

The applet and<br />

browser client<br />

displaying the map<br />

project in a Web page<br />

HTTP Server<br />

WMS servlet<br />

<strong>Geomatica</strong> Focus in server mode<br />

containing the maps that you<br />

want to publish<br />

A Web mapping service<br />

somewhere on the Web<br />

A client somewhere<br />

on the Web<br />

HTTP Server<br />

WMS servlet<br />

<strong>Geomatica</strong> Focus<br />

in server mode<br />

containing the<br />

maps that you<br />

want to publish<br />

<strong>Geomatica</strong> <strong>WebServer</strong> Suite <strong>Installation</strong> <strong>Guide</strong> 11


Chapter 1 - Introduction to <strong>Geomatica</strong> <strong>WebServer</strong> Suite<br />

12 PCI Geomatics


Installing the Servlets<br />

Installing <strong>Geomatica</strong><br />

To install <strong>Geomatica</strong>, follow the installation instructions in the<br />

Installing PCI Geomatics Software guide.<br />

After you install <strong>Geomatica</strong>, you must set the Path environment<br />

variable for <strong>Geomatica</strong>:<br />

To set the Path environment variable for <strong>Geomatica</strong>:<br />

1. Right-click My Computer and click Properties.<br />

2. Click the Advanced tab.<br />

3. Click Environment Variables.<br />

4. Under System Variables, click Path and click Edit.<br />

5. In the Variable Value box, add the path of the <strong>Geomatica</strong> exe<br />

folder to the end of the existing data.<br />

For example, %SystemRoot%\system32;%SystemRoot%;<br />

%SystemRoot%\System32\Wbem;C:\Program Files\Common<br />

Files\Adaptec Shared\System;c:\Program Files\PCI<br />

Geomatics\<strong>Geomatica</strong>_V101\exe.<br />

6. Click OK.<br />

C HAPTER<br />

2<br />

Installing the HTTP Server and Servlets<br />

Several Web server technologies support servlets, such as iPlanet<br />

Web Server, W3C Jigsaw, Tomcat from Apache, JRun from<br />

Macromedia, ServletExec® from New Atlanta Communications,<br />

and Resin® from Caucho Technology.<br />

Note<br />

We recommend the Tomcat Server 5.5 from Apache Software<br />

Foundation as your HTTP server. This manual assumes that you do not<br />

have an HTTP server installed and uses the Tomcat server as an<br />

example. If you are using another server technology, please refer to that<br />

server’s installation instructions for guidance.<br />

13


Chapter 2 - Installing the Servlets<br />

The following steps are required to install the server and<br />

servlets:<br />

1. Install the Java Developer’s Kit :<br />

See “Installing the Java SE Development Kit on a Windows<br />

System” on page 14.<br />

2. Install the Tomcat Server 5.5:<br />

See “Installing the Tomcat Server on a Windows System” on<br />

page 14.<br />

3. Start the Tomcat server 5.5:<br />

See “Testing the Tomcat Server” on page 15.<br />

4. Installing the .jar files:<br />

See “Installing .JAR Files” on page 16.<br />

5. Install the .war file(s):<br />

See “Installing .WAR Files” on page 16.<br />

Installing the Java SE Development Kit on a<br />

Windows System<br />

Because servlets are based on JavaTM technology, you must install<br />

the Java SE Development Kit Standard Edition (JDK) 5.0 or greater<br />

on your HTTP server.<br />

Note<br />

The WCS will not run on versions earlier than 5.0.<br />

To install JDK:<br />

1. Open a Web browser, and enter http://java.sun.com/j2se/1.5/ in the<br />

address bar.<br />

2. Click the Download J2SE 5.0 link.<br />

3. Click the Download button corresponding to JDK 5.0 or higher.<br />

Example: JDK 5.0 Update 12<br />

4. On the Download screen, follow the instructions in the license<br />

agreement section.<br />

5. Scroll down and click the required link.<br />

6. Save the file in a preferred location.<br />

7. Click Close on the Download Complete window.<br />

8. Double-click the saved file and follow the on-screen instructions to<br />

install JDK 5.0.<br />

To set the environment variable for JAVA_HOME:<br />

1. Right-click My Computer and click Properties.<br />

2. Click the Advanced tab.<br />

3. Click Environment Variables.<br />

4. Under User Variables or System Variables, click New.<br />

5. In the Variable Name box, type JAVA_HOME.<br />

6. In the Variable Value box, type the path for the J2SE folder.<br />

Example: C:\jdk-1_5_0_12<br />

7. Click OK.<br />

Installing the Tomcat Server on a Windows System<br />

Once the J2SE is installed on the HTTP server, install the Tomcat<br />

server. If you are using a server technology other than Tomcat,<br />

please refer to its installation manual.<br />

14 PCI Geomatics


Installing the HTTP Server and Servlets<br />

To install Tomcat:<br />

1. Download the current version of Tomcat from http://<br />

jakarta.apache.org/tomcat/. On the Apache Jakarta Project Web page<br />

under Download, click Tomcat 5.x.<br />

2. Under 5.5.xx, click Windows Service Installer.<br />

3. Save the file in a preferred location.<br />

4. Click Close on the Download Complete window.<br />

5. Double-click the saved file and follow the on-screen instructions to<br />

install Tomcat.<br />

Testing the Tomcat Server<br />

When Tomcat is installed, start the Tomcat server and verify that it<br />

is running properly. You can start Tomcat from the command<br />

prompt, if you downloaded a zip or from the Apache Tomcat<br />

Properties window, if you installed Tomcat using the Windows<br />

Service Installer.<br />

To start Tomcat from the command prompt:<br />

1. Open the command prompt.<br />

2. Type the path to the folder where you installed Tomcat.<br />

Example: C:\>cd Program Files\Apache\Tomcat 5.5\bin<br />

3. Press Enter.<br />

4. Type startup.<br />

Example: C:\Program Files\Apache\Tomcat 5.5\bin>startup<br />

To start Tomcat from Apache Tomcat<br />

1. In Windows, click Start > Programs and click Apache Tomcat 5.5.<br />

2. Select Configure Tomcat.<br />

3. On the General tab of the Apache Tomcat Properties window,<br />

click Start.<br />

To verify that Tomcat is running properly:<br />

1. Type the following in the address bar of your browser:<br />

http://[localhost]:[port]<br />

Replace [localhost] by the name of the computer or IP address<br />

where Tomcat is installed. Replace [port] by the number of the<br />

listening port for Tomcat.<br />

2. View the Tomcat HTML page, which should appear similar to Figure<br />

2.1. If Tomcat fails to respond, verify the records in the logs folder,<br />

which is in the folder where you installed Tomcat.<br />

Figure 2.1: Tomcat HTML page<br />

<strong>Geomatica</strong> <strong>WebServer</strong> Suite <strong>Installation</strong> <strong>Guide</strong> 15


Chapter 2 - Installing the Servlets<br />

Tip<br />

Tomcat uses port 8080 by default, however, the standard HTTP port is<br />

80. To change the HTTP port to 80, change the parameter in the<br />

server.xml file in the conf folder, which is in the folder where you installed<br />

Tomcat. If you do change the HTTP port, you will no longer need to type<br />

the port number when you type the address in the browser.<br />

Installing .JAR Files<br />

The Java Archive (.jar) files contain the class files and auxiliary<br />

resources for the Web Feature Service.<br />

To install the .jar files:<br />

1. Copy the easi.jar, featurequery.jar, ntvcore.jar, and gdbwrapper.jar<br />

files located in \GWS\shared-jars where you installed <strong>Geomatica</strong>.<br />

2. Paste the .jar files in the \shared\lib folder of your Tomcat<br />

installation.<br />

Installing Oracle® .JAR Files<br />

Oracle .jar files are required if you want to publish Oracle data on<br />

the WCS server. You must first install and set up the Oracle client,<br />

and then transfer the Oracle .jar files to the folder where you<br />

installed Tomcat.<br />

To install Oracle .JAR files:<br />

1. Copy the ojdbc14.jar or classes12.jar located in<br />

\product\$version\client_1\jdbc\lib of your Oracle installation.<br />

2. Paste the .jar file in \shared\lib of your Tomcat installation.<br />

Installing .WAR Files<br />

The Web Archive (.war) files contain the files and configuration<br />

information required for the <strong>Geomatica</strong> <strong>WebServer</strong> Suite of<br />

products. Follow the instructions for installing the .war file for each<br />

Web service licensed to you.<br />

The .war file for:<br />

• The Web Feature Service (WFS) is called wfs.war.<br />

• The Web Coverage Service (WCS) is called wcs.war.<br />

• The Web Mapping Service (WMS) is called wms.war.<br />

To install the .war file:<br />

1. Copy the required .war file(s), which are located in the gws folder of<br />

your <strong>Geomatica</strong> installation.<br />

2. Paste the .war file(s) in the webapps folder of your Tomcat<br />

installation.<br />

3. Start the Tomcat server. If Tomcat is already running, stop and then<br />

restart it (see “Stopping and Restarting Tomcat” on page 18).<br />

When Tomcat starts, it automatically extracts the files from the<br />

.war file and creates its own folder structure.<br />

Exploring the WCS Folder<br />

Once the wcs.war file is copied to the folder where you installed<br />

Tomcat, it contains all of the files that you need for the WCS servlet.<br />

In \webapps\wcs you will find:<br />

images folder: This folder contains the logo of the HTML page used<br />

for testing the WCS servlet (see “Testing the WCS Servlet” on<br />

page 34).<br />

META-INF folder: This folder contains the manifest file, which is<br />

a system file for Web applications and used to define the extension<br />

and package data of the .war file.<br />

16 PCI Geomatics


Exploring the WFS Folder<br />

schemas folder: This folder contains the OGC-compliant WCS<br />

schemas in XSD format.<br />

WEB-INF folder: This folder contains:<br />

• The config folder: This folder contains the files that help you<br />

configure your WCS server and the system folder that contains cache<br />

management files (see “Exploring the config.xml for the WCS” on<br />

page 31).<br />

• The data folder: This folder contains sample files that you can use to<br />

test and demonstrate the WCS. It can also hold files that you want to<br />

publish through the WCS servlet.<br />

• The lib folder: This folder holds a collection of routines used to run<br />

the WCS servlet.<br />

• The plugins folder: This folder contains the Open Services Gateway<br />

initiative (OSGI) bundles that are part of the WCS implementation.<br />

•The web.xml file: This file is the initialization file for the servlet.<br />

Exploring the WFS Folder<br />

Once the wfs.war file is copied to the folder where you installed<br />

Tomcat, it contains all the files that you need for the WFS servlet. In<br />

\webapps\wfs, you will find:<br />

The conf folder: This folder contains:<br />

• The wfs_init.properties file, which contains a list of parameters<br />

that you can use to customize the WFS servlet (see “Setting the<br />

Initialization Properties” on page 23).<br />

• The wfs_data_sources.xml file, which contains a list of files and<br />

folders that are published on the WFS servlet (see “Exploring the<br />

Data Source Configuration File” on page 27).<br />

demo folder: This folder contains sample files that you can use to<br />

demonstrate the WFS. It can also hold the files that you want to<br />

publish through the WFS servlet.<br />

images folder: This folder contains logos and images for the HTML<br />

page used for testing the WFS servlet (see “Testing the WFS<br />

Servlet” on page 26).<br />

META-INF folder: This folder contains the manifest file used to<br />

define the extension and package data of the .war file.<br />

WEB-INF folder: This folder contains:<br />

•The classes folder, which contains the class files needed to run the<br />

WFS servlet. A servlet is a Java program that runs on a server and<br />

enables WFS servlet to respond to requests quickly and effectively.<br />

•The Lib folder, which holds a collection of routines used to run the<br />

WFS servlet.<br />

•The web.xml file, which is the initialization file for the servlet.<br />

Exploring the WMS Folder<br />

Once the wms.war file is copied to the folder where you installed<br />

Tomcat, it contains all the files that you need for the WMS servlet.<br />

In \webapps\wms you will find:<br />

Application folder: This folder contains the SelectLayer.xslt file<br />

that determines the format for the applet’s configuration page. It<br />

should not be modified.<br />

Config folder: This folder contains the configuration files for the<br />

applet. AllProject.xml configures the applet in<br />

MapViewerTemplate1.html. Layers.xml configures the applets in<br />

the remaining MapViewerTemplates.<br />

DTD folder: This folder contains the Document Type Definition<br />

(DTD) files. A DTD is a document that includes formal definitions<br />

of all the data elements for the <strong>Geomatica</strong> Web Mapping Service<br />

documents. By consulting the DTD, an XML parser can work with<br />

the markup codes used by WMS documents and validate the syntax<br />

of your configuration files.<br />

<strong>Geomatica</strong> <strong>WebServer</strong> Suite <strong>Installation</strong> <strong>Guide</strong> 17


Chapter 2 - Installing the Servlets<br />

help folder: This folder contains the help and demo files for the<br />

WMS client that forms a Web page (see “Introducing the Templates”<br />

on page 51).<br />

images folder: This folder contains the library of logos, icons, and<br />

graphics for the Readme and MapViewerTemplate HTML files.<br />

JavaScript folder: This folder contains the JavaScript files that are<br />

used with your HTML files when you are publishing your project in<br />

a Web page. JavaScript adds simple online applications and<br />

functions to your Web page (see “Making Your Own Web Page” on<br />

page 54). Web browsers compatible with JavaScript, such as<br />

Netscape Navigator or Internet Explorer, are required to run<br />

JavaScript code.<br />

META-INF folder: This folder contains the manifest file used to<br />

define the extension and package data of the .war file.<br />

WEB-INF folder: This folder contains:<br />

•The classes folder, which contains the WMSServlet.class,<br />

EasiServlet.class, and AppletConfigServlet.class files. A servlet is a<br />

Java program that runs on a server and enables WMS servlet to<br />

respond to requests quickly and effectively.<br />

•The Lib folder, which holds a collection of routines used to run the<br />

WMS servlet.<br />

•The web.xml file, which contains a list of parameters that you can<br />

use to customize the WMS servlet (see “Changing the Function”<br />

on page 41).<br />

XSLT: This folder contains the Extensible Stylesheet Language for<br />

Transformation (XSLT) files. The XSLT.xslt file determines the<br />

format for the results of the queries that you perform in your Web<br />

page.<br />

MapViewer.jar: This file contains the applet for the WMS client.<br />

An applet is a program that is automatically downloaded over the<br />

Web and run on the recipient's computer. The applet is written in the<br />

Java programming language and runs within the browser software. It<br />

is used to display the map in your Web page.<br />

MapViewerTemplate.html: These HTML files are examples of<br />

Web pages that you can create with <strong>Geomatica</strong> Web Mapping<br />

Service.<br />

Stopping and Restarting Tomcat<br />

You can stop and restart Tomcat through the command prompt or the<br />

Apache Tomcat Properties window.<br />

If you are using the Web Mapping Service (WMS), you can also stop<br />

and restart Tomcat remotely, see “Resetting the Servlet from a<br />

<strong>Remote</strong> Location” on page 43.<br />

To stop and restart Tomcat from the command prompt:<br />

1. In the command prompt, where you started Tomcat, type Ctrl+C or<br />

Ctrl+Break to stop Tomcat.<br />

2. Then type startup to restart Tomcat.<br />

Example: C:\Program Files\Apache\Tomcat 5.5\bin>startup<br />

To stop and restart Tomcat from Apache Tomcat<br />

1. In Windows, click Start > Programs > Apache Tomcat 5.5.<br />

2. Select Configure Tomcat.<br />

3. On the General tab of the Apache Tomcat Properties window,<br />

click Stop and then Start.<br />

Troubleshooting Low Memory Error in<br />

Tomcat<br />

In some cases the demands on the servlets exceed the default<br />

memory allocation of Java. The result is a low memory error. You<br />

18 PCI Geomatics


Troubleshooting Low Memory Error in Tomcat<br />

can adjust the allocated memory size through one of the following<br />

methods:<br />

1. Increase the memory size from the Windows command prompt.<br />

2. Increase the memory size in Apache Tomcat.<br />

Determining the memory size to set is an educated guess. You should<br />

take into consideration the size of the data, the number of channels,<br />

and the image type that may be requested, as well as the overhead<br />

being used. Doubling the default amount is recommended as long as<br />

it is smaller than the physical RAM installed on the computer.<br />

To increase the memory size from the Windows command<br />

prompt:<br />

1. Open the command prompt.<br />

2. Type the path to the folder where you installed Tomcat.<br />

3. Press Enter.<br />

4. Then type the following:<br />

startup //TS//Tomcat5 --JvmMx=[size]<br />

Replace [size] with the amount of memory you want to allocate.<br />

For example, if you want to change the size to 512 MB, you can<br />

type JvmMx=512.<br />

To increase the memory size in Apache Tomcat<br />

1. In Windows, click Start > Programs > Apache Tomcat 5.5.<br />

2. Select Configure Tomcat.<br />

3. On the Apache Tomcat Properties window, click the Java tab.<br />

4. Enter a number in the Maximum memory pool.<br />

Example: 512<br />

<strong>Geomatica</strong> <strong>WebServer</strong> Suite <strong>Installation</strong> <strong>Guide</strong> 19


Chapter 2 - Installing the Servlets<br />

20 PCI Geomatics


C HAPTER<br />

3<br />

Configuring the Servlet for the Web Feature Service (WFS)<br />

Configuring the WFS Servlet<br />

The deployment descriptor for the HTTP server is the web.xml file<br />

found in \webapps\wfs\WEB-INF in the folder where you installed<br />

Tomcat. The web.xml file declares the locations of the WFS servlet, its<br />

Java classes, and its configuration file.<br />

The WFS servlet directly accesses <strong>Geomatica</strong> Focus executable<br />

routines when retrieving the data as shown in Figure 3.1. Therefore,<br />

WFS servlet and <strong>Geomatica</strong> Focus must reside on the same computer<br />

or be made directly accessible through the network using the<br />

environment variables.<br />

The initialization file for the WFS servlet is the wfs_init.properties<br />

file found in \webapps\wfs\conf in the folder where you installed<br />

Tomcat. It contains the initialization parameters that control the<br />

servlet. All the parameters must contain values. Each time you<br />

change the parameters, restart Tomcat to unload the servlet from<br />

memory.<br />

Figure 3.1: Understanding the WFS Servlet<br />

HTTP server<br />

WFS servlet<br />

Servlet accesses <strong>Geomatica</strong><br />

Focus executable routines<br />

Folders containing<br />

feature data files<br />

21


Chapter 3 - Configuring the Servlet for the Web Feature Service (WFS)<br />

Exploring the Web.xml for the WFS<br />

Using an example is the best way to understand the configuration<br />

files. The web.xml for the WFS is found in \webapps\wfs\WEB-INF<br />

in the folder where you installed Tomcat. It communicates to the HTTP<br />

server the WFS servlet’s name, its location, and the location of its<br />

configuration file called wfs_init.properties.<br />

<br />

<br />

<br />

PCI WFS (Web Feature Server) Servlet<br />

<br />

<br />

<br />

WFSServlet<br />

<br />

<br />

com.pcigeomatics.servlets.wfs.WFSServlet<br />

<br />

<br />

<br />

properties.filename<br />

<br />

<br />

/conf/wfs_init.properties<br />

<br />

<br />

<br />

<br />

<br />

WFSServlet<br />

/wfs/*<br />

<br />

<br />

The first line in the web.xml file indicates that the document is based<br />

on XML version 1.0 and the encoding is ISO-8859-1, which is the<br />

character encoding commonly used in North and South America,<br />

Western Europe, Australia, and most of Africa.<br />

<br />

The DOCTYPE declaration states that the file is an XML document,<br />

and includes the DTD published by Sun Microsystems, Inc. that<br />

validates the web.xml:<br />

<br />

The “web-app” element is the root element of the XML file, which<br />

contains all the other elements in the web.xml file.<br />

<br />

. . .<br />

<br />

The “display-name” element determines the name that will appear<br />

on the GUI tools and server configuration tools.<br />

<br />

PCI WFS (Web Feature Server) Servlet<br />

<br />

The “servlet” element contains the elements used to identify the<br />

servlet. The “servlet-name” element declares the name of the servlet<br />

used with the WFS. The “servlet-class” element declares the relative<br />

path and filename of the servlet, which is in \webapps\wfs\WEB-<br />

INF\classes\com\pcigeomatics\servlets\wfs in the folder where you<br />

installed Tomcat.<br />

<br />

WFSServlet<br />

<br />

<br />

com.pcigeomatics.servlets.wfs.WFSServlet<br />

<br />

22 PCI Geomatics


Configuring the WFS Servlet<br />

The “init-param” element contains the name/value pair initialization<br />

parameters for the WFS servlet. The “param-name” element declares<br />

the name of the parameter. The “param-value” element declares the<br />

value of the parameter. It provides the location of the configuration<br />

file for the servlet, which is the wfs_init.properties file in<br />

\webapps\wfs\conf in the folder where you installed Tomcat.<br />

<br />

<br />

properties.filename<br />

<br />

<br />

/conf/wfs_init.properties<br />

<br />

<br />

The “servlet-mapping” element contains the name/value pair that<br />

controls how you access a servlet through the Web. The “servletname”<br />

element declares the name of the servlet, which corresponds<br />

to the name declared in the “servlet” element. The “url-pattern”<br />

element declares the relative path of the URL after http://host:port/<br />

war filename.<br />

<br />

WFSServlet<br />

/wfs/*<br />

<br />

Setting the Initialization Properties<br />

The initialization properties are a list of parameters that you can use<br />

to change how the WFS servlet functions or to determine the values<br />

returned by the Capabilities file. The file containing the initialization<br />

properties for the WFS, the wfs_init.properties file, is found in<br />

\webapps\wfs\conf in the folder where you installed Tomcat.<br />

The only property that MUST be set is the<br />

wfs.capabilities.service.online.resource, which is described on<br />

page 25.<br />

To change the defaults:<br />

1. Delete the pound sign (#) in front of the property that you want to<br />

change.<br />

2. Select the value and type the new value.<br />

3. Save the file.<br />

4. Restart Tomcat to unload the servlet from memory.<br />

Table 1 contains the configuration and initialization properties for<br />

the WFS servlet.<br />

Table 1: Properties for Configuration and Initialization<br />

Property Description and Default Values<br />

wfs.data.sources.<br />

filename<br />

The wfs.data.sources.filename property<br />

declares the name of the file that lists the<br />

files and layers (data sources) that can<br />

be published on your WFS servlet. You<br />

can set the value to a relative or absolute<br />

path.<br />

By default the value is set to conf/<br />

wfs_data_sources.xml in the folder<br />

where you installed Tomcat.<br />

<strong>Geomatica</strong> <strong>WebServer</strong> Suite <strong>Installation</strong> <strong>Guide</strong> 23


Chapter 3 - Configuring the Servlet for the Web Feature Service (WFS)<br />

Table 1: Properties for Configuration and Initialization<br />

Property Description and Default Values<br />

wfs.matching.<br />

layer.name.action<br />

wfs.invalid.characters.<br />

action<br />

The<br />

wfs.share.matching.layer.name.action<br />

determines the result when the WFS<br />

servlet detects identically named layers<br />

in the data sources. When the servlet<br />

detects duplicate names, the options are:<br />

exception: It produces an error<br />

message.<br />

ignore: It publishes the first layer and<br />

ignores the remaining layers with<br />

identical names.<br />

mangle: It appends sequential numbers<br />

to duplicate names starting with number<br />

1.<br />

The default is mangle.<br />

The wfs.invalid.characters.action<br />

property determines the result when the<br />

servlet encounters a name that contains<br />

characters that are incompatible with<br />

GML such as spaces, tabs, and<br />

punctuation marks. When the servlet<br />

detects an incompatibility, the options<br />

are:<br />

exception: It produces an error message<br />

and prevents the servlet from starting.<br />

This option is useful to identify names<br />

that do not follow the GML naming<br />

convention.<br />

ignore: It creates GML with XML tag<br />

names and attributes that are not valid<br />

nor well formed.<br />

mangle: It converts the name into one<br />

that is compatible with GML.<br />

The default is mangle.<br />

Table 1: Properties for Configuration and Initialization<br />

Property Description and Default Values<br />

wfs.bad.file.action<br />

wfs.transaction.allow<br />

The wfs.bad.file.action property<br />

determines the result when the servlet<br />

encounters a file that cannot be read<br />

such as when the file is corrupted or uses<br />

a file format that is not compatible with<br />

<strong>Geomatica</strong>.<br />

exception: It produces an error message<br />

and prevents the servlet from starting. If<br />

a user tries to access this WFS via an<br />

HTTP request, the server produces an<br />

exception message stating that an<br />

unusable file was detected.<br />

ignore: The unusable file is not<br />

published.<br />

The default is ignore.<br />

The wfs.transaction.allow property<br />

defines the read/write property of the<br />

publishable files on the WFS servlet. The<br />

files remain read-only in the <strong>Geomatica</strong><br />

WFS client even if this property is set to<br />

“true”.<br />

false: files are read-only<br />

true: files are read/write enabled<br />

The default is false.<br />

24 PCI Geomatics


Configuring the WFS Servlet<br />

Table 1: Properties for Configuration and Initialization<br />

Property Description and Default Values<br />

wfs.transaction.timeout<br />

The wfs.transaction.timeout property<br />

determines the number of seconds<br />

before a time-out error occurs. A time-out<br />

results when a request is blocked due to<br />

another transaction being processed by<br />

the servlet. A transaction blocks all<br />

others from access to the servlet until its<br />

process terminates. A time-out error<br />

results if the blocked request is unable to<br />

access the servlet before time expires.<br />

The default is 120.<br />

Since <strong>Geomatica</strong> Web Feature Service (WFS) is compliant with the<br />

Open Geospatial Web Feature Service Implementation<br />

Specification, it can respond to the Get Capabilities request. Table 2<br />

contains the properties that you can use to describe the capabilities<br />

available on the WFS servlet. These properties should be changed to<br />

reflect your service.<br />

Table 2: Properties for Get Capabilities<br />

Property Description and Default Values<br />

wfs.capabilities.service<br />

.online.resource<br />

wfs.capabilities.service<br />

.name<br />

wfs.capabilities.service<br />

.title<br />

wfs.capabilities.service<br />

.abstract<br />

The<br />

wfs.capabilities.service.online.resource<br />

property declares the value for the<br />

“OnlineResource” element that appears<br />

in the Capabilities document returned by<br />

the WFS. It contains a URL that provides<br />

more description about the WFS servlet.<br />

If you installed the servlet using the<br />

defaults, replace “localhost” by the name<br />

of the computer or IP address where<br />

Tomcat is installed. If you changed the<br />

directory structure or port number, make<br />

sure the value points to the correct path<br />

for your installation.<br />

The default is http://localhost:8080/wfs/<br />

wfs.<br />

The wfs.capabilities.service.name<br />

property declares the official name of the<br />

servlet as it will appear in the Capabilities<br />

document returned by the WFS.<br />

The default is WFS.<br />

The wfs.capabilities.service.title property<br />

declares the value for the “service-title”<br />

element that appears in the Capabilities<br />

document returned by the WFS.<br />

The default is Web Feature Service.<br />

The wfs.capabilities.service.abstract<br />

property declares the “service-abstract”<br />

element that appears in the Capabilities<br />

document returned by the WFS.<br />

The default is Web Feature Service<br />

implemented by PCI Geomatics Inc.<br />

<strong>Geomatica</strong> <strong>WebServer</strong> Suite <strong>Installation</strong> <strong>Guide</strong> 25


Chapter 3 - Configuring the Servlet for the Web Feature Service (WFS)<br />

Table 3 contains the properties used to define the namespace for the<br />

WFS servlet. A namespace is used to differentiate your WFS servlet<br />

from others on the Web.<br />

Table 3: Properties for XML Schema Namespaces<br />

Property Description and Default Values<br />

wfs.application.schema<br />

.namespace.prefix<br />

wfs.application.schema<br />

.namespace.url<br />

Testing the WFS Servlet<br />

You can test the installation before you begin adding your own data<br />

after you have:<br />

• Copied the wfs.war file to the folder where you installed Tomcat.<br />

• Started Tomcat.<br />

• Set the wfs.capabilities.service.online.resource property.<br />

To test if the WFS servlet was installed properly, you can use the<br />

following Web page, which is designed to run with the demo files<br />

called wfs_california.pix and wfs_irvine.pix.<br />

To test the WFS servlet:<br />

1. Start the Tomcat server.<br />

The wfs.application.schema.namespace.<br />

prefix property declares the value used to<br />

denote the namespace of the WFS<br />

servlet.<br />

The default value is: pci<br />

The<br />

wfs.application.schema.namespace.url<br />

property declares the URI of the<br />

namespace for the WFS servlet.<br />

The default value is pci:wfsapplication-schema.<br />

2. Open a browser window and type the following address:<br />

http://[hostname]:8080/wfs/index.html<br />

Replace [localhost] by the name of the computer or IP address<br />

where Tomcat is installed.<br />

3. Click the links under Request. These requests should return xml<br />

documents describing the files in the demo folder.<br />

If an error occurs, it can mean that:<br />

• The environment variable for <strong>Geomatica</strong> is not set properly (see<br />

“Installing <strong>Geomatica</strong>” on page 13).<br />

• The environment variable for JAVA_HOME is not set properly (see<br />

“Installing the Java SE Development Kit on a Windows System” on<br />

page 14).<br />

• The .war file is missing (see “Installing .WAR Files” on page 16).<br />

• The .jar files are missing (see “Installing .JAR Files” on page 16).<br />

• Tomcat is not running (see “Exploring the WCS Folder” on page 16).<br />

• The wfs.capabilities.service.online.resource property is not set<br />

properly (see “Setting the Initialization Properties” on page 23).<br />

Publishing Your Data on the WFS<br />

Servlet<br />

After you have installed and configured the WFS servlet, you can<br />

make your geospatial features available to others through the Web.<br />

To add your data to the WFS, you can simply paste your vector files<br />

into the demo folder in \webapps\wfs where Tomcat is installed. By<br />

default the WFS is configured to publish the data stored in the demo<br />

folder.<br />

The WFS can publish georeferenced vector (feature) data with<br />

attributes, except topological layers, in the following formats<br />

supported by PCI Geomatics’s Generic Database (GDB)<br />

Technology: PIX, DXF, DVC, SPC, SPL, SQD, DGN, DWG, IFF,<br />

VEH, E00, NTX, vtx, DBF, SHP, TBA, txt, HDR, MIF, PLT, NET,<br />

OBJ, GIA, GTE, mpp, mps, grf, mpa, tbt, tbb, NTF, DDF, TAB, VQ,<br />

MDB, XLS, lvc, , DVOF, DVD, CGM, LOL, adf, GML, wth, out,<br />

26 PCI Geomatics


Publishing Your Data on the WFS Servlet<br />

and las. For more information about GDB, see http://<br />

www.pcigeomatics.com/products/gdb.html#gdb_info.<br />

If you want to configure the WFS to serve data from other data<br />

sources, you can edit the data source configuration file to add<br />

relative or absolute paths to specific files or entire folders. For more<br />

information, see “Modifying the Data Source Configuration File” on<br />

page 27.<br />

You can edit the data source configuration file or you can create your<br />

own. If you create you own file, you must declare it as the<br />

wfs.data.sources.filename property in the wfs_init.properties file<br />

(see “Setting the Initialization Properties” on page 23).<br />

Exploring the Data Source Configuration File<br />

Using an example is the best way to understand the configuration<br />

file. The default data source configuration file for the WFS, the<br />

wfs_data_sources.xml file, is found in \webapps\wfs\conf where you<br />

installed Tomcat:<br />

<br />

<br />

<br />

demo<br />

<br />

<br />

The first line in the example indicates that the document is based on<br />

XML version 1.0 and the encoding is UTF-8:<br />

<br />

The “Sources” element is the root element of the XML file, which<br />

contains all the other elements in the wfs_data_sources.xml file.<br />

<br />

The “Source” element identifies the type and location of the data<br />

source. If you have the data saved in several places, each place must<br />

be identified in a separate “Source” element. The “Source” element<br />

has a “base” attribute, which indicates that the data source is a file or<br />

a folder.<br />

<br />

demo<br />

<br />

The “Filter” element is used with the “base” attribute. It identifies<br />

the files that you will make available on the servlet. The “Filter”<br />

element always uses the “type” attribute and it is always set to “file”.<br />

By default the “Filter” element is set to “demo”, which is a relative<br />

path to the demo folder in \webapps\wfs in the folder where Tomcat<br />

is installed.<br />

Modifying the Data Source Configuration File<br />

By default the WFS is configured to publish all the data stored in the<br />

demo folder. If you want to configure the WFS to serve data from<br />

other data sources, you can edit the data source configuration file to<br />

add relative or absolute paths to specific files or entire folders.<br />

The data source configuration file is called wfs_data_sources.xml,<br />

and it is in \webapps\wfs\conf where Tomcat is installed. All of the<br />

different data sources can be included in one data source<br />

<strong>Geomatica</strong> <strong>WebServer</strong> Suite <strong>Installation</strong> <strong>Guide</strong> 27


Chapter 3 - Configuring the Servlet for the Web Feature Service (WFS)<br />

configuration file. You identify each source of data by stating its<br />

location and format using a “Source” element.<br />

The following is an example of a wfs_data_sources.xml file<br />

containing the various methods for adding data sources to the WFS:<br />

<br />

<br />

<br />

demo<br />

<br />

<br />

<br />

<br />

*.pix<br />

*.tif<br />

<br />

<br />

The first data source declared in the file is:<br />

<br />

demo<br />

<br />

When the “Source” element does not contain an attribute, it defaults<br />

to the “base” attribute with a relative path to \webapps\wfs in the<br />

folder where Tomcat is installed. The “Filter” element is used only<br />

with the “base” attribute. It identifies the files that you will make<br />

available on the WFS. The “Filter” element always uses the “type”<br />

attribute and it is always set to “file”. In the example, the “Filter”<br />

element is set to “demo”, which indicates the demo folder in<br />

\webapps\wfs in the folder where Tomcat is installed.<br />

You can add an absolute path to another folder. In the following<br />

example, you use the “base” attribute to indicate the path to a folder<br />

named demo1. Using this method, all the files in the demo1 folder<br />

are made available on the WFS.<br />

<br />

<br />

You can limit which files are available on the WFS by using the<br />

“Filter” element. You can use the “Filter” element several times<br />

within one “Source” element. In the following example, only the<br />

PCIDSK files (.pix) and TIFF files (.tif) are made available on the<br />

WFS.<br />

<br />

*.pix<br />

*.tif<br />

<br />

WFS Troubleshooting Checklist<br />

If the WFS is not functioning properly, one of the settings or<br />

parameters may be set incorrectly. To troubleshoot the installation<br />

and configuration, double-check using the following list:<br />

Step Check<br />

1. Install <strong>Geomatica</strong>.<br />

See “Installing <strong>Geomatica</strong>” on page 13<br />

1. Set the Path environment variable for <strong>Geomatica</strong>.<br />

See “Installing <strong>Geomatica</strong>” on page 13<br />

2. Install the Java Developer’s Kit and set the environment<br />

variable for JAVA_HOME.<br />

See “Installing the Java SE Development Kit on a<br />

Windows System” on page 14.<br />

28 PCI Geomatics


WFS Troubleshooting Checklist<br />

Step Check<br />

3. Install the Tomcat Server.<br />

See “Installing the Tomcat Server on a Windows<br />

System” on page 14.<br />

4. Copy the .jar files from \gws\shared-jars where you<br />

installed <strong>Geomatica</strong> and paste it in \shared\lib where you<br />

installed Tomcat.<br />

See “Installing .JAR Files” on page 16.<br />

5. Copy the wfs.war file from the gws folder where you<br />

installed <strong>Geomatica</strong> and paste it in the webapps folder<br />

where you installed Tomcat.<br />

See “Installing .WAR Files” on page 16.<br />

6. Start the Tomcat server.<br />

See “Exploring the WCS Folder” on page 16.<br />

7. Set the wfs.capabilities.service.online.resource property in<br />

the wfs_init.properties file found in \webapps\wfs\conf in<br />

the folder where you installed Tomcat.<br />

See “Setting the Initialization Properties” on page 23.<br />

8. Place your files into the demo folder in \webapps\wfs or<br />

modify the wfs_data_sources.xml in \webapps\wfs\conf.<br />

Both are found in the folder where Tomcat is installed.<br />

See “Modifying the Data Source Configuration File” on<br />

page 27.<br />

9. Stop and restart the Tomcat server.<br />

See “Exploring the WCS Folder” on page 16.<br />

<strong>Geomatica</strong> <strong>WebServer</strong> Suite <strong>Installation</strong> <strong>Guide</strong> 29


Chapter 3 - Configuring the Servlet for the Web Feature Service (WFS)<br />

30 PCI Geomatics


C HAPTER<br />

4<br />

Configuring the Servlet for the Web Coverage Service (WCS)<br />

Configuring the WCS Servlet<br />

The WCS servlet directly accesses your <strong>Geomatica</strong> installation when<br />

retrieving the data as shown in Figure 4.1. Therefore, the HTTP<br />

server, WCS servlet and <strong>Geomatica</strong> should reside on the same<br />

computer. The configuration descriptor for the HTTP server is the<br />

config.xml file found in the \webapps\wcs\WEB-INF\config folder<br />

where you installed Tomcat. The config.xml file contains the elements<br />

that the servlet will use to configure itself.<br />

Once the installation is complete, the WCS servlet can function<br />

using default or automatically generated configuration parameters.<br />

You can change these parameters to fit your needs.<br />

Figure 4.1: Understanding the WCS Servlet<br />

HTTP server<br />

WCS servlet<br />

Servlet accesses <strong>Geomatica</strong><br />

Exploring the config.xml for the WCS<br />

The default config.xml for the WCS is located at \webapps\wcs\WEB-<br />

INF\config where you installed Tomcat. It communicates to the HTTP<br />

server the WCS name, its directory path, and the directory path of its<br />

configuration files. You can edit this file as required.<br />

The config.xml file has the following sections:<br />

Folders containing<br />

coverage data files<br />

31


Chapter 4 - Configuring the Servlet for the Web Coverage Service (WCS)<br />

• Service information<br />

• Contact information<br />

• Fees and access constraints<br />

• Online resource parameter<br />

• Temporary directory<br />

• Deployment parameters<br />

• Metadata configuration<br />

• System properties<br />

Service information<br />

This section allows you to specify a label and description of the<br />

service. For example, the label can contain the name of the<br />

organization that is providing the coverage. The description can<br />

contain some details about the coverage, such as, the area name,<br />

coordinates, and geological information.<br />

This section also allows you to add keywords that would quickly<br />

connect users to the coverage. The label, description, and keywords<br />

are all displayed in the XML document that appears at a<br />

getCapabilities request.<br />

Contact information<br />

This section allows you to specify the contact information you want<br />

displayed in the XML document that appears at a getCapabilities<br />

request.<br />

Fees and access constraints<br />

This section allows you to specify any fees or constraints that users<br />

must pay or adhere to before accessing the coverage.<br />

Online resource parameter<br />

This section allows you to specify the online resource parameter.<br />

Because the system automatically detects the online resource for<br />

you, we recommend that you keep the default setting commented<br />

out.<br />

Temporary directory<br />

This section allows you to specify a directory path that is to hold<br />

temporary files that the system creates when processing Web<br />

coverage requests. These files are deleted by the system upon<br />

completion of the requests, or upon shutdown.<br />

If the path you specify exists, ensure that it is writable, otherwise, the<br />

system generates an error. If the path you specify does not exist, the<br />

system automatically creates the path as long as the path is writable.<br />

If you do not specify a path for the temporary files, the system can<br />

create the path upon start up at: ${servlet}/WEB-INF/tmp. An error<br />

is generated, however, if the path is not writable.<br />

32 PCI Geomatics<br />

Note<br />

Do not set the directory in the same location as the metadata directory as<br />

this may cause processing errors.<br />

Deployment parameters<br />

This section has parameters that allow you to specify a custom<br />

deployment file and set monitoring options for a custom or the<br />

default deployment file. A custom TXT file containing EPSG codes<br />

can also be specified. The parameters are described in Table 4.


Configuring the WCS Servlet<br />

Table 4: Deployment parameters and their descriptions<br />

Deployment<br />

Parameters<br />

deployment-<br />

file<br />

monitordeploymentfile<br />

monitordeploymentfiledelay<br />

monitordeploymentcontent<br />

Settings Description<br />

deploy.xml<br />

file or custom.xml<br />

file<br />

An XML file that is validated against<br />

deploy1_0_0.xsd in<br />

webapps\wcs\WEB-INF\config\system<br />

where Tomcat is installed. The<br />

default, deploy.xml, can be modified<br />

or replaced with another XML file.<br />

This file is located at<br />

webapps\wcs\WEB-INF\config<br />

where Tomcat is installed, and for<br />

more information, see “Modifying<br />

the WCS Deployment File” on<br />

page 35.<br />

true Enables monitoring of the deployment<br />

file. When monitoring, applies<br />

any changes made in the file to the<br />

WCS without restarting the server.<br />

false Disables monitoring of the deployment<br />

file.<br />

every<br />

60,000 ms<br />

(per<br />

minute)<br />

(default)<br />

Waits for the specified time before<br />

checking for changes in the deployment<br />

file.<br />

true Enables monitoring of the deployed<br />

coverage files. Updates the WCS<br />

with any changes to the coverage<br />

files without restarting the server.<br />

May use a lot of server resources,<br />

therefore, it can overload the server<br />

if there is a lot of imagery.<br />

false Disables monitoring of the deployed<br />

coverage files.<br />

Table 4: Deployment parameters and their descriptions<br />

Deployment<br />

Parameters<br />

monitordeploymentcontentdelay<br />

supported-crs-<br />

list-file<br />

every<br />

30,000 ms<br />

(per ½<br />

minute)<br />

(default)<br />

Metadata configuration<br />

Settings Description<br />

supported_<br />

crs.txt or<br />

custom.txt<br />

file<br />

Waits for the specified time before<br />

checking for changes in the coverage<br />

files.<br />

Specifies a file that must be in TXT<br />

format. The default,<br />

supported_crs.txt, contains a list of<br />

European Petroleum Survey Group<br />

(EPSG) codes that are published on<br />

the WCS. This file allows you to list<br />

the EPSG codes that you want published.<br />

Only the supported codes of<br />

the coverage are listed in the XML<br />

document that appears at a<br />

describeCoverage request.<br />

This section has parameters that allow you to specify the way in<br />

which you want the system to generate and manage metadata. The<br />

parameters are described in Table 5.<br />

<strong>Geomatica</strong> <strong>WebServer</strong> Suite <strong>Installation</strong> <strong>Guide</strong> 33


Chapter 4 - Configuring the Servlet for the Web Coverage Service (WCS)<br />

Table 5: Metadata parameters and their descriptions<br />

Metadata<br />

Parameters<br />

metadata-directory<br />

Settings Description<br />

Directs where to create and store<br />

the metadata files. The files are<br />

created by the PACE program<br />

GDBMETA and are stored in<br />

XML format.<br />

If you do not specify a path, the<br />

system creates a location at:<br />

${temporary-directory}/metadata.<br />

If you specify a path that exists,<br />

ensure that the path is writable,<br />

otherwise, the system generates<br />

an error.<br />

If you specify a path that does not<br />

exist, the system automatically<br />

creates the path as long as the<br />

path is writable.<br />

Do not set the directory in the<br />

same location as the temporary<br />

directory as this may cause<br />

processing errors.<br />

You can enter an absolute path<br />

for the metadata files.<br />

Example:<br />

\webapps\wcs\metadata<br />

\webapps\wcs\data<br />

Example:<br />

C:\temp\gdbmeta<br />

Table 5: Metadata parameters and their descriptions<br />

Metadata<br />

Parameters<br />

delete-metadataon-shutdown<br />

System properties<br />

This section allows you to specify the cache management files:<br />

cache.ccf (see http://jakarta.apache.org/jcs) and log4j.xml (see<br />

http://jakarta.apache.org/log4j/).<br />

Testing the WCS Servlet<br />

Before you start adding your own data, you must test the WCS<br />

servlet after you have:<br />

• copied the wcs.war file to the folder where you installed Tomcat and<br />

• started Tomcat.<br />

The test Web page, which is index.html, is designed to run with the<br />

demo files specified in the default deploy.xml file in<br />

\webapps\wcs\WEB_INF\config where you installed Tomcat.<br />

To test the WCS servlet:<br />

1. Start the Tomcat server.<br />

Settings Description<br />

true Deletes metadata files and their<br />

directory during a server shutdown.<br />

false Does not delete metadata files<br />

during a server shutdown.<br />

This is the recommended setting.<br />

2. Open a browser window and type the following address:<br />

http://[hostname]:[port]/wcs/index.html<br />

34 PCI Geomatics


Publishing Your Data on the WCS Servlet<br />

Replace [localhost] by the name of the computer or IP address<br />

where Tomcat is installed. Replace [port] by the number of the<br />

listening port for Tomcat.<br />

3. Click the links under Request. These requests should return<br />

documents describing the files in the data folder in<br />

\webapps\wcs\WEB_INF\data where you installed Tomcat.<br />

If an error occurs, it can mean that:<br />

• The environment variable for <strong>Geomatica</strong> is not set properly (see<br />

“Installing <strong>Geomatica</strong>” on page 13).<br />

• The environment variable for JAVA_HOME is not set properly (see<br />

“Installing the Java SE Development Kit on a Windows System” on<br />

page 14).<br />

• The .war file is missing (see “Installing .WAR Files” on page 16).<br />

• Tomcat is not running (see “Exploring the WCS Folder” on page 16).<br />

Publishing Your Data on the WCS<br />

Servlet<br />

After you have installed and configured the WCS servlet, you can<br />

make your coverages available to others through the Web. To add<br />

your data to the WCS, you can paste your files into the data folder in<br />

\webapps\wcs\WEB_INF where you installed Tomcat.<br />

By default, the WCS is configured to publish all of the georeferenced<br />

raster data stored in the data folder if it is compatible with the PCI<br />

Geomatics Generic Database (GDB) technology. For more<br />

information about GDB, see<br />

http://www.pcigeomatics.com/products/gdb.html#gdb_info.<br />

If you want to configure the WCS to serve data from other data<br />

sources, you can edit the deployment file to add specific files and<br />

entire folders. In addition, you can set options for the title and<br />

descriptions of the coverages. For more information, see “Modifying<br />

the WCS Deployment File” on page 35.<br />

<strong>Geomatica</strong> <strong>WebServer</strong> Suite <strong>Installation</strong> <strong>Guide</strong> 35<br />

Note<br />

In some cases the demands on the WCS servlet will exceed the default<br />

memory allocation of Java. The result is a low memory error. To adjust<br />

the allocated memory size, see “Troubleshooting Low Memory Error in<br />

Tomcat” on page 18.<br />

Modifying the WCS Deployment File<br />

The default WCS deployment file is called deploy.xml, and is used<br />

to deploy coverages to the Web. The file is located in<br />

webapps\wcs\WEB-INF\config where Tomcat is installed and is<br />

validated against deploy1_0_0.xsd.<br />

Figure 4.2 displays the hierarchical structure of the elements used in<br />

the deploy.xml file. These elements manage the display of coverages<br />

on your WCS and provide options that optimize your WCS service.<br />

Serving mosaics<br />

Serving mosaics is a key feature of the WCS. To serve mosaics, you<br />

must:<br />

• set the “coverage-type” parameter to “mosaic” in the Group element<br />

Param, and<br />

• specify the Include path of the images you want included in the<br />

mosaic.<br />

When a request for mosaics is submitted to the WCS, the WCS<br />

creates and serves the mosaics based on the images specified in the<br />

Include paths of the deployment file.


Chapter 4 - Configuring the Servlet for the Web Coverage Service (WCS)<br />

Figure 4.2: Hierarchy of elements within the deploy.xml file<br />

The tables below describe the use of the elements in deploy.xml.<br />

Table 6: Deploy elements and their descriptions<br />

Deploy Element Description<br />

RootPath<br />

Group<br />

Provides the directory path the system must<br />

use to trace through and find the folder(s) or<br />

file(s) specified in the Group\Include. The directory<br />

path can be absolute or relative and can be<br />

overridden by the path specified in Group\Root-<br />

Path. System rules for this override are illustrated<br />

in Table 9, “System trace routes based<br />

on Deploy and Group RootPaths,” on page 38.<br />

Helps you categorize documents. For example,<br />

you can group all of the images for a particular<br />

geographic area. You can have multiple<br />

groups.<br />

Table 7: Group elements and their descriptions<br />

Group Element Description<br />

36 PCI Geomatics<br />

Title<br />

Description<br />

Param<br />

Channels<br />

Allows you to specify a title for the group.<br />

Example: A title for a group of files used<br />

to produce a mosaic.<br />

Allows you to specify a brief description<br />

for the group.<br />

Example: Details of the mosaic coverage.<br />

Specifies the mosaicking of a group of<br />

images. If the “coverage-type” attribute is<br />

set to “mosaic”, the system produces a<br />

virtual mosaic from the specified files in<br />

the group.<br />

If the “coverage-type” attribute is set to<br />

“basic”, each file then becomes an individual<br />

coverage.<br />

If this parameter is commented out, the<br />

system defaults to “basic”.<br />

Allows you to specify the image channels<br />

you want published. The channel numbers<br />

must be integers separated by<br />

spaces.<br />

Examples: 1 2 3<br />

If the Include path specifies a folder, the<br />

specified channels are published for the<br />

folder.<br />

To display different channels for each file,<br />

create separate Include paths. The Group<br />

element can have multiple Include paths.<br />

If the channels are not specified, all of the<br />

channel numbers are published.


Publishing Your Data on the WCS Servlet<br />

Table 7: Group elements and their descriptions<br />

Group Element Description<br />

RootPath<br />

Include<br />

Provides the directory path the system<br />

must use to trace through and find the<br />

folder(s) or file(s) specified in<br />

Group\Include. The directory path can be<br />

absolute or relative and can override the<br />

path specified in Deploy\RootPath. System<br />

rules for this override are illustrated in<br />

Table 9 on page 38.<br />

Only one RootPath can exist for every<br />

Group element.<br />

Allows you to specify directory paths or<br />

names of files you want published on the<br />

WCS.<br />

This element has two attributes:<br />

• “path” allows a relative or absolute URI,<br />

including Oracle connection strings. If<br />

the relative URI is a folder, then the<br />

entire folder is selected.<br />

• “id” allows the tagging of each file<br />

specified in the “path” with a unique<br />

identifier.<br />

You can have multiple Include paths and<br />

use wildcards to specify particular folders<br />

or files. The wildcard: “*” matches zero or<br />

more characters, and the wildcard: “?”<br />

matches only one character.<br />

The system follows a set of rules to trace<br />

the “path”. For more information, see<br />

Table 9 on page 38.<br />

Table 8: Include elements and their descriptions<br />

Include Element Description<br />

<strong>Geomatica</strong> <strong>WebServer</strong> Suite <strong>Installation</strong> <strong>Guide</strong> 37<br />

Title<br />

Description<br />

Param<br />

Channels<br />

This element is reserved for use in a<br />

future release.<br />

This element is reserved for use in a<br />

future release.<br />

Allows you to monitor the path specified<br />

in Include. Monitors the path for changes,<br />

deletions, and additions with the “monitor”<br />

attribute set to true.<br />

The “monitor” settings (true or false) override<br />

the setting for the config.xml\monitordeployment-content<br />

parameter. Only<br />

when the “monitor” attribute is commented<br />

out or not listed, the system uses<br />

the monitor-deployment-content setting.<br />

Allows you to specify the image channels<br />

you want published. The channel numbers<br />

must be integers separated by<br />

spaces.<br />

Examples: 1 2 3<br />

If the Include path specifies a folder, the<br />

specified channels are published for the<br />

folder.<br />

To display different channels for each file,<br />

create separate Include paths. The Group<br />

element can have multiple Include paths.<br />

If the channels are not specified, all of the<br />

channel numbers are published.<br />

This setting is overridden by the setting in<br />

Group\Channels element.


Chapter 4 - Configuring the Servlet for the Web Coverage Service (WCS)<br />

Table 9: System trace routes based on Deploy and Group<br />

RootPaths<br />

Include<br />

Path<br />

Deploy/<br />

RootPath<br />

data\*.pix Absolute:<br />

c:\maps<br />

data\*.pix Absolute:<br />

c:\maps<br />

data\*.pix Absolute:<br />

c:\maps<br />

data\*.pix Relative:<br />

“maps”<br />

data\*.pix Not<br />

specified<br />

data\*.pix Relative:<br />

“maps”<br />

Group/<br />

RootPath<br />

Absolute:<br />

c:\images<br />

Relative:<br />

“ottawa”<br />

Not<br />

specified<br />

Relative:<br />

“ottawa”<br />

Not<br />

specified<br />

Not<br />

specified<br />

System Trace Route<br />

c:\images\data\*.pix<br />

c:\maps\ottawa\data\*.pix<br />

c:\maps\data\*.pix<br />

c:\program<br />

files\tomcat\webapps\wcs\<br />

web-inf\config\maps\<br />

ottawa\data\*.pix<br />

c:\program<br />

files\tomcat\webapps\wcs\we<br />

b-inf\config\data\*.pix<br />

c:\program<br />

files\tomcat\webapps\wcs\<br />

web-inf\config\maps\<br />

data\*.pix<br />

Note: “ottawa” is not included.<br />

WCS Troubleshooting Checklist<br />

If the WCS is not functioning properly, one of the settings or<br />

parameters may be set incorrectly. To troubleshoot the installation<br />

and configuration, double-check using the following list:<br />

Step Check<br />

1. Install <strong>Geomatica</strong>.<br />

See “Installing <strong>Geomatica</strong>” on page 13<br />

Step Check<br />

2. Set the Path environment variable for <strong>Geomatica</strong>.<br />

See “Installing <strong>Geomatica</strong>” on page 13<br />

3. Install the Java SE Development Kit Standard Edition<br />

(JDK) 5.0 and set the environment variable for<br />

JAVA_HOME.<br />

See “Installing the Java SE Development Kit on a<br />

Windows System” on page 14.<br />

4. Install the Tomcat Server.<br />

See “Installing the Tomcat Server on a Windows<br />

System” on page 14.<br />

5. Copy the Oracle .jar file, if required, from<br />

\product\$version\client_1\jdbc\lib of your Oracle<br />

installation and paste it in the \shared\lib path of your<br />

Tomcat installation.<br />

See “Installing Oracle® .JAR Files” on page 16.<br />

6. Copy the wcs.war file from the gws folder where you<br />

installed <strong>Geomatica</strong> and paste it in the webapps folder<br />

where you installed Tomcat.<br />

See “Installing .WAR Files” on page 16.<br />

7. Start the Tomcat server.<br />

See “Exploring the WCS Folder” on page 16.<br />

8. Place your files in the data folder located at<br />

\webapps\wcs\WEB_INF where Tomcat is installed.<br />

See “Modifying the WCS Deployment File” on<br />

page 35.<br />

9. Stop and restart the Tomcat server.<br />

See “Stopping and Restarting Tomcat” on page 18.<br />

38 PCI Geomatics


C HAPTER<br />

5<br />

Configuring the Servlet for the Web Mapping Service (WMS)<br />

Configuring the WMS Servlet<br />

This chapter explains the WMS servlet’s configuration file and its<br />

associated DTD file so you can build, modify and/or manage the<br />

configuration file. The information in this chapter is intended for<br />

users with comprehensive knowledge of HTML, JavaScript, Web<br />

servers, applets and servlets.<br />

The WMS servlet is different from the WFS or WCS servlets.<br />

Instead of accessing data from a folder, the WMS servlet<br />

communicates with the <strong>Geomatica</strong> <strong>WebServer</strong> Monitor, which is<br />

<strong>Geomatica</strong> Focus in server mode. For more information about the<br />

<strong>Geomatica</strong> <strong>WebServer</strong> Monitor, see “Starting the <strong>Geomatica</strong><br />

<strong>WebServer</strong> Monitor” on page 49.<br />

The WMS servlet can use one of three methods to retrieve a<br />

configuration file from the <strong>Geomatica</strong> <strong>WebServer</strong> Monitor: the Self-<br />

Configured method, the Assisted method, or the Customized<br />

method.<br />

Using the Self-Configured Method<br />

When the WMS servlet is not given a configuration file, it<br />

automatically seeks the <strong>Geomatica</strong> <strong>WebServer</strong> Monitor and requests<br />

its configuration file. The <strong>Geomatica</strong> <strong>WebServer</strong> Monitor then<br />

responds by sending its default configuration file (see Figure 5.1).<br />

For this scenario to work, <strong>Geomatica</strong> Focus must be installed on the<br />

same computer as the WMS servlet, and the <strong>Geomatica</strong> <strong>WebServer</strong><br />

Monitor must be running on port 1450 on the same computer as the<br />

WMS servlet.<br />

39


Chapter 5 - Configuring the Servlet for the Web Mapping Service (WMS)<br />

Figure 5.1: Example of a Self-Configured system<br />

HTTP server<br />

WMS servlet<br />

Using the Assisted Method<br />

The WMS servlet automatically<br />

sends a request through port 1450<br />

to the <strong>Geomatica</strong> <strong>WebServer</strong><br />

Monitor for its Capabilities file.<br />

The <strong>Geomatica</strong> <strong>WebServer</strong> Monitor<br />

returns its default configuration file (such<br />

as host name, port, layers, etc.).<br />

When the WMS servlet is configured with a location for the<br />

<strong>Geomatica</strong> <strong>WebServer</strong> Monitor, it automatically gets the<br />

configuration file from the specified <strong>Geomatica</strong> <strong>WebServer</strong><br />

Monitor. By using the Assisted method, one WMS servlet can<br />

retrieve the configuration file from a specific <strong>Geomatica</strong> <strong>WebServer</strong><br />

Monitor running on any computer in the network (see Figure 5.2).<br />

Two parameters are used to specify the location of the <strong>Geomatica</strong><br />

<strong>WebServer</strong> Monitor: “Focus_HostName” and “Focus_Port”. The<br />

“Focus_ HostName” parameter specifies either the IP address or the<br />

host name where the <strong>Geomatica</strong> <strong>WebServer</strong> Monitor is running.<br />

“Focus_Port” specifies which port the <strong>Geomatica</strong> <strong>WebServer</strong><br />

Monitor is using. The method used to set the “Focus_HostName”<br />

and “Focus_Port” parameters for the WMS servlet depends on the<br />

HTTP server technology that you are using (see “Setting Parameters<br />

in Tomcat” on page 43).<br />

If you are using a different port and/or a different host name, use the<br />

Focus_Port and/or Focus_HostName parameters to declare them in<br />

the web.xml file, which is in \webapps\wms\WEB-INF in the folder<br />

where you installed Tomcat. The WMS will get the Capabilities file<br />

from the Monitor using the port and/or host name specified in the<br />

web.xml.<br />

Figure 5.2: Example of an Assisted system<br />

HTTP server<br />

WMS servlet<br />

WMS servlet<br />

You can have several WMS servlets installed on a server with each<br />

assigned to its own <strong>Geomatica</strong> <strong>WebServer</strong> Monitor running its own<br />

project. Each WMS servlet retrieves the configuration file from its<br />

assigned <strong>Geomatica</strong> <strong>WebServer</strong> Monitor.<br />

Using the Customized Method<br />

You can also create your own configuration file and program the<br />

WMS servlet to retrieve it from a specific location. By creating your<br />

own configuration file, you can program the WMS servlet to gain<br />

access to several projects running on different computers and even<br />

retrieve information from other sources (see Figure 5.3). This<br />

method requires comprehensive knowledge of XML programming.<br />

The MapService_Configuration parameter specifies the path and the<br />

file name of the XML file that the WMS servlet requires to configure<br />

itself. If you create a new configuration file for the WMS, use the<br />

MapService_Configuration parameter to declare its path and<br />

filename in the web.xml, which is in \webapps\wms\WEB-INF in the<br />

folder where you installed Tomcat. The WMS will get your<br />

configuration file from the location declared in the web.xml.<br />

“Creating the Servlet Configuration File” on page 41 provides a<br />

description of the valid tags allowed in the XML file, including the<br />

WMS servlet’s Document Type Definition (DTD) file.<br />

40 PCI Geomatics


Creating the Servlet Configuration File<br />

Figure 5.3: Example of a customized system<br />

HTTP server<br />

WMS servlet<br />

Creating the Servlet Configuration File<br />

You can create your own configuration file or you can export one<br />

from your <strong>Geomatica</strong> project.<br />

Exporting the XML Project<br />

From your project in <strong>Geomatica</strong> Focus, you can create an XML file<br />

that you can modify for use as a configuration file. By default<br />

<strong>Geomatica</strong> will use port 1450 and the name of the computer<br />

currently running the <strong>Geomatica</strong> project as the host name.<br />

To export the XML file:<br />

1. Open your <strong>Geomatica</strong> project.<br />

The WMS servlet<br />

retrieves your<br />

configuration file that<br />

enables it to access<br />

information from any<br />

source that you specify.<br />

2. In the File menu, click Utility, and then click Export XML Project.<br />

3. Save the XML file in \webapps\wms in the folder where you<br />

installed Tomcat.<br />

You can edit the XML file to include the correct host name and port<br />

number, combine it with other projects’ exported XML files, or<br />

modify it to suit your needs. After the configuration file for the<br />

WMS servlet is complete, specify the path and the file name of the<br />

configuration file by using the MapService_ Configuration<br />

parameter in the web.xml file (see “Setting Parameters in Tomcat”<br />

on page 43).<br />

Exploring the Initialization Parameters<br />

Two sets of parameters change how the WMS servlet reacts. One set<br />

affects how it functions and the other control what values appear in<br />

the Capabilities file. Refer to “Setting Parameters in Tomcat” on<br />

page 43 for an example of how to set these parameters. Setting the<br />

servlet’s parameters depends on your HTTP server technology. If<br />

you are using a server other than Tomcat, please refer to that server’s<br />

documentation for details.<br />

Changing the Function<br />

The web.xml contains a list of parameters that are commented out by<br />

default, but you can use them to customize the servlet. The first set<br />

of parameters determines how the WMS servlet functions (see<br />

Table 10). Each time you change the parameters, restart Tomcat to<br />

unload the servlet from memory.<br />

To be compliant with the WMS specification, all the layers<br />

published in the capabilities document must have a bounding box<br />

measured using latitude and longitude (Lat/Long) coordinates.<br />

When the parameter is set to true, the servlet runs in<br />

OGC_Compliancy_Mode. In OGC_Compliancy_Mode only the<br />

georeferenced layers from which a Lat/Long bounding box can be<br />

derived are published. When the parameter is set to false, all the<br />

layers in the project are published in the capabilities document<br />

whether a Lat/Long bounding box can be derived or not.<br />

<strong>Geomatica</strong> <strong>WebServer</strong> Suite <strong>Installation</strong> <strong>Guide</strong> 41


Chapter 5 - Configuring the Servlet for the Web Mapping Service (WMS)<br />

Table 10: Change the Function<br />

Service_Debug<br />

OGC_Compliancy_Mode<br />

Capabilities_DTD_URL<br />

Focus_Port<br />

Focus_HostName<br />

MapService_Configuration<br />

Changing the Values<br />

Service_Debug helps you to debug<br />

the WMS servlet during installation<br />

and development. By default, Service_<br />

Debug parameter is not activated.<br />

OGC_Compliancy_Mode specifies<br />

whether the WMS servlet is running in<br />

OGC compliancy mode or not. By<br />

default, the OGC_Compliancy_Mode<br />

parameter is set to false.<br />

Capabilities_DTD_URL specifies the<br />

HTTP address of the Capabilities’s<br />

DTD (capabilities_1_0_0.dtd) that is in<br />

\webapps\wms\DTD in the folder<br />

where you installed Tomcat. By<br />

default the address is http://<br />

[localhost]:8080/wms/DTD/<br />

capabilities_1_0_0.dtd.<br />

Focus_Port is a number that specifies<br />

which port the <strong>Geomatica</strong> <strong>WebServer</strong><br />

Monitor is using (see “Using the<br />

Assisted Method” on page 40).<br />

Focus_HostName specifies either the<br />

IP address or the host name where<br />

<strong>Geomatica</strong> <strong>WebServer</strong> Monitor is<br />

running (see “Using the Assisted<br />

Method” on page 40).<br />

MapService_Configuration specifies<br />

the path and file name of the XML file<br />

that the WMS servlet requires to<br />

configure itself (see “Using the<br />

Customized Method” on page 40).<br />

Since <strong>Geomatica</strong> <strong>WebServer</strong> is compliant with the Open Geospatial<br />

Web Map Server Interface Implementation Specification, it can<br />

provide a Capabilities file. The web.xml contains a list of parameters<br />

that are commented out by default, but you can use them to<br />

customize the servlet. The second set of parameters (see Table 11<br />

and Table 12) determines the values returned in the Capabilities file.<br />

To comply with the Open Geospatial Web Map Server Interface<br />

Implementation Specification, you must enter values corresponding<br />

to your project. By default unspecified values are given the default<br />

value of “none”, except the parameter Service_Name which is<br />

“GetMap” by default. Each time you change the parameters, restart<br />

Tomcat to unload the servlet from memory.<br />

Table 11: Change the Capabilities Values<br />

(compatible with version 1.0.0 and higher)<br />

Service_Name<br />

Service_Title<br />

Service_Abstract<br />

Service_KeyWord<br />

Service_OnlineResource<br />

Service_Fees<br />

The Service_Name parameter is<br />

defined as “GetMap” within the Web<br />

Mapping Specification namespace.<br />

The Service_Title parameter contains<br />

a title to identify the server to the user.<br />

The Service_Abstract parameter is a<br />

descriptive statement about the<br />

server.<br />

The Service_KeyWord parameter<br />

provides a register of short words to<br />

help with catalogue searching.<br />

Currently, no controlled vocabulary is<br />

defined.<br />

The Service_OnlineResource<br />

parameter declares the top-level<br />

HTTP URL or home page for your<br />

service.<br />

The Service_Fees parameter<br />

indicates the fees imposed on the<br />

user. The reserved keyword “none”<br />

indicates that no fees exists.<br />

42 PCI Geomatics


Reconfiguring <strong>Geomatica</strong> Focus Project Using EASI<br />

Table 11: Change the Capabilities Values<br />

(compatible with version 1.0.0 and higher)<br />

Service_AccessConstraint<br />

Table 12: Change the Capabilities Values<br />

(compatible with version 1.1.1 and higher)<br />

Path_Contact_Information<br />

Setting Parameters in Tomcat<br />

The Service_AccessConstraint<br />

parameter indicates the access<br />

constraints imposed on the user. The<br />

reserved keyword “none” indicates<br />

that no constraint exists.<br />

The Path_Contact_Information<br />

parameter declares the file containing<br />

the contact or support information for<br />

your service.<br />

If you are using Tomcat as your HTTP server, the parameters are set<br />

in the web.xml file found in \webapps\wms\WEB-INF in the folder<br />

where you installed Tomcat. Each time you change the parameters,<br />

restart Tomcat to unload the servlet from memory. For example, the<br />

code below sets the MapService_Configuration parameter in the<br />

web.xml file:<br />

<br />

MapService_Configuration<br />

C:\configuration.xml<br />

<br />

Reconfiguring <strong>Geomatica</strong> Focus Project<br />

Using EASI<br />

EASI is a scripting language that you can use for querying,<br />

specifying parameter values, and executing tasks. You can build an<br />

EASI script to automatically compute more complex or timeconsuming<br />

results. With EASI you can access and manipulate raster<br />

imagery, vector data, projection information, general binary files,<br />

and text files.<br />

To open the EASI Servlet:<br />

1. Make sure that Tomcat is running and the <strong>Geomatica</strong> <strong>WebServer</strong><br />

Monitor is running with a <strong>Geomatica</strong> Focus project.<br />

2. Type the following in the address bar of your browser:<br />

http://[localhost]:8080/wms/EasiServlet<br />

Replace [localhost] by the name of the computer or IP address<br />

where Tomcat is installed.<br />

3. In the EASI Editor box, type the EASI script that you want to use.<br />

For example, to open a <strong>Geomatica</strong> Focus project from a remote<br />

location, you can type:<br />

Call ReadJOLTProjectFile ("C:\\Program<br />

Files\\<strong>Geomatica</strong>_V100\\demo\\newport.gpr")<br />

4. Click Process EASI.<br />

5. Restart Tomcat. You can also restart Tomcat from a remote location,<br />

see “Resetting the Servlet from a <strong>Remote</strong> Location” on page 43.<br />

Resetting the Servlet from a <strong>Remote</strong><br />

Location<br />

When you make changes in your <strong>Geomatica</strong> Focus project, you must<br />

update the MapService with the new map data set. To do this,<br />

normally you stop and restart Tomcat through the command prompt<br />

(see “Exploring the WCS Folder” on page 16). If you are at a remote<br />

location from the servlet, you can used the MapService Reset Button<br />

to stop and restart it.<br />

To reset the MapService:<br />

1. Make sure that Tomcat is running and the <strong>Geomatica</strong> <strong>WebServer</strong><br />

Monitor is running with a <strong>Geomatica</strong> Focus project.<br />

<strong>Geomatica</strong> <strong>WebServer</strong> Suite <strong>Installation</strong> <strong>Guide</strong> 43


Chapter 5 - Configuring the Servlet for the Web Mapping Service (WMS)<br />

2. Type the following in the address bar of your browser:<br />

http://[localhost]:8080/wms/Reset.html<br />

Replace [localhost] by the name of the computer or IP address<br />

where Tomcat is installed.<br />

Exploring the Syntax of the Servlet’s<br />

Configuration File<br />

Using an example is the simplest way to describe the syntax of the<br />

WMS servlet’s configuration file. By consulting the MapService-<br />

Config.dtd, you can validate any modifications that you make to the<br />

file.<br />

The following configuration file contains a layer from <strong>Geomatica</strong><br />

<strong>WebServer</strong> Monitor running on the computer “Host” using port<br />

1455:<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

image<br />

FocusConnector<br />

1455<br />

Host<br />

<br />

<br />

Default<br />

<br />

<br />

<br />

<br />

The first line in the example indicates that the document is based on<br />

XML version 1.0 and the encoding is UTF-8:<br />

<br />

The “mapservice-config” element is the root of the XML file where<br />

you declare all the map layers.<br />

<br />

. . .<br />

<br />

Within the “mapservice-config” element, the next lines shown in the<br />

example state the “map” element with a style sheet and the map<br />

layer. The stylesheet determines the format for the results of the<br />

queries that you perform.<br />

<br />

<br />

<br />

<br />

Each “maplayer” is identified by a unique “layerid”. The layer ID<br />

corresponds to the names of the layers in the Capabilities, which is<br />

“Boundaries” in this example:<br />

<br />

<br />

<br />

<br />

The “queryable” attribute in the “maplayer” element indicates<br />

whether the layer can be queried about layer attributes or not. If the<br />

value is “true”, queries are possible. If the value is “false”, queries<br />

are not possible.<br />

The “layertype” element defines the type of layer, which is “image”<br />

in the following line from the example:<br />

image<br />

44 PCI Geomatics


Exploring the Contents of the Servlet’s DTD<br />

The “mapprovider” element indicates where the layer is retrieved.<br />

When “mapprovider” element is FocusConnector, you require the<br />

“port” tag and the “hostname” tag as shown in the following<br />

example. The “port” tag determines which port <strong>Geomatica</strong><br />

<strong>WebServer</strong> Monitor is using to communicate with the WMS servlet.<br />

The “hostname” tag determines the IP address or the computer where<br />

<strong>Geomatica</strong> <strong>WebServer</strong> Monitor is running.<br />

FocusConnector<br />

1455<br />

Host<br />

The “bbox” element declares the Spatial Reference System used and<br />

the bounding box value of the image, as shown in the following<br />

example. Requests about the layer are sent only if the values returned<br />

fall within the specified bounding box. For example:<br />

<br />

The “style” element determines the number of styles supported by<br />

the map layer. For example:<br />

<br />

Default<br />

<br />

You can use other elements to further describe the layers. As shown<br />

in the following example, the “title” element provides users with a<br />

title for the layer and the “abstract” element provides a description<br />

of the layer. For example:<br />

Overview of the project<br />

The Boundaries map layer defines the outline<br />

of the incorporated cities.<br />

Exploring the Contents of the Servlet’s<br />

DTD<br />

The mapService-Config.dtd is a DTD that contains the formal<br />

definitions for all the data elements used in the WMS servlet’s<br />

configuration file. By consulting the mapService-Config.dtd, you<br />

can validate any modifications that you make to the file.<br />

The mapService-Config.dtd is an XML file using XML version 1.0<br />

and encoding UTF-8:<br />

<br />

The “mapservice-config” element is the root of the WMS servlet’s<br />

configuration file:<br />

<br />

<br />

The “map” element is a container for one to several map layers. It is<br />

defined in the DTD as follows:<br />

<br />

The “maplayer” element is a child of the “map” element. It<br />

represents a map layer that is identified by its layer ID in the<br />

Capabilities. The “maplayer” element contains title, layertype,<br />

hostname, port, mapprovider, bbox, style, urladdress, and abstract<br />

child elements and the layerid and queryable attributes. The<br />

“maplayer” child element is defined in the DTD as follows:<br />

<br />

<br />

The “title” element is optional, however, it provides more<br />

description than the “layerid” attribute. Usually, the “layerid”<br />

attribute cannot be read by users so use the “title” element to<br />

<strong>Geomatica</strong> <strong>WebServer</strong> Suite <strong>Installation</strong> <strong>Guide</strong> 45


Chapter 5 - Configuring the Servlet for the Web Mapping Service (WMS)<br />

describe the layer. The “title” element is defined in the DTD as<br />

follows:<br />

<br />

The “layertype” element is required to identify the type of layer,<br />

such as an image, a feature, and so on. The “layertype” element is<br />

defined in the DTD as follows:<br />

<br />

The “hostname” element is required when the map provider is<br />

FocusConnector. The host name is the name of the computer where<br />

<strong>Geomatica</strong> <strong>WebServer</strong> Monitor is installed. The “hostname” element<br />

is defined in the DTD as follows:<br />

<br />

The “port” element is also required when the map provider is<br />

FocusConnector. The “port” element indicates the path where<br />

<strong>Geomatica</strong> <strong>WebServer</strong> can locate an image in a <strong>Geomatica</strong> project<br />

and send it to the applet. The “port” element is defined in the DTD<br />

as follows:<br />

<br />

The “mapprovider” element is required to indicate the type of<br />

provider needed to provide the layer. Two kinds of map providers<br />

exist, FocusConnector and URLConnector.<br />

FocusConnector: The FocusConnector can retrieve the images from<br />

<strong>Geomatica</strong> <strong>WebServer</strong> Monitor.<br />

URLConnector: The URLConnector retrieves images from an<br />

address on the Internet (URL). For example, the URLConnector can<br />

access an image from a map provider.<br />

The “mapprovider” element is defined in the DTD as follows:<br />

<br />

The “bbox” or bounding box element is required for each layer. The<br />

“bbox” element indicates the edge of the bounding box in the units<br />

of the specified Spatial Reference System (SRS). The “bbox”<br />

element is defined in the DTD as follows:<br />

<br />

<br />

The “style” element is required to define the style supported by the<br />

layer. The “style” element is defined in the DTD as follows:<br />

<br />

<br />

The “urladdress” element is required when the map provider is<br />

URLConnector. It indicates the Internet address where the map is<br />

located. The “urladdress” element is defined in the DTD as follows:<br />

<br />

The “abstract” element provides more information about the layer.<br />

The “abstract” element is defined in the DTD as follows:<br />

<br />

The “stylesheets” element declares the style sheet used to format the<br />

results of the queries. The “id” attribute defines the filename of the<br />

style sheet. The “path” attribute defines the path where the file is<br />

found. These are defined in the DTD as follows:<br />

<br />

46 PCI Geomatics


Viewing the MapService-Config DTD<br />

<br />

<br />

<br />

Viewing the MapService-Config DTD<br />

The following is the mapService-Config.dtd in its original form:<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />


Chapter 5 - Configuring the Servlet for the Web Mapping Service (WMS)<br />

The style element defines the style supported by the<br />

layer.<br />

--><br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

48 PCI Geomatics


C HAPTER<br />

6<br />

Publishing Your Maps on the WMS Servlet or a Web Page<br />

Publishing Your Data on the WMS<br />

Servlet<br />

With the WMS servlet you can make your maps available to others<br />

through the Web. After you have installed and configured the WMS<br />

servlet, start the <strong>WebServer</strong> Monitor with you maps project (see<br />

“Starting the <strong>Geomatica</strong> <strong>WebServer</strong> Monitor” on page 49). The<br />

<strong>WebServer</strong> Monitor provides access to your data to others on the<br />

Web. You can also display your project in a Web page (see<br />

“Publishing Your Maps in a Web Page” on page 50).<br />

When you are building a project, remember the following:<br />

1. Separate your project into layers with similar items together on one<br />

layer. For example, put the highways on one layer and the railroads<br />

on a separate layer.<br />

2. Identify each layer with a clear, concise, and unique name that<br />

represents what appears on the layer. For example, you can name the<br />

highway layer HIGHWAYS.<br />

3. Avoid using spaces and commas from the layer names. When the<br />

<strong>Geomatica</strong> <strong>WebServer</strong> Monitor prepares the project for the Web,<br />

spaces and commas are removed, which may cause errors to occur.<br />

To avoid problems, label your layers using only the letters of the<br />

alphabet, numbers, and the underscore “_”. Other characters may<br />

produce unwanted results or errors.<br />

Tip<br />

When the Shortcut to Focus.exe is used for the <strong>Geomatica</strong> <strong>WebServer</strong><br />

Monitor, you can start <strong>Geomatica</strong> Focus from the Windows Start button<br />

or create a new shortcut.<br />

Starting the <strong>Geomatica</strong> <strong>WebServer</strong><br />

Monitor<br />

The <strong>Geomatica</strong> <strong>WebServer</strong> Monitor is <strong>Geomatica</strong> Focus in server<br />

mode. As explained in Figure 6.2 on page 51, it provides the WMS<br />

servlet with a communication port to the map project that you want<br />

to publish and to the <strong>Geomatica</strong> Focus executable routines so it can<br />

process the requests made by the WMS client. The <strong>Geomatica</strong><br />

<strong>WebServer</strong> Monitor and the WMS servlet can run on separate<br />

computers as long as they can communicate over the network.<br />

49


Chapter 6 - Publishing Your Maps on the WMS Servlet or a Web Page<br />

To start the <strong>Geomatica</strong> <strong>WebServer</strong> Monitor:<br />

1. Create a shortcut to <strong>Geomatica</strong> Focus on your desktop.<br />

2. Right-click the shortcut.<br />

3. Click Properties.<br />

4. In Target box on the Shortcut tab, add “ -webserver”, the port<br />

number and the path for the project. The synopsis of the command is:<br />

-webserver [port] projectfile<br />

As an example, use one of the existing projects in <strong>Geomatica</strong>’s<br />

demo folder to start the <strong>Geomatica</strong> <strong>WebServer</strong> Monitor. The path<br />

in Target box on the Shortcut tab should appear something like<br />

this:<br />

“C:\<strong>Geomatica</strong>_V100\exe\Focus.exe” -webserver 1450<br />

“C:\Program Files\<strong>Geomatica</strong>_V100\demo\newport.gpr”<br />

Note<br />

Verify that port 1450 is available.<br />

5. Click OK.<br />

6. Double-click the Shortcut to focus.exe on your desktop.<br />

<strong>Geomatica</strong> Focus then opens the <strong>Geomatica</strong> <strong>WebServer</strong> Monitor,<br />

as shown in Figure 6.1. If the <strong>Geomatica</strong> <strong>WebServer</strong> stops<br />

responding, the earth graphic stops moving.<br />

Figure 6.1: Example of the <strong>Geomatica</strong> <strong>WebServer</strong> Monitor<br />

Publishing Your Maps in a Web Page<br />

You can also publish your maps on a Web page. <strong>Geomatica</strong><br />

<strong>WebServer</strong> Suite provides you with the WMS servlet, a WMS client<br />

(applet and browser combination), assorted HTML templates, a<br />

library of button icons, and JavaScripts for adding functions to your<br />

Web page. Even if you possess only rudimentary programming<br />

skills, you can easily publish your project on the Web by using one<br />

of the templates.<br />

To publish your maps on a Web page:<br />

1. Create a map project in <strong>Geomatica</strong> Focus.<br />

2. Install the WMS servlet as explained in “Installing the HTTP Server<br />

and Servlets” on page 13.<br />

3. Create a Web page. You can start with “Using the Basic Template to<br />

Display Your Project” on page 52, which shows you how to use one<br />

of the HTML templates to publish your project on the Web.<br />

50 PCI Geomatics


Introducing the Templates<br />

Figure 6.2: Interactions between the components<br />

Introducing the Templates<br />

<strong>Geomatica</strong> <strong>WebServer</strong> includes six templates that you can use to<br />

publish your project on the Web. Each template showcases different<br />

features that you may want for your own Web page. When you have<br />

Tomcat and the <strong>Geomatica</strong> <strong>WebServer</strong> Monitor running, you can<br />

view the templates using one of the demo projects provided in the<br />

Demo folder located in the <strong>Geomatica</strong> folder.<br />

To view the templates:<br />

The applet and browser work<br />

together as a WMS client. As<br />

you perform functions on the<br />

map in the applet, it sends<br />

requests to the HTTP server.<br />

The WMS servlet uses <strong>Geomatica</strong><br />

<strong>WebServer</strong> Monitor to access<br />

<strong>Geomatica</strong> Focus and the map project.<br />

The HTTP server sends the requests to the<br />

WMS servlet which communicates with<br />

the <strong>Geomatica</strong> <strong>WebServer</strong> Monitor.<br />

HTTP server<br />

WMS servlet<br />

1. Make sure Tomcat is running and the <strong>Geomatica</strong> <strong>WebServer</strong><br />

Monitor is started with the newport.gpr project from the Demo<br />

folder.<br />

2. Type the following in the address bar of your browser:<br />

http://[localhost]:8080/wms/Readme.html<br />

Replace [localhost] by the name of the computer or IP address<br />

where Tomcat is installed.<br />

3. Click the <strong>Geomatica</strong> Web Server folder.<br />

4. Click Demonstrations.<br />

5. Click Templates.<br />

<strong>Geomatica</strong> <strong>WebServer</strong> includes six templates:<br />

•Click Tool Reference to view the descriptions and use of all the tools<br />

available in the templates.<br />

•Click MapViewerTemplate1.html: this basic template includes the<br />

map window and the Pan and Zoom features.<br />

•Click MapViewerTemplate2.html: this template includes the map<br />

window, Pan, Recenter, Overview, Progressive Zoom, Zoom In,<br />

Zoom Out, Zoom Window, Zoom and Pan, and check boxes to select<br />

layers.<br />

•Click MapViewerTemplate3.html: this template includes all the<br />

features available in MapViewerTemplate2.html plus check boxes to<br />

select layers for queries, a General Query button, and an Overview<br />

window.<br />

•Click MapViewerTemplate4.html: this template includes all the<br />

features available in MapViewerTemplate2.html plus check boxes to<br />

select layers for queries, a Query Select Point button, a Length tool,<br />

Area tool, Circle tool, and an Overview window.<br />

•Click MapViewerTemplate5.html: this template includes all the<br />

features available in MapViewerTemplate3.html plus a Line tool,<br />

Polygon tool, a Line Query tool, a Polygon Query tool, and a Saved<br />

Query button.<br />

•Click MapViewerTemplate6.html: this template includes all the<br />

features available in MapViewerTemplate3.html plus the Query<br />

Form button.<br />

<strong>Geomatica</strong> <strong>WebServer</strong> Suite <strong>Installation</strong> <strong>Guide</strong> 51


Chapter 6 - Publishing Your Maps on the WMS Servlet or a Web Page<br />

Using the Basic Template to Display<br />

Your Project<br />

MapViewerTemplate1.html is a very basic model for a Web page.<br />

Web users will only be able to pan and zoom using their left and right<br />

mouse buttons. To create a more interesting Web page, see “Using<br />

the Templates for Your Web Page” on page 52 or “Making Your<br />

Own Web Page” on page 54.<br />

To use MapViewerTemplate1 for your Web page:<br />

1. Start the <strong>Geomatica</strong> <strong>WebServer</strong> Monitor with your project in the<br />

Target box (see “Starting the <strong>Geomatica</strong> <strong>WebServer</strong> Monitor” on<br />

page 49). For example: in Target box on the Shortcut tab, type:<br />

C:\<strong>Geomatica</strong>_V100\exe\Focus.exe -webserver 1450<br />

C:\YourProject\projectX.gpr<br />

2. Restart the HTTP server (see “Exploring the WCS Folder” on<br />

page 16).<br />

3. Open your browser window. In the address bar type<br />

http:\\[localhost]:8080\wms\MapViewerTemplate1.html<br />

Replace [localhost] by the name of the computer or IP address<br />

where Tomcat is installed.<br />

4. Press ENTER.<br />

Using the Templates for Your Web Page<br />

As described in “Introducing the Templates” on page 51, <strong>Geomatica</strong><br />

<strong>WebServer</strong> offers you six different templates that you can use as is<br />

or modify to suit your needs. Of course, if you are at ease with<br />

HTML, you can create your own Web page.<br />

To create a Web page for your project, you must:<br />

1. Create an applet configuration file using Extensible Markup<br />

Language (XML).<br />

2. Create a Hypertext Markup Language (HTML) file.<br />

Creating Your Applet’s XML File<br />

The XML file contains the names of the layers in the project and<br />

other data required to form the HTML file. Since <strong>Geomatica</strong><br />

<strong>WebServer</strong> is compliant with the Open Geospatial® Web Map<br />

Server Interface Implementation Specification, Revision 1.1.1, you<br />

can generate a capabilities document from your project and use it to<br />

create your project’s XML file. A Capabilities document is an XML<br />

file that conforms to the Capabilities Interface DTD. The XML file<br />

can list the interfaces that the Map Server supports, the layers the<br />

map contains, and what formats it can use.<br />

To create your XML file:<br />

1. Start the Tomcat server.<br />

2. Start the <strong>Geomatica</strong> <strong>WebServer</strong> Monitor with your project.<br />

3. In your browser type:<br />

http://[localhost]:8080/wms/AppletConfigServlet<br />

Replace [localhost] by the name of the computer or IP address<br />

where Tomcat is installed.<br />

4. Press ENTER.<br />

5. On the Web page in the Address box, type<br />

http://[localhost]:8080/wms/WMSServlet<br />

Replace [localhost] by the name of the computer or IP address<br />

where Tomcat is installed.<br />

6. Click Connect.<br />

7. Under LayerID, select the layers that you want to include in your<br />

Web page.<br />

8. Under Queryable, select the layers that will support queries.<br />

52 PCI Geomatics


Using the Templates for Your Web Page<br />

9. Under Format, select the graphics file format that you want to use.<br />

10. Click Save As.<br />

11. Click Save to download the file to your computer, and save the<br />

XML file in \webapps\wms\Config in the folder where you installed<br />

Tomcat.<br />

Matching the Coordinate System Between Your Project and<br />

Web Page<br />

The measurement tools and any button that you program to display<br />

the coordinates in the status bar will display the coordinates in paper<br />

units (EPSG:NONE) by default. You can change the default to the<br />

EPSG (European Petroleum Survey Group) coordinate system used<br />

in your project.<br />

Table 13: EPSG codes<br />

Code Unit<br />

none millimeters<br />

4000 to 5000 degrees<br />

All others meters<br />

To use the same coordinate system as your project:<br />

1. Start Tomcat and <strong>Geomatica</strong> <strong>WebServer</strong> Monitor with your project.<br />

2. Type the following in the address bar of your browser:<br />

http://[localhost]:8080/wms/<br />

WMSServlet?wmtver=1.0.0&request=capabilities<br />

Replace [localhost] by the name of the server where your project is<br />

located.<br />

3. Locate the EPSG code used for your layers. For example, the<br />

“Lakes” layer in the Newport project is SRS="EPSG:26711".<br />

4. Open the applet’s XML file that you created in a text editor, such as<br />

Wordpad.<br />

5. Above the map element, type the viewport element with the EPSG<br />

code.<br />

6. Save the XML file.<br />

Below is an example of how the layers.xml file from<br />

\webapps\wms\Config in the folder where you installed Tomcat would<br />

look like with the viewport element:<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

Creating Your HTML File from an Example<br />

The HTML file contains the data required for browsers to display<br />

your Web page. You can use one of the MapViewerTemplate.html<br />

<strong>Geomatica</strong> <strong>WebServer</strong> Suite <strong>Installation</strong> <strong>Guide</strong> 53


Chapter 6 - Publishing Your Maps on the WMS Servlet or a Web Page<br />

files located in \webapps\wms in the folder where you installed Tomcat<br />

as an example.<br />

To create your HTML file using one of the templates:<br />

1. Make a copy of a MapViewerTemplate.html file in \webapps\wms in<br />

the folder where you installed Tomcat (copy and paste into wms).<br />

For a description of the differences between the templates, refer to<br />

“Introducing the Templates” on page 51.<br />

2. Rename the copy of the MapViewerTemplate according to your<br />

project so it will be easier to identify later.<br />

For example, change Copy of MapViewerTemplate3.html to<br />

MyProject.html.<br />

3. Open the HTML file in a text editor, such as Notepad.<br />

4. Locate the applet in the HTML file and replace the XML file in the<br />

applet with your project’s XML file. The XML file and the applet<br />

must be on the same computer. For example, below is the applet<br />

declared in the MapViewerTemplate3.html. You would replace<br />

“layers.xml” by “MyProjectLayers.xml”.<br />

<br />

<br />

<br />

5. Replace ALL of the other project’s layer names by the ones in your<br />

project making sure to type them exactly as they appear in the<br />

project. For example, below is the code for the Lakes layer in the<br />

MapViewerTemplate3.html. You would replace “Lakes” by the your<br />

layer names:<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

Lakes<br />

<br />

6. Delete any unneeded sections. The layers that are queryable contain<br />

an index to describe the order of the layers so make sure that the<br />

numbering is in sequence. For example, the number “3” in the<br />

example from step 5 indicates that this layer is the third in the HTML<br />

file:<br />

ONCLICK="javascript:LayerQueryableSimple(3,'vue')"<br />

7. Save the HTML file.<br />

8. Start the <strong>Geomatica</strong> <strong>WebServer</strong> Monitor with your project in the<br />

Target box (see “Starting the <strong>Geomatica</strong> <strong>WebServer</strong> Monitor” on<br />

page 49).<br />

9. Restart Tomcat (see “Exploring the WCS Folder” on page 16).<br />

10. Open your browser window.<br />

11. In the address bar type<br />

http://[localhost]:8080/wms/MyProject.html<br />

Replace [localhost] by the name of the computer where your<br />

project is located and replace MyProject.html by the HTML file<br />

that you created for your project.<br />

12. Press ENTER.<br />

Making Your Own Web Page<br />

You can modify the templates to customize the look and<br />

functionality of your Web page or create your own from scratch. To<br />

54 PCI Geomatics


Making Your Own Web Page<br />

create a Web page you need a layout containing the applet and<br />

various functions that you can apply to the applet, such as zoom, pan,<br />

and query functions.<br />

In the HTML file you design how the Web page is going to look. The<br />

JSMapViewer.js, Query.js, and Measurement.js files are the source<br />

files for the JavaScripts that can be used in your Web page. These<br />

files are in \webapps\wms\JavaScript in the folder where you installed<br />

Tomcat.<br />

HTML uses the JavaScript to load functions from the MapViewer.jar<br />

file. The MapViewer.jar file contains the class files and auxiliary<br />

resources for the applet and its applications. It is in \webapps\wms<br />

in the folder where you installed Tomcat.<br />

For the HTML, JavaScript and MapViewer.jar files to function<br />

together, the applet name must remain consistent throughout the<br />

HTML file. For example, the MapViewerTemplate4.html uses the<br />

name “vue” as the applet name:<br />

<br />

<br />

<br />

and it contains the following for the Pan button:<br />

<br />

The browser will use the “javascript:Pan('vue')” to find the<br />

Pan function in the JSMapViewer.js file, and then the<br />

JSMapViewer.js file refers to the MapViewer.jar file for the Pan<br />

function.<br />

Displaying Layers<br />

Most of the MapViewerTemplates display rows of check boxes. The<br />

row labeled “View” enables the users to select the layers they want<br />

to see.<br />

The “checkForm” check boxes are designed to show or hide layers<br />

in a project. For example, the MapViewerTemplate2.html contains<br />

the following code used to display a check box for the user to select<br />

a layer and the code for an APPLY button. The APPLY button<br />

enables users to select several layers before performing the function.<br />

<br />

<br />

Lakes<br />

<br />

<br />

The MapViewerTemplate2.html uses the name “vue” as the applet<br />

name. The browser will use the “javascript:LayerOnOff('vue')”<br />

to find the LayerOnOff function in the JSMapViewer.js file.<br />

Normally, you will have several layers selectable so you would<br />

create a loop to verify which layers are selected, retrieve the selected<br />

layers, and refresh the applet, as was done for the LayerOnOff<br />

function in the JSMapViewer.js file.<br />

Creating Queryable Layers<br />

Most of the MapViewerTemplates display rows of check boxes. The<br />

row labeled “Query” enables the users to select the layers for a<br />

query. The query boxes are used in conjunction with a query button<br />

of some kind. The response to the query is displayed in a new<br />

browser window.<br />

The “checkFormQuery” check boxes are designed to prepare layers<br />

for queries on the map layer’s attributes. For example, the<br />

<strong>Geomatica</strong> <strong>WebServer</strong> Suite <strong>Installation</strong> <strong>Guide</strong> 55


Chapter 6 - Publishing Your Maps on the WMS Servlet or a Web Page<br />

MapViewerTemplate3.html contains the following code for the<br />

query box for the Lakes layer:<br />

<br />

The MapViewerTemplate3.html uses the name “vue” as the applet<br />

name. The browser will use the “javascript:LayerQueryable<br />

Simple(3,'vue')” to find the LayerQueryableSimple function in<br />

the JSMapViewer.js file.<br />

Note<br />

Remember to declare your layers as queryable in the applet’s<br />

configuration file.<br />

Adding Buttons<br />

The MapViewerTemplate HTML files, except<br />

MapViewerTemplate1.html, display a number of default buttons.<br />

You may want to remove some of the buttons, change their style or<br />

use the buttons in your own Web page. The buttons that appear in the<br />

various MapViewerTemplates are shown and explained in the<br />

Readme.html Web page (see “Introducing the Templates” on<br />

page 51) in Reference for Tool Buttons. All the graphics for the<br />

buttons, including some not seen in the MapViewerTemplates, are<br />

located in \webapps\wms\images in the folder where you installed<br />

Tomcat.<br />

Each graphic in the images folder has an “on” version and an “off”<br />

version. The HTML files, except MapViewerTemplate1.html,<br />

include a variable called ArrayButtonName that controls the<br />

appearance of the buttons as they are clicked. To change the graphics<br />

used for the buttons, you can replace the file names of graphics with<br />

those in the images folder. For example, the following HTML<br />

element displays the ArrayButtonName variable shown in<br />

MapViewerTemplate2.html:<br />

<br />

<br />

<br />

<br />

<br />

After the appearance of the button is programmed, you must<br />

program the functionality of the button. The functionality of the<br />

button is controlled by JavaScript from the JSMapViewer.js,<br />

Query.js, or Measurement.js files. For example, the following is the<br />

HTML element for the pan button as shown in<br />

MapViewerTemplate2.html:<br />

<br />

• The SRC attribute declares the path for the graphic used with the<br />

tool.<br />

• The NAME attribute identifies the button in the ArrayButtonName<br />

variable.<br />

• The BORDER attribute determines the width of the button’s outline.<br />

56 PCI Geomatics


Making Your Own Web Page<br />

• The WIDTH and HEIGHT attributes determine the size of the button<br />

in pixels.<br />

• The ALT attribute contains the text string that you want to use if the<br />

graphic is not supperted by the browser, which may also function as a<br />

ToolTip on some browsers.<br />

• The ONMOUSEDOWN attribute determines the actions taken when<br />

you click the button. For example, the browser uses<br />

“javascript:Pan(‘vue’)” to find the Pan function in the<br />

JSMapViewer.js file. The browser uses<br />

“toggleAllButton('pan',ArrayButtonName,8)” to find the<br />

toggleAllButton function in the JSMapViewer.js file. The<br />

toggleAllButton function finds the graphics used in the<br />

ArrayButtonName variable so the pan button can appear on and off<br />

when clicked. The “8” represents the total number of buttons in the<br />

ArrayButtonName variable.<br />

Changing Zoom Values<br />

The JSMapViewer.js file includes several JavaScripts for zoom<br />

functions. The Zoom Functions in Table 14 are programmed with<br />

default values. As explained in “Adding Buttons” on page 56, you<br />

can create buttons with selectable zoom values by changing the<br />

JavaScript used in the ONMOUSEDOWN attribute to one described<br />

in Table 15.<br />

Table 14: Fixed Zoom Functions<br />

JavaScript Function Button Description<br />

ZoomInDefault<br />

(Appletname)<br />

ZoomOutDefault<br />

(Appletname)<br />

ZoomInPercentDefault<br />

(Appletname)<br />

Zoom In<br />

Used to increase the<br />

magnification by a factor of 2.<br />

Zoom Out<br />

Used to decrease the<br />

magnification by a factor of 2.<br />

Zoom In Percent<br />

Used to increase the<br />

magnification by 25 percent.<br />

Table 14: Fixed Zoom Functions<br />

JavaScript Function Button Description<br />

ZoomOutPercentDefaul<br />

t<br />

(Appletname)<br />

ZoomWindow<br />

(Appletname)<br />

ZoomZoom<br />

(Appletname)<br />

PanAndZoom<br />

(Appletname)<br />

Table 15: Programmable Zoom Functions<br />

JavaScript Function Description<br />

ZoomIn(Appletname)<br />

ZoomOut(Appletname)<br />

ZoomInPercent(Appletname)<br />

Zoom Out Percent<br />

Used to decrease the<br />

magnification by 25 percent.<br />

Zoom Window<br />

Used to increase the<br />

magnification within a frame<br />

drawn in the applet.<br />

Progressive Zoom<br />

Used to decrease or increase the<br />

magnification as you drag the<br />

mouse up or down in the applet.<br />

Zoom and Pan<br />

Used to assign the function Pan<br />

to the left mouse button, and the<br />

ZoomZoom to the right mouse<br />

button.<br />

Used in combination with a dropdown<br />

combo box to increase the<br />

scale by a list of values.<br />

Used in combination with a dropdown<br />

combo box to decrease the<br />

scale by a list of values.<br />

Used in combination with a dropdown<br />

combo box to increase the<br />

magnification by a list of percent<br />

values.<br />

<strong>Geomatica</strong> <strong>WebServer</strong> Suite <strong>Installation</strong> <strong>Guide</strong> 57


Chapter 6 - Publishing Your Maps on the WMS Servlet or a Web Page<br />

Table 15: Programmable Zoom Functions<br />

JavaScript Function Description<br />

ZoomOutPercent(Appletname)<br />

Creating a Combo Box<br />

By using the ZoomIn(Appletname) and ZoomOut(Appletname)<br />

JavaScripts and inserting a drop-down combo box named “Factor”<br />

in the HTML file, you can offer a range of values for the users to<br />

select instead of relying on the default factor of 2. For example, the<br />

following HTML code displays the drop-down combo box with a list<br />

of factors as shown in Figure 6.3:<br />

<br />

<br />

<br />

<br />

Zoom Factor :<br />

<br />

<br />

<br />

<br />

2<br />

3<br />

4<br />

5<br />

<br />

<br />

Figure 6.3: Factor Combo Box<br />

Used in combination with a dropdown<br />

combo box to decrease the<br />

magnification by a list of percent<br />

values.<br />

By using ZoomInPercent(Appletname) and<br />

ZoomOutPercent(Appletname) and inserting a drop-down combo<br />

box named “ZoomPercentForm” in the HTML file, you can offer a<br />

range of percent values for the users to select instead of relying on<br />

the default factor of 25 percent. For example, the following HTML<br />

code displays a drop-down combo box with a list of percent values<br />

as shown in Figure 6.4:<br />

<br />

<br />

<br />

<br />

Zoom Percent :<br />

<br />

<br />

<br />

<br />

10<br />

25<br />

50<br />

75<br />

<br />

<br />

Figure 6.4: ZoomPercentForm Combo Box<br />

Adding Measurement Tools<br />

The Measurement.js file contains three measurement tools that you<br />

can use in your Web page. The JavaScript in the Measurement.js file<br />

is the link between the HTML file and the Mapviewer.jar file. The<br />

HTML uses the JavaScript to load functions from the MapViewer.jar<br />

file.<br />

By default the status bar uses EPSG NONE, which results in the<br />

applet displaying in paper units (mm). If you want the status bar to<br />

display the units in the georeferencing from your project, see<br />

“Matching the Coordinate System Between Your Project and Web<br />

Page” on page 53.<br />

58 PCI Geomatics


Making Your Own Web Page<br />

All three measurement tools appear in MapViewerTemplate4.html.<br />

They are designed to display specific values in the status bar as you<br />

use the tool in the applet. Each tool is described in Table 16 on<br />

page 59. To add the measurement tools to your Web page, you need<br />

to:<br />

• Include the Measurement.js and JSMapViewer.js files in the HTML<br />

file under “Call JavaScript library”<br />

• Include the graphics for the buttons in the ArrayButtonName code<br />

(see “Adding Buttons” on page 56)<br />

• Program the button’s functionality<br />

For example, the MapViewerTemplate4.html contains the following<br />

examples in the ArrayButtonName code:<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

Table 16: Measurement Tools<br />

JavaScript Function Button Description<br />

lengthMeasure<br />

(Appletname)<br />

areaMeasure<br />

(Appletname)<br />

circleMeasure<br />

(Appletname)<br />

Adding Query Buttons<br />

Line Tool<br />

Used to display in the status bar<br />

the values for the x and y<br />

coordinates of the cursor, the<br />

length of the line, the unit of<br />

measurement, and the length of<br />

the last line segment.<br />

Area Tool<br />

Used to display in the status bar<br />

the values for the x and y<br />

coordinates of the cursor, the<br />

perimeter and area of the shape,<br />

and the unit of measurement.<br />

Circle Tool<br />

Used to display in the status bar<br />

the values for the x and y<br />

coordinates of the cursor, the<br />

coordinates of the center of the<br />

circle, the radius, the perimeter,<br />

and area of the circle, and the<br />

unit of measurement.<br />

The query tools are designed to retrieve and display the requested<br />

attributes from your project. The MapViewerTemplates contain<br />

several query tools: query buttons, saved queries, and query<br />

expressions. This section explains the query buttons. For<br />

information about the saved queries, see “Adding Shortcuts to Saved<br />

Queries” on page 63. For information about the query expressions,<br />

see “Providing a Tool to Build Query Expressions” on page 63.<br />

<strong>Geomatica</strong> <strong>WebServer</strong> Suite <strong>Installation</strong> <strong>Guide</strong> 59


Chapter 6 - Publishing Your Maps on the WMS Servlet or a Web Page<br />

The Query.js file contains the JavaScript that you need to add the<br />

query buttons to your Web page. The JavaScript in the Query.js and<br />

JSMapViewer.js files are the link between the HTML file and the<br />

Mapviewer.jar file. The HTML uses the JavaScript to load functions<br />

from the MapViewer.jar file.<br />

General Query Button<br />

The General Query button appears in MapViewerTemplate3.html,<br />

MapViewerTemplate5.html, and MapViewerTemplate6.html. It<br />

retrieves and displays all the attributes from the selected layers.<br />

Adding the General Query button to your Web page is similar to<br />

adding the measurement tools (see “Adding Measurement Tools” on<br />

page 58) to your Web page. You need to include the JSMapViewer.js<br />

and the Query.js files in the HTML file under “Call JavaScript<br />

library”, and you need to include the graphics for the buttons in the<br />

ArrayButtonName variable (see “Adding Buttons” on page 56).<br />

In addition to the ArrayButtonName variable, you also need to add<br />

code to automatically return the button to its original state after the<br />

query is performed, otherwise the button will appear “on” even<br />

though the query is complete. For example, the following code<br />

appears below the ArrayButtonName variable in<br />

MapViewerTemplate5.html:<br />

function toggleInfoQuery()<br />

{<br />

document.images['query'].src='images/off_car_info.gif';<br />

}<br />

After the appearance of the button is programmed, you must<br />

program the functionality of the button. The functionality of the<br />

button is controlled by JavaScript from the JSMapViewer.js and the<br />

Query.js files. For example, the following is the HTML element for<br />

the General Query button as shown in MapViewerTemplate5.html:<br />

<br />

ONMOUSEDOWN="javascript:LayerQueryable('vue');<br />

DisplayFeatureInfo('vue','xslt.xslt');<br />

toggleAllButton('query',ArrayButtonName,13);<br />

setTimeout('toggleInfoQuery()',2500)"<br />

The SRC, NAME, BORDER, WIDTH, HEIGHT, and ALT<br />

attributes are described in “Adding Buttons” on page 56. The<br />

ONMOUSEDOWN attribute determines the actions taken when you<br />

click the General Query button. For example, the browser uses:<br />

•“javascript:LayerQueryable(‘vue’)” to find the<br />

LayerQueryable function in the JSMapViewer.js file, which verifies<br />

which layers were selected for the query.<br />

•“DisplayFeatureInfo('vue','xslt.xslt')” to find the<br />

DisplayFeatureInfo function in the Query.js file, which retrieves and<br />

displays the attributes from the selected layers using the layout<br />

described in the xslt.xslt file. XSLT is a style sheet language which<br />

governs how the data retrieved from the project is presented.<br />

•“toggleAllButton('query',ArrayButtonName,13)” to find the<br />

toggleAllButton function in the JSMapViewer.js file, which finds the<br />

graphics used in the ArrayButtonName variable so the button can<br />

appear on and off when clicked. The “13” represents the total number<br />

of buttons in the ArrayButtonName variable.<br />

•“setTimeout('toggleInfoQuery()',2500)” to automatically<br />

return the button to its original status after a specified delay. The<br />

toggleInfoQuery function, which appears in the HTML file below the<br />

ArrayButtonName variable, defines the appearance of the button, and<br />

the “2500” defines the delay in milliseconds.<br />

Table 17: General Query Button<br />

JavaScript Function Button Description<br />

DisplayFeatureInfo<br />

(AppletName,xsltFile)<br />

General Query<br />

Used to retrieve and display all<br />

the attributes from the selected<br />

layers.<br />

60 PCI Geomatics


Making Your Own Web Page<br />

Spatial Query Buttons<br />

The Spatial Query buttons retrieve and display in a separate window<br />

the attributes from specified areas on the selected layers. The Query<br />

Select Point button appears in MapViewerTemplate4.html. The Line<br />

Tool, Line Query, Polygon Tool, and Polygon Query buttons appear<br />

in MapViewerTemplate5.html. To perform the query, the user makes<br />

a layer available for queries (see “Creating Queryable Layers” on<br />

page 55) and then chooses the query button according to the results<br />

they desire.<br />

Query Select Point button: Adding the Query Select Point button<br />

to your Web page is the same as adding the General Query button to<br />

your Web page (see “General Query Button” on page 60), except the<br />

graphics used in the ArrayButtonName variable and<br />

toggleInfoQuery function are different, and the JavaScript for the<br />

ONMOUSEDOWN is different as shown in<br />

MapviewerTemplate4.html:<br />

var ArrayButtonName =<br />

[['query','images/off_car_inf_point.gif','images/<br />

on_car_inf_point.gif']<br />

function toggleInfoQuery()<br />

{<br />

document.images['query'].src='images/off_car_inf_<br />

point.gif';<br />

}<br />

<br />

The ONMOUSEDOWN attribute for the Query Select Point button<br />

uses “javascript:QueryPointMode('vue','QueryResults')” to<br />

find the QueryPointMode function in the Query.js file.<br />

Tip<br />

If you are familiar with creating HTML files with frames, the JavaScript for<br />

Query Select Point contains the windowName parameter, which you can<br />

use to display the query result in a frame in your Web page instead of in<br />

separate window.<br />

Line Query and Polygon Query buttons: Adding the other Spatial<br />

Query buttons to your Web page is similar to adding the General<br />

Query button (see “General Query Button” on page 60), except they<br />

each need an additional button to work. The Line Query and Polygon<br />

Query buttons need the Line and Polygon tools respectively to<br />

identify the specific location in the applet to query. Therefore, you<br />

need to:<br />

• Include the JSMapViewer.js and the Query.js files in the HTML file<br />

under “Call JavaScript library”.<br />

• Include the graphics for the spatial query buttons and their<br />

corresponding tools in the ArrayButtonName variable (see “Adding<br />

Buttons” on page 56). For example, the following is in<br />

MapViewerTemplate5.html:<br />

var ArrayButtonName =<br />

['line','images/off_car_crt_line.gif','images/<br />

on_car_crt_line.gif'],<br />

['polygon','images/off_car_crt_poly.gif','images/<br />

on_car_crt_poly.gif'],<br />

['lineQuery','images/off_car_inf_line.gif','images/<br />

on_car_inf_line.gif'],<br />

['polygonQuery','images/<br />

off_car_inf_poly.gif','images/<br />

on_car_inf_poly.gif']];<br />

• Add code to automatically return each query button to its original<br />

state after the query is performed, otherwise the spatial query buttons<br />

will appear “on” even though the query is complete. For example, the<br />

code to do this appears below the ArrayButtonName variable in<br />

MapViewerTemplate5.html:<br />

function toggleInfoQueryLine()<br />

{<br />

<strong>Geomatica</strong> <strong>WebServer</strong> Suite <strong>Installation</strong> <strong>Guide</strong> 61


Chapter 6 - Publishing Your Maps on the WMS Servlet or a Web Page<br />

document.images['lineQuery'].src = 'images/off_car_<br />

inf_line.gif';<br />

}<br />

function toggleInfoQueryPoly()<br />

{<br />

document.images['polygonQuery'].src = 'images/off_car_<br />

inf_poly.gif';<br />

}<br />

• Program the functionality of the buttons. The functionality of a<br />

button is controlled by JavaScript from the JSMapViewer.js and the<br />

Query.js files. For example, the following are the HTML elements<br />

for the Line tool, Polygon Tool, Line Query and Polygon Query in<br />

MapViewerTemplate5.html:<br />

<br />

<br />

<br />

<br />

The SRC, NAME, BORDER, WIDTH, HEIGHT, and ALT<br />

attributes are described in “Adding Buttons” on page 56. The<br />

LayerQueryable, toggleAllButton and setTimeout attributes are<br />

described in “General Query Button” on page 60. The<br />

ONMOUSEDOWN attribute determines the actions taken when you<br />

click the buttons. For example, the browser uses:<br />

•“javascript:Line(‘vue’)” from the Line Tool to find the Line<br />

function in the Query.js file. You use the Line Tool to draw a line in<br />

the applet to identify the location that you want to query.<br />

•“javascript:Polygon(‘vue’)” from the Polygon Tool to find the<br />

Polygon function in the Query.js file. You use the Polygon Tool to<br />

draw a polygon in the applet to identify the area that you want to<br />

query.<br />

•“SendQuery('vue','HTML','Intersect')” from the Line Query<br />

and Polygon Query buttons to find the SendQuery function in the<br />

Query.js file. The SendQuery function retrieves and displays the<br />

attributes from the selected layers for the area identified by the line or<br />

polygon. The “vue” is the applet’s name. The “HTML” declares that<br />

the attributes will be displayed in HTML using the layout described<br />

in the xslt.xslt file. You can also replace “HTML” with “XML”. The<br />

“Intersect” spatial filter defines which attributes are retrieved. For<br />

polygons, you can replace “Intersect” with Crosses, Overlap, or<br />

Within. More explanations for the Spatial Queries appear in the<br />

Readme.html Web page (see “Introducing the Templates” on<br />

page 51) in the Query folder in Spatial Query.<br />

Table 18: Spatial Query Tools<br />

JavaScript Function Button Description<br />

QueryPointMode('vue',<br />

'QueryResults')<br />

Line(‘vue’)<br />

Query Select Point<br />

Used to request attributes from<br />

features in your project by<br />

selecting a point in the applet.<br />

Line Tool<br />

Used to draw a line in the applet.<br />

62 PCI Geomatics


Making Your Own Web Page<br />

Table 18: Spatial Query Tools<br />

JavaScript Function Button Description<br />

SendQuery('vue',<br />

'HTML','Intersect')<br />

Polygon(‘vue’)<br />

SendQuery('vue',<br />

'HTML','Intersect')<br />

Providing a Tool to Build Query Expressions<br />

A query expression is a combination of operators, functions,<br />

constants, and variables that you use to retrieve specific attributes<br />

from a layer. To provide query expressions from your Web page, you<br />

need to program a button to open a new window that you can use to<br />

build query expressions. The WMS provides a form, called<br />

Post.html, that contains several options you can use to create the<br />

window for the query expressions. Post.html is in \webapps\wms in<br />

the folder where you installed Tomcat.<br />

For example, the following appears before the ArrayButtonName<br />

variable and below the Overview applet in<br />

MapViewerTemplate6.html:<br />

function redirectWindow()<br />

{<br />

window.open("Post.html");<br />

}<br />

Line Query<br />

Used to request attributes from<br />

the features from the selected<br />

layers in your project. The<br />

features are identified by the line<br />

drawn in the applet.<br />

Polygon Tool<br />

Used to draw a polygon in the<br />

applet.<br />

Polygon Query<br />

Used to request attributes from<br />

the features from the selected<br />

layers in your project. The<br />

features are identified by the<br />

polygon drawn in the applet.<br />

<br />

The ONCLICK attribute uses “javascript:redirectWindow()” to<br />

find the redirectWindow function in the HTML file. The<br />

“redirectWindow()” function opens a new browser window using<br />

Post.html. The Post.html is a form that the user completes. When the<br />

user clicks Send Request, it retrieves and displays the attributes from<br />

the selected layer .<br />

Adding Shortcuts to Saved Queries<br />

Saved queries are useful when you have to repeatedly perform a<br />

query. Saved queries retain the expression, not the results.<br />

Therefore, you can avoid recreating the query expression every time<br />

that you need to perform the query. You can add as many saved<br />

queries to your Web page as you require.<br />

To add a saved query to your Web page, you can simply create and<br />

program a button, such as:<br />

<br />

The browser will use the<br />

“javascript:PropertyQuery('vue','length>0.6',<br />

'RoadNetwork')” to find the PropertyQuery function in the<br />

Query.js file. The PropertyQuery function retrieves and displays the<br />

attributes that results from the query expression. The “vue” is the<br />

applet’s name. The “length> 0.6” is the query expression. You can<br />

build the expression using any of the operators available in<br />

GDBQuery explained at www.pcigeomatics.com/cgi-bin/pcihlp/<br />

gdbquery. The results are displayed by default in HTML using the<br />

layout described in the xslt.xslt file. The “RoadNetwork” identifies<br />

the layer to be queried.<br />

<strong>Geomatica</strong> <strong>WebServer</strong> Suite <strong>Installation</strong> <strong>Guide</strong> 63


Chapter 6 - Publishing Your Maps on the WMS Servlet or a Web Page<br />

However, you can make the saved query more evident by providing<br />

a concise description of the query with the button, such as the<br />

example that appears in MapViewerTemplate5.html, which is nested<br />

in a table:<br />

<br />

<br />

<br />

<br />

SAVED QUERY<br />

<br />

<br />

<br />

Hydrological channels with a length greater than 10 km:<br />

<br />

<br />

<br />

<br />

<br />

Adding a Tool to Display the Coordinates in the<br />

Status Bar<br />

You can design a tool to retrieve the coordinates on-the-fly and<br />

display them in the status bar. You can assign this functionality to<br />

the cursor itself or to a button.<br />

To change the cursor so it displays the coordinates, you<br />

need to:<br />

• Assign the function to the cursor. For example:<br />

function displayCoordinate()<br />

{<br />

document.applets['vue'].cursorTool();<br />

}<br />

• Activate the function when the page opens. For example:<br />

<br />

<br />

To add a button to your Web page with the<br />

displayCoordinate function, you need to:<br />

• Include the JSMapViewer.js file in the HTML file under “Call<br />

JavaScript library”.<br />

• Include the graphics for the buttons in the ArrayButtonName code<br />

(see “Adding Buttons” on page 56). For example:<br />

var ArrayButtonName =<br />

['Point','images/off_car_xy.gif','images/<br />

on_car_xy.gif'],<br />

• Program the button’s functionality. For example:<br />

<br />

The SRC, NAME, BORDER, WIDTH, HEIGHT, and ALT<br />

attributes are described in “Adding Buttons” on page 56. The<br />

toggleAllButton attribute is described in “General Query Button” on<br />

page 60. The ONMOUSEDOWN attribute uses<br />

“javascript:displayCoordinate('vue')” to find the<br />

displayCoordinate function in the JSMapViewer.js file.<br />

By default the status bar displays in paper units (mm). If you want<br />

the status bar to display the units using the projection from your<br />

project, see “Matching the Coordinate System Between Your Project<br />

and Web Page” on page 53.<br />

Displaying an Overview of Your Project<br />

The Overview is a small viewer that displays your entire project.<br />

When you zoom in, a frame appears in the Overview to highlight the<br />

64 PCI Geomatics


Making Your Own Web Page<br />

location that you are currently displaying in the applet. To include<br />

the Overview in your Web page, add the Overview HTML code to<br />

your HTML file. For example, the following HTML code displays<br />

the Overview shown in MapViewerTemplate3.html:<br />

<br />

<br />

<br />

<strong>Geomatica</strong> <strong>WebServer</strong> Suite <strong>Installation</strong> <strong>Guide</strong> 65


Chapter 6 - Publishing Your Maps on the WMS Servlet or a Web Page<br />

66 PCI Geomatics


Configuring the WMS MapViewer Applet<br />

Configuring the MapViewer Applet<br />

To display your project in a Web page, you need the WMS servlet<br />

and the WMS client that consists of the applet and browser. The<br />

WMS servlet is explained in “Configuring the Servlet for the Web<br />

Mapping Service (WMS)” on page 39. The HTML file is explained<br />

in “Publishing Your Maps on the WMS Servlet or a Web Page” on<br />

page 49. The MapViewer Applet is inserted into the HTML file<br />

containing the data required for browsers to display your Web page.<br />

For example, the following is the MapViewer Applet declared in the<br />

MapViewerTemplate3.html:<br />

<br />

<br />

<br />

The “Config” parameter specifies the file name of the configuration<br />

file (XML file) that the MapViewer Applet requires. The default<br />

C HAPTER<br />

7<br />

configuration file for MapViewerTemplate1.html is AllProject.xml<br />

and for the rest of the MapViewerTemplates it is layers.xml.<br />

Creating the Applet’s Configuration File<br />

The configuration file provides the MapViewer Applet with<br />

instructions to connect to the WMS servlet, the name of the server<br />

where the project data is located, the name of the layers that it can<br />

display, and other information concerning how to display the data.<br />

The MapViewer Applet’s configuration file can be as simple as the<br />

AllProject.xml or the layers.xml files (provided in \webapps\wms<br />

in the folder where you installed Tomcat ) or as complex as you want<br />

to make it.<br />

The MapViewer.dtd is a DTD that contains the formal definitions of<br />

all of the data elements the MapViewer Applet’s configuration file.<br />

By consulting the MapViewer.dtd, you can validate any<br />

modifications that you make to the file. You can create a<br />

configuration file for the MapViewer Applet by using one of these<br />

methods:<br />

• Modify the AllProject.xml or layers.xml files.<br />

67


Chapter 7 - Configuring the WMS MapViewer Applet<br />

• Create your own by using a text editor or an XML editor (or any<br />

programming language, such as Java, Javascript, Python, or C/C++).<br />

Using the AllProject.xml file as an example is the simplest way to<br />

describe the syntax of the MapViewer Applet’s configuration file.<br />

AllProject.xml is an XML file generated by <strong>Geomatica</strong> Focus that<br />

merges all the project’s map layers into one layer.<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

The first line in the example indicates that the document is based on<br />

XML version 1.0 and the encoding is UTF-8:<br />

<br />

The AllProject.xml file uses a DTD so the second line is a<br />

DOCTYPE definition. The DOCTYPE definition declares what type<br />

of document the XML file is and which DTD it follows. In the<br />

AllProject.xml example, the DOCTYPE declares that the file is a<br />

“mapviewer-config” document and it follows the DTD file<br />

“MapViewer.dtd”:<br />

<br />

The DOCTYPE definition must appear after the XML declaration,<br />

but before the first element in the configuration file. The next line<br />

following the DOCTYPE definition in the AllProject.xml example<br />

states the root element (see “Defining the “Mapviewer-Config” Root<br />

Element” on page 69):<br />

<br />

The next line in the example provides information about the<br />

connection and protocol used to get the map information from a Web<br />

mapping server (WMS) compliant with the Open Geospatial®<br />

Consortium (OGC) using the protocol WMS version 1.0.0 or 1.1.1.<br />

You can expand this element using several attributes explained in<br />

“Using the WMSProvider Element” on page 70.<br />

<br />

The next lines shown in the example state the “map” element with a<br />

“maplayer” identified by a unique “layerid”. The “map” element<br />

does not include a layer ID, because it is a container for map layers<br />

and it cannot be requested from the WMS (see “Using the “Map”<br />

Element” on page 71). The layer ID corresponds to the name of the<br />

layer in the Capabilities file, which is “AllProject” in the example:<br />

<br />

<br />

<br />

The “” is also equivalent to:<br />

<br />

When this element is parsed, the MapViewer Applet verifies if the<br />

layer with the indicated layer ID is available on the server (see<br />

“Using the “Maplayer” Child Element” on page 71). If the layer is<br />

found, it is initialized with information coming from the Capabilities<br />

file, such as title and description. By using additional attributes and<br />

children elements, you can control the map information retrieved<br />

from the Capabilities file to customize the map layer information or<br />

and support for different languages.<br />

Adding Several Map Layers<br />

You can also retrieve more than one map layer with the<br />

configuration file. By adding “maplayer” elements within the “map”<br />

68 PCI Geomatics


Creating the Applet’s Configuration File<br />

element, you can display more than one map layer. The following<br />

example includes two map layers:<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

You can retrieve the names of the layers in your project by opening<br />

the project in <strong>Geomatica</strong> or by generating the Capabilities file (see<br />

“Generating a Capabilities File” on page 73).<br />

Defining the “Mapviewer-Config” Root Element<br />

The “mapviewer-config” element is the root of the MapViewer<br />

applet’s configuration file. The MapViewer applet is only able to<br />

connect to an OGC Web Mapping Service using the WMS protocol<br />

version 1.0.0 or 1.1.1 (see www.opengeospatial.org for more<br />

details). The mapviewer-config element is defined in the DTD as<br />

follows:<br />

<br />

<br />

Using the Viewport Element<br />

The “viewport” element determines the extent of the initial view.<br />

When the viewer starts, it displays an overview of the map by<br />

default. You can modify the bounding box and the Spatial Reference<br />

System (SRS) as required. To configure the initial bounding box,<br />

add the “viewport” element immediately after the root element. By<br />

default the “viewport” element is EPSG:NONE. The “viewport”<br />

element is defined in the DTD as follows:<br />

<br />

<br />

Using the “Extent” Child Element<br />

The “extent” element is a child of the “viewport” element. It<br />

indicates the values to specify the bounds of a map layer. The<br />

“extent” child element contains the “minx”, “miny”, “maxx”, and<br />

“maxy” attributes. The “extent” child element is defined in the DTD<br />

as follows:<br />

<br />

<br />

<br />

<br />

<strong>Geomatica</strong> <strong>WebServer</strong> Suite <strong>Installation</strong> <strong>Guide</strong> 69


Chapter 7 - Configuring the WMS MapViewer Applet<br />


Creating the Applet’s Configuration File<br />

type: The “type” attribute identifies where the map information is<br />

coming from. <strong>Geomatica</strong>’s Web Mapping Service currently only<br />

supports the OGC Web mapping Server, which is why the value of<br />

the attributes is fixed to "OGC-WMT".<br />

version: The “version” attribute indicates the version of the WMS<br />

protocol used by the WMS. Currently, <strong>Geomatica</strong> Web Mapping<br />

Service supports versions 1.0.0 and 1.1.1.<br />

Using the “Map” Element<br />

The “map” element is a container for one to several map layers. The<br />

“map” element includes five child elements (title, description,<br />

metadata, supported-bbox, and maplayer) and the visible attribute.<br />

The “map” element is defined in the DTD as follows:<br />

<br />

<br />

The “maplayer” child element also contains the title, description,<br />

metadata, and supported-box child elements and the visible attribute.<br />

Therefore, refer to “Using the “Maplayer” Child Element” on<br />

page 71 for the description of the child elements and the visible<br />

attribute.<br />

Using the “Maplayer” Child Element<br />

The “maplayer” element is a child of the “map” element. It<br />

represents a map layer that is identified by its layer ID in the<br />

Capabilities file. The “maplayer” element contains the title,<br />

description, metadata, supported-styles, and supported-bbox child<br />

elements and the layerid, default-style, visible, and queryable<br />

attributes. The “maplayer” child element is defined in the DTD as<br />

follows (see “Setting the “Maplayer” Attributes” on page 73 for the<br />

attributes):<br />

<br />

Replacing the Title<br />

The “title” element is an optional child element of both the “map”<br />

element and “maplayer” child element. Although the Capabilities<br />

file contains a title for the map layer, you can use the “title” child<br />

element to replace the published title with a more practical label. If<br />

it is not used, the viewer uses the title from the Capabilities file. The<br />

“title” child element is defined in the DTD as follows:<br />

<br />

Replacing the Description<br />

The “description” element is an optional child element of both the<br />

“map” element and “maplayer” child element. Although the<br />

Capabilities file contains a description for the map layer, you can use<br />

the “description” child element to replace the published description<br />

with your own version. If it is not used, the viewer uses the<br />

description provided in the Capabilities file. The “description” child<br />

element is defined in the DTD as follows:<br />

<br />

Replacing the Metadata<br />

The “metadata” element is an optional child element of both the<br />

“map” element and “maplayer” child element. The Capabilities file<br />

may contain metadata for the map layer, however, you may want to<br />

include more information or replace the published information. The<br />

“metadata” child element is defined in the DTD as follows:<br />

<br />

<br />

By using the “metadata” child element, you can add metadata<br />

information for each map layer as key or value string pairs. For<br />

example:<br />

<br />

<strong>Geomatica</strong> <strong>WebServer</strong> Suite <strong>Installation</strong> <strong>Guide</strong> 71


Chapter 7 - Configuring the WMS MapViewer Applet<br />

Map of Lake Superior<br />

<br />

The largest of the Great Lakes located between the<br />

north-central United States and southern Ontario, Canada<br />

<br />

<br />

<br />

<br />

You can access the metadata from the API of the map layer provided<br />

with the applet (see “API Reference for the WMS” on page 77).<br />

Determining the Supported-Styles<br />

The “supported-styles” element is a child element of the “maplayer”<br />

child element only. The “supported-styles” child element is defined<br />

in the DTD as follows:<br />

<br />

<br />

By default the layer supports all the styles provided by the<br />

Capabilities file. You can restrict the list of styles supported by a<br />

layer to those specified in the “supported-styles” child element.<br />

The “supported-styles” child element can include a list of styles as<br />

children using the “style” child element. The “style” child element<br />

provides the name of the style you want to support. Each name in the<br />

list must be published in the Capabilities file.<br />

Changing the Supported-Bbox<br />

The “supported-bbox” child element is an optional child element of<br />

both the “map” element and “maplayer” child element. By default<br />

the map layer supports all the bounding boxes published by the<br />

Capabilities file. You can restrict the list and extent of the bounding<br />

boxes by using the “supported-bbox” child element. The “supportedbbox”<br />

child element is defined in the DTD as follows:<br />

<br />

<br />

<br />

The “supported-bbox” child element overrides any bounding boxes<br />

provided by the Capabilities file. For example, the following shows<br />

a layer that supports only two SRS with limited bounding boxes:<br />

<br />

<br />

srs="EPSG:26711"<br />

minx="411814.576577"<br />

miny="3724207.746876"<br />

maxx="433946.398012"<br />

maxy="3732255.880432"/><br />

<br />

<br />

<br />

The “maplayer” child element and its descendants can inherit<br />

bounding boxes from the “map” element. If the bounding box from<br />

the “maplayer” child element or its descendants conflicts with the<br />

bounding box using the same SRS inherited from the “map” element,<br />

the viewer disregards the inherited bounding box. However, all the<br />

supported bounding boxes must be of an SRS supported by the<br />

Capabilities file.<br />

72 PCI Geomatics<br />

Note<br />

The extent must be within the extent published in the Capabilities file.


Generating a Capabilities File<br />

Setting the “Maplayer” Attributes<br />

The attributes for the “maplayer” child element are defined in the<br />

DTD as follows:<br />

<br />

layerid: The “layerid” attribute identifies the map layer published in<br />

the Capabilities file. If the WMS does not contain the map layer, the<br />

viewer will disregard the map layer and the request will not be sent<br />

to the WMS. The “map” element does not include a layer ID,<br />

because it is a container for map layers and it cannot be requested<br />

from the WMS.<br />

default style: The “default-style” attribute is an optional attribute of<br />

the “maplayer” child element. The Default Style must be one of<br />

styles in the Capabilities file supported by the map layer. For<br />

example:<br />

<br />

When a layer does not support styles, such as a layer containing an<br />

image, the request sent to the WMS uses the name "default" for the<br />

style ID. If the “default-style” attribute is disregarded, the viewer<br />

uses the first style published in the Capabilities file as the default.<br />

visible: The “visible” attribute is an optional attribute of the “map”<br />

element and the “maplayer” child element. It indicates whether the<br />

map or map layer is visible or not when the viewer is started. The<br />

attribute contains only two values, “true” or “false”. By default the<br />

value is “true”. The value “true” means that the map or map layer is<br />

visible. The value “false” means that the map or map layer is not<br />

visible.<br />

The “visible” attribute of the “map” element has priority over the<br />

“visible” attribute of the “maplayer” child element or its<br />

descendants. If the “map” element is visible (“true”), you can set the<br />

attribute to “true” or “false” for the map layers. If the “map” element<br />

is not visible (“false”), the map layer cannot be visible, regardless of<br />

how its attribute is set.<br />

For example, the “visible” attribute of the following map layers is<br />

“true”, but the “visible” attribute of the “map” element is “false”.<br />

Therefore, the map layers are not visible.<br />

<br />

<br />


Chapter 7 - Configuring the WMS MapViewer Applet<br />

Replace [localhost] by the name of the server where the project is<br />

located.<br />

2. Identify the exact layer names in the XML file. For example, the<br />

layer “Lakes” in the Capabilities file generated from the demo<br />

project Newport.gpr.<br />

<br />

Lakes<br />

Lakes<br />

<br />

<br />

<br />

<br />

<br />

Default<br />

Default<br />

none<br />

<br />

<br />

Viewing the MapViewer DTD<br />

The following is the MapViewer.dtd is its original form:<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

74 PCI Geomatics


Viewing the MapViewer DTD<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />


Chapter 7 - Configuring the WMS MapViewer Applet<br />

only a clip of the full bounding box must be used or only<br />

a subset of SRS is used. If the tag is not used the list<br />

of bounding boxes published by the WMS capabilities is<br />

used.<br />

--><br />

<br />

<br />

<br />

<br />

76 PCI Geomatics


API Reference for the WMS<br />

C HAPTER<br />

8<br />

This chapter contains the API of the MapViewer applet, the Layer object, and the Layer Information Requests using the style used by Java. This<br />

chapter is intended for advanced or expert users with comprehensive knowledge of HTML, Java, and JavaScript. You can use the application<br />

programming interface (API) reference to expand <strong>Geomatica</strong> <strong>WebServer</strong> Suite functionality. You can use the information provided in the API to<br />

control the behaviour of the MapViewer applet and to enhance the content of your Web page.<br />

Class MapViewerApplet<br />

This applet is a map viewer for OGC Web Mapping Server. It runs with Java 1.4 JVM and provides tool to manipulate the view and map drawing.<br />

Field Summary<br />

Fields inherited from class java.awt.Component<br />

BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT<br />

Fields inherited from interface java.awt.image.ImageObserver<br />

ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH<br />

Constructor Summary<br />

77


Chapter 8 - API Reference for the WMS<br />

MapViewerApplet()<br />

Method Summary<br />

void<br />

void<br />

void<br />

Extent<br />

LayerInfoFilterConfig<br />

LinearRing<br />

LineString<br />

Point2D<br />

Rectangle<br />

SimplePolygon<br />

void<br />

void<br />

Extent<br />

Extent<br />

Layer<br />

Layer<br />

areaMeasurementTool()<br />

Activate a area measurement tool.<br />

centerTool()<br />

Activate a Recenter tool.<br />

circleMeasurementTool()<br />

Activate a area measurement tool.<br />

createExtent(double ulx, double uly, double width, double height)<br />

Create an instance of Extent<br />

createLayerInfoFilterConfig()<br />

Create a new LayerInfoFilterConfig allowing property and spatial filtering on the layers and customized presentation using XSLT.<br />

createLinearRing(java.lang.String coordinates)<br />

Create a LinearRing geometry from a list of coordinates in the following format: 3,2 3,4 4,5.<br />

createLineString(java.lang.String coordinates)<br />

Create a LineString geometry from a list of coordinates in the following format: 3,2 3,4 4,5.<br />

createPoint2D(java.lang.String coordinate)<br />

Create a Point2D geometry from a coordinate string in the following format: 3,2<br />

createRectangle(java.lang.String coordinates)<br />

Create a Rectangle geometry from a list of two coordinates along a diagonal in the following format: 3,2 3,4.<br />

createSimplePolygon(java.lang.String coordinates)<br />

Create a SimplePolygon geometry from a list of coordinates in the following format: 3,2 3,4 4,5.<br />

cursorTool()<br />

Activate a area measurement tool.<br />

flush()<br />

Flush the cache of the drawing view.<br />

getExtent()<br />

Get the current extent of the DrawingView.<br />

getFullExtent()<br />

Get the full extent of the view (overview).<br />

getLayer(java.lang.String layerID)<br />

Get the Layer identified by the layerID.<br />

getRoot()<br />

Returns the root of the map composition displayed in the applet.<br />

78 PCI Geomatics


double<br />

GeometryIF<br />

void<br />

void<br />

void<br />

void<br />

void<br />

void<br />

void<br />

void<br />

void<br />

void<br />

void<br />

void<br />

void<br />

void<br />

Point2d<br />

void<br />

Class MapViewerApplet<br />

getScale()<br />

Get the current scale of the view (scale is number of points of the device per user space unit.<br />

getSelectedGeometry()<br />

Get the current selected GeometryIF in the view.This Geometry is created typically by a Query tool such as QueryPolygonTool,<br />

QueryPointTool or QueryLineStringTool.<br />

init()<br />

Opens the window and initializes its contents.<br />

lengthMeasurementTool()<br />

Activate a length measurement tool.<br />

loadMapViewConfiguration(java.lang.String urladdress)<br />

Load a map configuration file from the URL address.<br />

overview()<br />

Set the extent of the view to full extent (overview of the Drawing) by using the best fit for the drawing extent in the view.<br />

pan()<br />

This method activates the pan tool.<br />

panAndZoom()<br />

Activate a pan and zoom tool.<br />

refresh()<br />

Refresh the screen.<br />

setCenterAt(double X, double Y)<br />

Center the view at the specified user space point.<br />

setExtent(double x, double y, double width, double height)<br />

Set the extent for the view.<br />

setQueryLineTool()<br />

Set the query line string tool.<br />

setQueryPointTool(java.lang.String windowName)<br />

This method allows you to select a point with the mouse.<br />

setQueryPointTool(java.lang.String windowName, int featureCountNum)<br />

This method allows you to select a point with the mouse.<br />

setQueryPolygonTool()<br />

Set the query polygon tool.<br />

start()<br />

This method is called after the applet is loaded.<br />

toDevicePoint(double x, double y)<br />

Converts a point in user space coordinate to device space coordinate in sub-pixel precision.<br />

toolDone()<br />

Informs the editor that a tool has finished its interaction.<br />

<strong>Geomatica</strong> <strong>WebServer</strong> Suite <strong>Installation</strong> <strong>Guide</strong> 79


Chapter 8 - API Reference for the WMS<br />

Point2d<br />

void<br />

void<br />

void<br />

void<br />

toUserPoint(int xdevice, int ydevice)<br />

Converts a point in device space coordinate to user space coordinate in double precision.<br />

zoom()<br />

The zoom is performed by dragging the mouse up and down.<br />

zoom(double scale)<br />

Zoom at the specified scale.<br />

zoomFactor(double factor)<br />

This method activates a tool to zoom by a fixed factor set in the view.<br />

zoomWindow()<br />

Activates a Zoom Window tool: used to magnify the portiom of the map contained within the selected area.<br />

Methods inherited from class java.applet.Applet<br />

destroy, getAccessibleContext, getAppletContext, getAppletInfo, getAudioClip, getAudioClip, getCodeBase, getDocumentBase,<br />

getImage, getImage, getLocale, getParameter, getParameterInfo, isActive, newAudioClip, play, play, resize, resize,<br />

setStub, showStatus, stop<br />

Methods inherited from class java.awt.Panel<br />

addNotify<br />

Methods inherited from class java.awt.Container<br />

add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener,<br />

applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt,<br />

findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount,<br />

getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners,<br />

getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot,<br />

isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, paramString, preferredSize,<br />

print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener,<br />

removeNotify, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, setLayout,<br />

transferFocusBackward, transferFocusDownCycle, update, validate, validateTree<br />

80 PCI Geomatics


Methods inherited from class java.awt.Component<br />

MapViewerApplet<br />

public MapViewerApplet()<br />

Class MapViewerApplet<br />

action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener,<br />

addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds,<br />

checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage,<br />

createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods,<br />

firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel,<br />

getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners,<br />

getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight,<br />

getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners,<br />

getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners,<br />

getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners,<br />

getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent,<br />

hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled,<br />

isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isShowing, isValid,<br />

isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove,<br />

mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent,<br />

processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent,<br />

processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener,<br />

removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener,<br />

removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint,<br />

repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, setBackground,<br />

setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable,<br />

setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize,<br />

setSize, setVisible, show, show, size, toString, transferFocus, transferFocusUpCycle<br />

Methods inherited from class java.lang.Object<br />

clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait<br />

Constructor Detail<br />

<strong>Geomatica</strong> <strong>WebServer</strong> Suite <strong>Installation</strong> <strong>Guide</strong> 81


Chapter 8 - API Reference for the WMS<br />

Method Detail<br />

init<br />

public void init()<br />

Opens the window and initializes its contents.<br />

Overrides:<br />

init in class java.applet.Applet<br />

start<br />

public void start()<br />

This method is called after the applet is loaded.<br />

Overrides:<br />

start in class java.applet.Applet<br />

loadMapViewConfiguration<br />

public void loadMapViewConfiguration(java.lang.String urladdress)<br />

Load a map configuration file from the URL address.<br />

Parameters:<br />

urladdress - URL address of the config file<br />

getRoot<br />

public Layer getRoot()<br />

Returns the root of the map composition displayed in the applet. The layer can be a simple Layer without any children.<br />

Returns:<br />

the root of the map composition that is displayed in the applet.<br />

getLayer<br />

public Layer getLayer(java.lang.String layerID)<br />

Get the Layer identified by the layerID.<br />

Parameters:<br />

layerID - identifier of the GeoMap<br />

Returns:<br />

Layer instance corresponding to the layerID,null if not found<br />

getExtent<br />

public Extent getExtent()<br />

Get the current extent of the DrawingView.<br />

82 PCI Geomatics


Returns:<br />

Rectangle representing the Extent of the DrawingView.<br />

getFullExtent<br />

public Extent getFullExtent()<br />

Get the full extent of the view (overview).<br />

Returns:<br />

Extent corresponding to the full extent<br />

Class MapViewerApplet<br />

setExtent<br />

public void setExtent(double x,<br />

double y,<br />

double width,<br />

double height)<br />

Set the extent for the view. This method computes the best fit of the given extent in the current DrawingView. A uniform scale is computed in both<br />

directions. Extent is expressed in map space.<br />

Parameters:<br />

x - upper left x coordinate in map space<br />

y - upper left x coordinate in map space<br />

width - width of the extent in map space<br />

height - height of the extent in map space<br />

getScale<br />

public double getScale()<br />

Get the current scale of the view (scale is number of points of the device per user space unit.<br />

Returns:<br />

current scale of the view<br />

pan<br />

public void pan()<br />

This method activates the pan tool. The user needs to click the left button and drag the mouse to pan the image.<br />

zoomFactor<br />

public void zoomFactor(double factor)<br />

This method activates a tool to zoom by a fixed factor set in the view. The zoom is done by keeping the center of the view fixed.<br />

zoomWindow<br />

public void zoomWindow()<br />

Activates a Zoom Window tool: used to magnify the portiom of the map contained within the selected area. Area is selected by dragging the left mouse<br />

button to create a window.<br />

<strong>Geomatica</strong> <strong>WebServer</strong> Suite <strong>Installation</strong> <strong>Guide</strong> 83


Chapter 8 - API Reference for the WMS<br />

centerTool<br />

public void centerTool()<br />

Activate a Recenter tool. The user needs to click the left button. The view is centered at the position clicked.<br />

cursorTool<br />

public void cursorTool()<br />

Activate a area measurement tool.<br />

lengthMeasurementTool<br />

public void lengthMeasurementTool()<br />

Activate a length measurement tool.<br />

areaMeasurementTool<br />

public void areaMeasurementTool()<br />

Activate a area measurement tool.<br />

circleMeasurementTool<br />

public void circleMeasurementTool()<br />

Activate a area measurement tool.<br />

setCenterAt<br />

public void setCenterAt(double X,<br />

double Y)<br />

Center the view at the specified user space point.<br />

Parameters:<br />

X - user space X coordinate of the center<br />

Y - user space Y coordinate of the center<br />

overview<br />

public void overview()<br />

Set the extent of the view to full extent (overview of the Drawing) by using the best fit for the drawing extent in the view.<br />

zoom<br />

public void zoom()<br />

The zoom is performed by dragging the mouse up and down. Move up zoom out, move down zoom in.<br />

zoom<br />

public void zoom(double scale)<br />

Zoom at the specified scale. The center point of the view remains fixed. The scale is expressed as number of device unit per user unit.<br />

84 PCI Geomatics


Parameters:<br />

scale - scale to use to zoom<br />

Class MapViewerApplet<br />

panAndZoom<br />

public void panAndZoom()<br />

Activate a pan and zoom tool. To zoom click the right mouse button and drag up and down. Moving up zooms out, moving down zooms in. To pan click<br />

and drag the left mouse button.<br />

toolDone<br />

public void toolDone()<br />

Informs the editor that a tool has finished its interaction. This method can be used to switch back to the default tool.<br />

flush<br />

public void flush()<br />

Flush the cache of the drawing view.<br />

refresh<br />

public void refresh()<br />

Refresh the screen.<br />

setQueryPointTool<br />

public void setQueryPointTool(java.lang.String windowName,<br />

int featureCountNum)<br />

This method allows you to select a point with the mouse.<br />

setQueryPointTool<br />

public void setQueryPointTool(java.lang.String windowName)<br />

This method allows you to select a point with the mouse.<br />

setQueryPolygonTool<br />

public void setQueryPolygonTool()<br />

Set the query polygon tool.<br />

setQueryLineTool<br />

public void setQueryLineTool()<br />

Set the query line string tool.<br />

createLayerInfoFilterConfig<br />

public LayerInfoFilterConfig createLayerInfoFilterConfig()<br />

Create a new LayerInfoFilterConfig allowing property and spatial filtering on the layers and customized presentation using XSLT.<br />

<strong>Geomatica</strong> <strong>WebServer</strong> Suite <strong>Installation</strong> <strong>Guide</strong> 85


Chapter 8 - API Reference for the WMS<br />

Returns:<br />

Instance of LayerInfoFilterConfig.<br />

createSimplePolygon<br />

public SimplePolygon createSimplePolygon(java.lang.String coordinates)<br />

Create a SimplePolygon geometry from a list of coordinates in the following format: 3,2 3,4 4,5.<br />

Parameters:<br />

coordinates - list of coordinates<br />

Returns:<br />

SimplePolygon geometry, null if coordinates invalid.<br />

createLineString<br />

public LineString createLineString(java.lang.String coordinates)<br />

Create a LineString geometry from a list of coordinates in the following format: 3,2 3,4 4,5.<br />

Parameters:<br />

coordinates - list of coordinates<br />

Returns:<br />

LineString geometry, null if coordinates invalid.<br />

createRectangle<br />

public Rectangle createRectangle(java.lang.String coordinates)<br />

Create a Rectangle geometry from a list of two coordinates along a diagonal in the following format: 3,2 3,4.<br />

Parameters:<br />

coordinates - Two opposite points along a diagonal<br />

Returns:<br />

com.pcigeomatics.spatial.geometry.Rectangle geometry, null if coordinates invalid.<br />

createLinearRing<br />

public LinearRing createLinearRing(java.lang.String coordinates)<br />

Create a LinearRing geometry from a list of coordinates in the following format: 3,2 3,4 4,5.<br />

Parameters:<br />

coordinates - list of coordinates<br />

Returns:<br />

LinearRing geometry, null if coordinates invalid.<br />

createPoint2D<br />

public Point2D createPoint2D(java.lang.String coordinate)<br />

Create a Point2D geometry from a coordinate string in the following format: 3,2<br />

86 PCI Geomatics


Parameters:<br />

coordinate - of the point<br />

Returns:<br />

Point2D geometry, null if coordinate invalid.<br />

Class MapViewerApplet<br />

getSelectedGeometry<br />

public GeometryIF getSelectedGeometry()<br />

Get the current selected GeometryIF in the view.This Geometry is created typically by a Query tool such as QueryPolygonTool, QueryPointTool or<br />

QueryLineStringTool. It could also be the result if a selection in a layer (not supported in this version) The current version returns only atomic Geometry,<br />

not collection<br />

Returns:<br />

Geometry geometry currently selected, null if none is found.<br />

createExtent<br />

public Extent createExtent(double ulx,<br />

double uly,<br />

double width,<br />

double height)<br />

Create an instance of Extent<br />

Parameters:<br />

ulx - upper left x coordinate<br />

uly - upper left x coordinate<br />

width - width of the extent<br />

height - height of the extent<br />

toDevicePoint<br />

public Point2d toDevicePoint(double x,<br />

double y)<br />

Converts a point in user space coordinate to device space coordinate in sub-pixel precision.<br />

Parameters:<br />

x - X coordinate of point in user space<br />

y - Y coordinate of point in user space<br />

Returns:<br />

Point2d in device space coordinate (in sub pixel)<br />

toUserPoint<br />

public Point2d toUserPoint(int xdevice,<br />

int ydevice)<br />

Converts a point in device space coordinate to user space coordinate in double precision.<br />

<strong>Geomatica</strong> <strong>WebServer</strong> Suite <strong>Installation</strong> <strong>Guide</strong> 87


Chapter 8 - API Reference for the WMS<br />

Returns:<br />

Point2d in device space coordinate (in sub pixel)<br />

Class Layer<br />

public class Layer<br />

extends java.lang.Object<br />

A layer is a visual representation of geodata commonly known as a "map". It is not the data itself. A layer is generally rendered in a pictorial format<br />

such as PNG, GIF or JPEG, or occasionally as vector-based graphical elements in Scalable Vector Graphics (SVG).<br />

This class provides methods to provide layer attributes information and to modify display properties.<br />

Constructor Summary<br />

Layer(GeoMap geomap)<br />

Constructor<br />

Method Summary<br />

void<br />

clearScales()<br />

Clears the existing scale limitations, allowing the layer to be drawn at all scales.<br />

boolean<br />

getAllowsChildren()<br />

Returns true if this Layer is allowed to have children.<br />

Extent<br />

getExtent()<br />

Get the current Extent of the Layer.<br />

Extent<br />

getLatLongExtent()<br />

Get the LongLat Extent of the Layer.<br />

java.lang.String getLayerID()<br />

Get the identifier of the Layer.<br />

java.lang.String getLayerLeafIDs()<br />

A breath first traversal starts looking at the root node, then goes to its children, in ascending index order.<br />

java.lang.String getLayerLeafNames()<br />

A breath first traversal starts looking at the root node, then goes to its children, in ascending index order.<br />

double<br />

getMaxScale()<br />

Gets the maximum scale at which this layer is displayed.<br />

88 PCI Geomatics


getMetadata(java.lang.String name)<br />

java.lang.Object<br />

Returns the value of a metadata.<br />

getMetadataNames(int index)<br />

java.lang.String<br />

Returns the metadata name represented by a specific index.<br />

getMetadataNamesCount()<br />

int<br />

Returns the number of metadata names that are declared in a Layer.<br />

getMinScale()<br />

double<br />

Gets the minimum scale at which this layer is displayed.<br />

java.lang.String getName()<br />

Get the name of the geodataset (title).<br />

com.pcigeomatics<br />

.map.geodataset.<br />

geomap.Layer<br />

com.pcigeomatics<br />

.map.geodataset.<br />

geomap.Layer<br />

getParent()<br />

Gets the parent container of this layer.<br />

getRoot()<br />

Returns the root of the composition that contains the Layer.<br />

java.lang.String getSRS()<br />

Gets the spatial reference system used by the layer.<br />

Style<br />

getStyle()<br />

Gets the current Style.<br />

Style<br />

getStyle(java.lang.String styleID)<br />

Gets the Style object from its StyleID.<br />

int<br />

getSubLayerCount()<br />

Returns the current number of sub layers in the Layer.<br />

com.pcigeomatics<br />

.map.geodataset.<br />

geomap.Layer<br />

java.lang.String<br />

int<br />

Style<br />

int<br />

boolean<br />

getSubLayers(int index)<br />

Returns the Layer represented by a specific index.<br />

getSupportedSRS(int index)<br />

Returns the SRS String represented by a specific index.<br />

getSupportedSRSCount()<br />

Returns the number of SRS supported that are declared in a Layer<br />

getSupportedStyles(int index)<br />

Returns the Style represented by a specific index.<br />

getSupportedStylesCount()<br />

Returns the number of Styles supported in a layer.<br />

isLeaf()<br />

Returns true if this Layer has no children.<br />

Class Layer<br />

<strong>Geomatica</strong> <strong>WebServer</strong> Suite <strong>Installation</strong> <strong>Guide</strong> 89


Chapter 8 - API Reference for the WMS<br />

boolean<br />

boolean<br />

boolean<br />

boolean<br />

boolean<br />

void<br />

void<br />

void<br />

void<br />

void<br />

void<br />

void<br />

void<br />

Layer<br />

public Layer(GeoMap geomap)<br />

Constructor<br />

isQueryable()<br />

Indicates if the layer is queryable.<br />

isRoot()<br />

Returns true if this Layer is the root of the composition.<br />

isSelected()<br />

Indicates if the layer is selected.<br />

isVisible()<br />

Indicates if the layer is visible or if it is hidden.<br />

move(int startIndex, int endIndex, int toIndex)<br />

Moves one or more sublayers starting at startIndex to endIndexin the model to the toIndex.<br />

setMaxScale(double maxScale)<br />

Sets the maximum scale at which this layer is displayed.<br />

setMinScale(double minScale)<br />

Sets the minimum scale at which this layer is displayed.<br />

setSelected(java.lang.String selected)<br />

Selects the layer by using "true" or "false" strings.<br />

setSelectedByInt(int visible)<br />

Selects the layer by using integer 0 or 1.<br />

setSRS(java.lang.String srsName)<br />

Sets the spatial reference system used by the Layer.<br />

setStyle(java.lang.String styleID)<br />

Sets the current Style.<br />

setVisible(java.lang.String visible)<br />

Sets the layer visibility by using "true" or "false" strings.<br />

setVisibleByInt(int visible)<br />

Sets the layer visibility by using integer 0 or 1.<br />

Methods inherited from class java.lang.Object<br />

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait<br />

Constructor Detail<br />

90 PCI Geomatics


Method Detail<br />

getLayerID<br />

public java.lang.String getLayerID()<br />

Get the identifier of the Layer. If not set, it returns null, The layer cannot be requested.<br />

Returns:<br />

Identifier of the Layer.null if not set.<br />

getName<br />

public java.lang.String getName()<br />

Get the name of the geodataset (title).<br />

Returns:<br />

name of the geodataset<br />

getMetadataNames<br />

public java.lang.String getMetadataNames(int index)<br />

Returns the metadata name represented by a specific index.<br />

Parameters:<br />

index - of the metadata name requested<br />

Returns:<br />

metadata name String at a specific index<br />

getMetadataNamesCount<br />

public int getMetadataNamesCount()<br />

Returns the number of metadata names that are declared in a Layer.<br />

Returns:<br />

int that indicate the number of metadata names declared<br />

getMetadata<br />

public java.lang.Object getMetadata(java.lang.String name)<br />

Returns the value of a metadata. If the metadata name is not recognized, null is returned<br />

Parameters:<br />

name - the name of the metadata, as a String.<br />

Returns:<br />

the value of the metadata, as an Object or null if not defined<br />

Class Layer<br />

<strong>Geomatica</strong> <strong>WebServer</strong> Suite <strong>Installation</strong> <strong>Guide</strong> 91


Chapter 8 - API Reference for the WMS<br />

getLatLongExtent<br />

public Extent getLatLongExtent()<br />

Get the LongLat Extent of the Layer. If not set for this layer, the parent one is used. If not set in ancestors, returns null<br />

Returns:<br />

Extent LongLat Extent<br />

getExtent<br />

public Extent getExtent()<br />

Get the current Extent of the Layer. If not set for this layer, the closest ancestor's one is used. If not set in the ancestor, returns null<br />

Returns:<br />

Extent current Extent<br />

getSRS<br />

public java.lang.String getSRS()<br />

Gets the spatial reference system used by the layer. If not set for this layer, the closest ancestor's one is used. If not set in ancestor's, returns null.<br />

Returns:<br />

spatial reference system used by the geospatial dataset<br />

setSRS<br />

public void setSRS(java.lang.String srsName)<br />

Sets the spatial reference system used by the Layer. The SRS is set only if it is supported by the Layer.<br />

getSupportedSRS<br />

public java.lang.String getSupportedSRS(int index)<br />

Returns the SRS String represented by a specific index.<br />

Parameters:<br />

index - of SRS<br />

Returns:<br />

String that represents the SRS value at a specific index<br />

getSupportedSRSCount<br />

public int getSupportedSRSCount()<br />

Returns the number of SRS supported that are declared in a Layer<br />

Returns:<br />

int number of SRS supported in the Layer<br />

getStyle<br />

public Style getStyle()<br />

Gets the current Style. If no style is available, it returns null. A default one needs to be used in the request.<br />

92 PCI Geomatics


Returns:<br />

current Style to use<br />

setStyle<br />

public void setStyle(java.lang.String styleID)<br />

Sets the current Style.<br />

getStyle<br />

public Style getStyle(java.lang.String styleID)<br />

Gets the Style object from its StyleID. If the style is not available, it returns null.<br />

Parameters:<br />

styleID - style identifier to use to retrieve the Style object<br />

Returns:<br />

Style object having the given StyleID, null if not found.<br />

getSupportedStyles<br />

public Style getSupportedStyles(int index)<br />

Returns the Style represented by a specific index.<br />

Parameters:<br />

index -<br />

Returns:<br />

style supported for a specific index in this layer<br />

getSupportedStylesCount<br />

public int getSupportedStylesCount()<br />

Returns the number of Styles supported in a layer.<br />

Returns:<br />

int the number of styles supported<br />

isVisible<br />

public boolean isVisible()<br />

Indicates if the layer is visible or if it is hidden.<br />

Returns:<br />

true if the layer is visible, false if the layer is hidden.<br />

setVisible<br />

public void setVisible(java.lang.String visible)<br />

Sets the layer visibility by using "true" or "false" strings. If the string is not valid, the method does nothing.<br />

Class Layer<br />

<strong>Geomatica</strong> <strong>WebServer</strong> Suite <strong>Installation</strong> <strong>Guide</strong> 93


Chapter 8 - API Reference for the WMS<br />

setVisibleByInt<br />

public void setVisibleByInt(int visible)<br />

Sets the layer visibility by using integer 0 or 1. If the integer is not valid, the method does nothing.<br />

Parameters:<br />

visible - 1 if layer is visible, 0 otherwise not visible<br />

getMaxScale<br />

public double getMaxScale()<br />

Gets the maximum scale at which this layer is displayed. If the current scale is greater than the maximum scale, the layer will not be displayed. If no<br />

maximum scale has been set, the method returns NO_MAXSCALE. If not set, it is inherited from parent.<br />

Returns:<br />

the maximum scale this layer can be displayed<br />

setMaxScale<br />

public void setMaxScale(double maxScale)<br />

Sets the maximum scale at which this layer is displayed. If the current scale is greater than the maximum scale, the layer will not be displayed. This is<br />

a bound property, so report of any change is done to all registered listeners.<br />

Parameters:<br />

maxScale - the maximum scale this layer can be displayed<br />

getMinScale<br />

public double getMinScale()<br />

Gets the minimum scale at which this layer is displayed. If the current scale is less than the minimum scale, the layer will not be displayed. If not set, it<br />

is inherited from parent.<br />

Returns:<br />

the minimum scale this layer can be displayed. If no minimum scale has been set, the method returns NO_MINSCALE;<br />

setMinScale<br />

public void setMinScale(double minScale)<br />

Sets the minimum scale at which this layer is displayed. If the current scale is less than the minimum scale, the layer will not be displayed. This is a<br />

bound property, so report of any change is done to all registered listeners.<br />

Parameters:<br />

minScale - the minimum scale this layer can be displayed.<br />

clearScales<br />

public void clearScales()<br />

Clears the existing scale limitations, allowing the layer to be drawn at all scales. This is a bound property, so report of any change is done to all registered<br />

listeners.<br />

94 PCI Geomatics


setSelected<br />

public void setSelected(java.lang.String selected)<br />

Selects the layer by using "true" or "false" strings. If the string is not valid, the method does nothing.<br />

Parameters:<br />

selected - "true" if layer is selected, "false" otherwise.<br />

setSelectedByInt<br />

public void setSelectedByInt(int visible)<br />

Selects the layer by using integer 0 or 1. If the integer is not valid, the method does nothing.<br />

Parameters:<br />

visible - 1 if layer is selected, 0 otherwise not selected.<br />

isSelected<br />

public boolean isSelected()<br />

Indicates if the layer is selected.<br />

Returns:<br />

true if the Geomap is selected, false otherwise.<br />

isQueryable<br />

public boolean isQueryable()<br />

Indicates if the layer is queryable.<br />

Returns:<br />

true if query can be done on the map, false otherwise<br />

getParent<br />

public com.pcigeomatics.map.geodataset.geomap.Layer getParent()<br />

Gets the parent container of this layer.<br />

Returns:<br />

Layer parent of this Layer, null if no parent.<br />

getAllowsChildren<br />

public boolean getAllowsChildren()<br />

Returns true if this Layer is allowed to have children. A Layer that can contain children is a composition.<br />

Returns:<br />

true if this Layer allows children, else false.<br />

Class Layer<br />

isLeaf<br />

public boolean isLeaf()<br />

Returns true if this Layer has no children. To distinguish between Layers that have no children and Layer that cannot have children, use this method in<br />

<strong>Geomatica</strong> <strong>WebServer</strong> Suite <strong>Installation</strong> <strong>Guide</strong> 95


Chapter 8 - API Reference for the WMS<br />

conjunction with getAllowsChildren.<br />

Returns:<br />

true if this layer has no children.<br />

getSubLayerCount<br />

public int getSubLayerCount()<br />

Returns the current number of sub layers in the Layer. Note that a Layer composition is considered as one layer. Its sublayers are not counted individually.<br />

Returns:<br />

number of sub layers (siblings) in this Layer.<br />

getSubLayers<br />

public com.pcigeomatics.map.geodataset.geomap.Layer getSubLayers(int index)<br />

Returns the Layer represented by a specific index.<br />

Parameters:<br />

index -<br />

Returns:<br />

Layer at a specific index<br />

getLayerLeafNames<br />

public java.lang.String getLayerLeafNames()<br />

A breath first traversal starts looking at the root node, then goes to its children, in ascending index order. After each child has been looked at, the traversal<br />

moves on to the children of the root's first child and so on. A breath=first traversal might be good to find the item near the top of the tree.<br />

Returns:<br />

String of layers of GeoMap objects using a breath-first traversal algorithm.<br />

getLayerLeafIDs<br />

public java.lang.String getLayerLeafIDs()<br />

A breath first traversal starts looking at the root node, then goes to its children, in ascending index order. After each child has been looked at, the traversal<br />

moves on to the children of the root's first child and so on. A breath=first traversal might be good to find the item near the top of the tree.<br />

Returns:<br />

String of layers of GeoMap objects using a breath-first traversal algorithm.<br />

getRoot<br />

public com.pcigeomatics.map.geodataset.geomap.Layer getRoot()<br />

Returns the root of the composition that contains the Layer. The root is the ancestor with a null parent.<br />

Returns:<br />

the root of the composition that contains this Layer.<br />

96 PCI Geomatics


Class LayerInfoFilterConfig<br />

isRoot<br />

public boolean isRoot()<br />

Returns true if this Layer is the root of the composition. The root is the only Layer in the composition with a null parent; every composition has exactly<br />

one root.<br />

Returns:<br />

true if this Layer is the root of its tree<br />

move<br />

public boolean move(int startIndex,<br />

int endIndex,<br />

int toIndex)<br />

Moves one or more sublayers starting at startIndex to endIndexin the model to the toIndex.<br />

Examples of moves:<br />

1. move(1,3,5);<br />

a|B|C|D|e|f|g|h|i|j|k - before<br />

a|e|f|B|C|D|g|h|i|j|k - after<br />

2. move(6,7,1);<br />

a|b|c|d|e|f|G|H|i|j|k - before<br />

a|G|H|b|c|d|e|f|i|j|k - after<br />

Parameters:<br />

startIndex - the starting sublayer index to be moved<br />

endIndex - the ending sublayer index to be moved<br />

toIndex - the destination of the sublayers to be moved<br />

Returns:<br />

true if move has been successfull false if any of the indices are out of range or if endIndex is less than startIndex or no children to move.<br />

Class LayerInfoFilterConfig<br />

public class LayerInfoFilterConfig<br />

extends java.lang.Object<br />

This class is used for configuring the layer information request sent by the applet. The object can be accessed through the applet method<br />

createLayerInfoConfig().<br />

<strong>Geomatica</strong> <strong>WebServer</strong> Suite <strong>Installation</strong> <strong>Guide</strong> 97


Chapter 8 - API Reference for the WMS<br />

Constructor Summary<br />

LayerInfoFilterConfig(GeoMap geomapCurrent, java.applet.Applet applet)<br />

Constructor<br />

Method Summary<br />

void<br />

createBBoxOp(GeometryIF geometry)<br />

Create an BBox spatial operator<br />

void<br />

createCrossesOp(GeometryIF geometry)<br />

Create an Crosses spatial operator<br />

void<br />

createIntersectOp(GeometryIF geometry)<br />

Create an intersects spatial operator<br />

Join<br />

createJoin()<br />

Create a Join instance<br />

void<br />

createNearestOp(GeometryIF geometry)<br />

Create an Nearest spatial operator<br />

void<br />

createOverlapOp(GeometryIF geometry)<br />

Create an Overlap spatial operator<br />

void<br />

createWithinDistanceOp(GeometryIF geometry, double distance)<br />

Create an WithinDistance spatial operator<br />

void<br />

createWithinOp(GeometryIF geometry)<br />

Create an Within spatial operator<br />

void<br />

displayLayerInfoResult()<br />

Send the layer info query and display the result in the browser window identified by windowName.<br />

int<br />

getBeginRecord(java.lang.String layerID)<br />

Get the beginning record number in the resulting request for the specified layer.<br />

getFeatureIDs(java.lang.String layerID)<br />

java.lang.String Get the list of feature identifier to return in the query for the specific layer identified by layerID.The list is encoded as a string<br />

with a "|" delimiter.<br />

java.lang.String getID()<br />

Get the identifier of the layerInfoFilter.<br />

Join<br />

getJoin(java.lang.String layerID)<br />

Get the join information for the specific layer identified by layerID.<br />

java.lang.String getLayerInfoFilterURL()<br />

Get the URL corresponding to the query based on HTTP Get<br />

98 PCI Geomatics


int<br />

int<br />

Class LayerInfoFilterConfig<br />

getMaxFeature()<br />

Get the maximum number of features returned for all layers<br />

getMaxFeatures(java.lang.String layerID)<br />

Set the maximum of features returned in the response for the specific layer identified by layerId.If not set the value is -1.<br />

int<br />

getNumXSLTInfoParam()<br />

Get the parameter number<br />

java.lang.String getOutputFormat()<br />

Get the output format name used to retrieve the result<br />

getPropertyFilter(java.lang.String layerID)<br />

java.lang.String<br />

Get the property filter using the GDB syntax for the specific layer identified by layerID<br />

getResponseFilter(java.lang.String layerID)<br />

java.lang.String<br />

Get the response filter, i.e the list of property names to returns in the query.<br />

SpatialFilter<br />

getSpatialFilter()<br />

Get the spatial filter applied for all the layers<br />

SpatialFilter<br />

getSpatialFilter(java.lang.String layerID)<br />

Get the spatial filter applied for the specific layer identified by layerID.<br />

java.lang.String getXMLLayerInfoFilter()<br />

Get the XML encoding of the layer info filter.<br />

XSLTInfo<br />

getXSLTInfo()<br />

Get the XSLTInfo for the request used to transform the result set.<br />

getXSLTInfoParam(java.lang.String key)<br />

java.lang.String<br />

Get the parameter for the xslt<br />

boolean<br />

hasEnvelope(java.lang.String layerID)<br />

Indicates if the response should indicate the envelope for each returned features<br />

boolean<br />

hasFullEnvelope(java.lang.String layerID)<br />

Indicates if the response indicates the full envelope for all returned features of the layer or not.<br />

boolean<br />

isDirectOutput()<br />

Indicate if the output needs to be sent directly or accessed indirectly via a URL or file<br />

void<br />

setBeginRecord(java.lang.String layerID, java.lang.String beginIndex)<br />

Set the beginning record number in the resulting request for the specified layer<br />

void<br />

setDirectOutput(boolean directOutput)<br />

Indicatea if the output needs to be sent directly or accessed indirectly via a URL or file<br />

void<br />

setEnvelope(java.lang.String layerID, java.lang.String bEnvelope)<br />

Set whether the response should indicate the envelope for each returned features or not.<br />

void<br />

setEnvelopeByInt(java.lang.String layerID, int bEnvelope)<br />

Set whether the response should indicate the full envelope for all returned features of the layer or not.<br />

<strong>Geomatica</strong> <strong>WebServer</strong> Suite <strong>Installation</strong> <strong>Guide</strong> 99


Chapter 8 - API Reference for the WMS<br />

void<br />

void<br />

void<br />

void<br />

void<br />

void<br />

void<br />

void<br />

void<br />

void<br />

void<br />

void<br />

void<br />

void<br />

setFeatureIDs(java.lang.String layerID, java.lang.String ids)<br />

Set the list of feature identifier to return in the query for the specific layer identified by layerID.The list is of identifiers is delimited<br />

by the character '|'.<br />

setFullEnvelope(java.lang.String layerID, java.lang.String bFullEnvelope)<br />

Set whether the response should indicate the full envelope for all returned features of the layer or not.<br />

setFullEnvelopeByInt(java.lang.String layerID, int bFullEnvelope)<br />

Set whether the response should indicate the full envelope for all returned features of the layer or not.<br />

setID(java.lang.String ID)<br />

Set the identifier of the layerInfoFilter.<br />

setJoin(java.lang.String layerID, Join join)<br />

Set the join information for the specific layer identified by layerID.<br />

setMaxFeature(java.lang.String layerID, java.lang.String maxFeature)<br />

Set the maximum number of features returned for all layers<br />

setMaxFeatures(java.lang.String layerID, java.lang.String maxFeatures)<br />

Set the maximum of features returned in the response for the specific layer identified by layerId.<br />

setOutputFormat(java.lang.String outputFormat)<br />

Set the output format name used to retrieve the result<br />

setPropertyFilter(java.lang.String layerID, java.lang.String propertyFilter)<br />

Set the property filter using the GDB syntax for the specific layer identified by layerID<br />

setResponseFilter(java.lang.String layerID, java.lang.String propertyNames)<br />

Get the response filter, i.e the list of property names to returns in the query.<br />

setSpatialFilter()<br />

Set the spatial filter applied for all the layers<br />

setSpatialFilter(java.lang.String layerID, SpatialFilter filter)<br />

Set the spatial filter applied for the specific layer identified by layerID.<br />

setXSLTInfo(java.lang.String path)<br />

Set the XSLTInfo for the request used to transform the result set.<br />

setXSLTInfoParam(java.lang.String key, java.lang.String value)<br />

Set the parameter for the xslt<br />

Methods inherited from class java.lang.Object<br />

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait<br />

100 PCI Geomatics


Constructor Detail<br />

LayerInfoFilterConfig<br />

public LayerInfoFilterConfig(GeoMap geomapCurrent,<br />

java.applet.Applet applet)<br />

Constructor<br />

Method Detail<br />

createJoin<br />

public Join createJoin()<br />

Create a Join instance<br />

Returns:<br />

Join instance<br />

setPropertyFilter<br />

public void setPropertyFilter(java.lang.String layerID,<br />

java.lang.String propertyFilter)<br />

Set the property filter using the GDB syntax for the specific layer identified by layerID<br />

Parameters:<br />

layerID - identifier of the layer<br />

propertyFilter - property filter using GDB syntax<br />

getPropertyFilter<br />

public java.lang.String getPropertyFilter(java.lang.String layerID)<br />

Get the property filter using the GDB syntax for the specific layer identified by layerID<br />

Parameters:<br />

layerID - identifier of the layer<br />

Returns:<br />

property filter using GDB syntax<br />

getResponseFilter<br />

public java.lang.String getResponseFilter(java.lang.String layerID)<br />

Get the response filter, i.e the list of property names to returns in the query. The list is encoded as a string with a "|" delimiter.<br />

Parameters:<br />

layerID - identifier of the layer<br />

Class LayerInfoFilterConfig<br />

<strong>Geomatica</strong> <strong>WebServer</strong> Suite <strong>Installation</strong> <strong>Guide</strong> 101


Chapter 8 - API Reference for the WMS<br />

Returns:<br />

list of property names encoded as a string with a "|" delimiter.<br />

setResponseFilter<br />

public void setResponseFilter(java.lang.String layerID,<br />

java.lang.String propertyNames)<br />

Get the response filter, i.e the list of property names to returns in the query.<br />

Parameters:<br />

layerID - identifier of the layer<br />

Returns:<br />

array of property names<br />

setMaxFeatures<br />

public void setMaxFeatures(java.lang.String layerID,<br />

java.lang.String maxFeatures)<br />

Set the maximum of features returned in the response for the specific layer identified by layerId.<br />

Parameters:<br />

layerID - identifier of the layer<br />

maxFeatures - maximum number of features<br />

getMaxFeatures<br />

public int getMaxFeatures(java.lang.String layerID)<br />

Set the maximum of features returned in the response for the specific layer identified by layerId.If not set the value is -1.<br />

Parameters:<br />

layerID - identifier of the layer<br />

Returns:<br />

maximum number of features<br />

getBeginRecord<br />

public int getBeginRecord(java.lang.String layerID)<br />

Get the beginning record number in the resulting request for the specified layer. If not set the value is -1.<br />

Parameters:<br />

layerID - identifier of the layer<br />

Returns:<br />

beginning record number in the resulting request<br />

102 PCI Geomatics


setBeginRecord<br />

public void setBeginRecord(java.lang.String layerID,<br />

java.lang.String beginIndex)<br />

Set the beginning record number in the resulting request for the specified layer<br />

Parameters:<br />

layerID - identifier of the layer<br />

beginIndex - beginning record number in the resulting request<br />

Class LayerInfoFilterConfig<br />

getFeatureIDs<br />

public java.lang.String getFeatureIDs(java.lang.String layerID)<br />

Get the list of feature identifier to return in the query for the specific layer identified by layerID.The list is encoded as a string with a "|" delimiter.<br />

Parameters:<br />

layerID - identifier of the layer<br />

Returns:<br />

list of feature identifiers encoded as a string with a "|" delimiter.<br />

setFeatureIDs<br />

public void setFeatureIDs(java.lang.String layerID,<br />

java.lang.String ids)<br />

Set the list of feature identifier to return in the query for the specific layer identified by layerID.The list is of identifiers is delimited by the character<br />

'|'. Example "1|3|4|34".<br />

Parameters:<br />

layerID - identifier of the layer<br />

createIntersectOp<br />

public void createIntersectOp(GeometryIF geometry)<br />

Create an intersects spatial operator<br />

Parameters:<br />

geometry - Geometry used by the operator. Only SimplePolygon is supported.<br />

Returns:<br />

Instance of IntersectOp. null if geometry is is not supported.<br />

createWithinDistanceOp<br />

public void createWithinDistanceOp(GeometryIF geometry,<br />

double distance)<br />

Create an WithinDistance spatial operator<br />

Parameters:<br />

geometry - Geometry used by the operator. Only Point2D is supported.<br />

<strong>Geomatica</strong> <strong>WebServer</strong> Suite <strong>Installation</strong> <strong>Guide</strong> 103


Chapter 8 - API Reference for the WMS<br />

Returns:<br />

Instance of WithinDistanceOp. null if geometry is is not supported.<br />

createNearestOp<br />

public void createNearestOp(GeometryIF geometry)<br />

Create an Nearest spatial operator<br />

Parameters:<br />

geometry - Geometry used by the operator. Only Point2D is supported.<br />

Returns:<br />

Instance of NearestOp. null if geometry is is not supported.<br />

createCrossesOp<br />

public void createCrossesOp(GeometryIF geometry)<br />

Create an Crosses spatial operator<br />

Parameters:<br />

geometry - Geometry used by the operator. Only Point2D is supported.<br />

Returns:<br />

Instance of CrossesOp. null if geometry is is not supported.<br />

createOverlapOp<br />

public void createOverlapOp(GeometryIF geometry)<br />

Create an Overlap spatial operator<br />

Parameters:<br />

geometry - Geometry used by the operator. Only Point2D is supported.<br />

Returns:<br />

Instance of OverlapOp. null if geometry is is not supported.<br />

createBBoxOp<br />

public void createBBoxOp(GeometryIF geometry)<br />

Create an BBox spatial operator<br />

Parameters:<br />

geometry - Geometry used by the operator. Only Point2D is supported.<br />

Returns:<br />

Instance of BBoxOp. null if geometry is is not supported.<br />

createWithinOp<br />

public void createWithinOp(GeometryIF geometry)<br />

Create an Within spatial operator<br />

104 PCI Geomatics


Parameters:<br />

geometry - Geometry used by the operator. Only Point2D is supported.<br />

Returns:<br />

Instance of WithinOp. null if geometry is is not supported.<br />

getSpatialFilter<br />

public SpatialFilter getSpatialFilter(java.lang.String layerID)<br />

Get the spatial filter applied for the specific layer identified by layerID.<br />

Parameters:<br />

layerID - identifier of the layer<br />

Returns:<br />

SpatialFilter spatial filter applied to this layer<br />

setSpatialFilter<br />

public void setSpatialFilter(java.lang.String layerID,<br />

SpatialFilter filter)<br />

Set the spatial filter applied for the specific layer identified by layerID.<br />

Parameters:<br />

layerID - identifier of the layer<br />

filter - SpatialFilter spatial filter applied to this layer<br />

getSpatialFilter<br />

public SpatialFilter getSpatialFilter()<br />

Get the spatial filter applied for all the layers<br />

Returns:<br />

SpatialFilterIF instance<br />

setSpatialFilter<br />

public void setSpatialFilter()<br />

Set the spatial filter applied for all the layers<br />

getJoin<br />

public Join getJoin(java.lang.String layerID)<br />

Get the join information for the specific layer identified by layerID.<br />

Parameters:<br />

layerID - identifier of the layer<br />

Returns:<br />

Instance of Join<br />

Class LayerInfoFilterConfig<br />

<strong>Geomatica</strong> <strong>WebServer</strong> Suite <strong>Installation</strong> <strong>Guide</strong> 105


Chapter 8 - API Reference for the WMS<br />

setJoin<br />

public void setJoin(java.lang.String layerID,<br />

Join join)<br />

Set the join information for the specific layer identified by layerID.<br />

Parameters:<br />

layerID - identifier of the layer<br />

join - Instance of Join<br />

setFullEnvelope<br />

public void setFullEnvelope(java.lang.String layerID,<br />

java.lang.String bFullEnvelope)<br />

Set whether the response should indicate the full envelope for all returned features of the layer or not. Use "true" if the response indicates the envelope,"false"<br />

otherwise<br />

Parameters:<br />

layerID - identifier of the layer<br />

bFullEnvelope - "true" if the response indicates the envelope,"false" otherwise<br />

setFullEnvelopeByInt<br />

public void setFullEnvelopeByInt(java.lang.String layerID,<br />

int bFullEnvelope)<br />

Set whether the response should indicate the full envelope for all returned features of the layer or not. Use 1 if the response indicates the envelope,0<br />

otherwise.<br />

Parameters:<br />

layerID - identifier of the layer<br />

bFullEnvelope - 1 if the response indicates the envelope,0 otherwise<br />

hasFullEnvelope<br />

public boolean hasFullEnvelope(java.lang.String layerID)<br />

Indicates if the response indicates the full envelope for all returned features of the layer or not.<br />

Parameters:<br />

layerID - identifier of the layer<br />

Returns:<br />

true if the response indicates the envelope, false otherwise<br />

setEnvelope<br />

public void setEnvelope(java.lang.String layerID,<br />

java.lang.String bEnvelope)<br />

Set whether the response should indicate the envelope for each returned features or not. Use "true" if the response indicates the envelope,"false" otherwise.<br />

106 PCI Geomatics


Parameters:<br />

layerID - identifier of the layer<br />

bEnvelope - "true" if the response indicates the envelope for each feature,"false" otherwise<br />

Class LayerInfoFilterConfig<br />

setEnvelopeByInt<br />

public void setEnvelopeByInt(java.lang.String layerID,<br />

int bEnvelope)<br />

Set whether the response should indicate the full envelope for all returned features of the layer or not. Use 1 if the response indicates the envelope for<br />

each feature,0 otherwise.<br />

Parameters:<br />

layerID - identifier of the layer<br />

bEnvelope - 1 if the response indicates the envelope,0 otherwise<br />

hasEnvelope<br />

public boolean hasEnvelope(java.lang.String layerID)<br />

Indicates if the response should indicate the envelope for each returned features<br />

Parameters:<br />

layerID - identifier of the layer<br />

Returns:<br />

true if the response indicates the envelope, false otherwise<br />

getXSLTInfo<br />

public XSLTInfo getXSLTInfo()<br />

Get the XSLTInfo for the request used to transform the result set.<br />

Returns:<br />

XSLTInfo associated with the request<br />

setXSLTInfo<br />

public void setXSLTInfo(java.lang.String path)<br />

Set the XSLTInfo for the request used to transform the result set.<br />

getXSLTInfoParam<br />

public java.lang.String getXSLTInfoParam(java.lang.String key)<br />

Get the parameter for the xslt<br />

setXSLTInfoParam<br />

public void setXSLTInfoParam(java.lang.String key,<br />

java.lang.String value)<br />

Set the parameter for the xslt<br />

<strong>Geomatica</strong> <strong>WebServer</strong> Suite <strong>Installation</strong> <strong>Guide</strong> 107


Chapter 8 - API Reference for the WMS<br />

getNumXSLTInfoParam<br />

public int getNumXSLTInfoParam()<br />

Get the parameter number<br />

Returns:<br />

int the number of parameters<br />

getMaxFeature<br />

public int getMaxFeature()<br />

Get the maximum number of features returned for all layers<br />

Returns:<br />

maximum number of features returned for all layers<br />

setMaxFeature<br />

public void setMaxFeature(java.lang.String layerID,<br />

java.lang.String maxFeature)<br />

Set the maximum number of features returned for all layers<br />

Parameters:<br />

maxFeature - maximum number of features returned for all layers<br />

getOutputFormat<br />

public java.lang.String getOutputFormat()<br />

Get the output format name used to retrieve the result<br />

Returns:<br />

output format name<br />

setOutputFormat<br />

public void setOutputFormat(java.lang.String outputFormat)<br />

Set the output format name used to retrieve the result<br />

getID<br />

public java.lang.String getID()<br />

Get the identifier of the layerInfoFilter. Typically set for asynchrounous communication or stored queries<br />

Returns:<br />

identifier of the LayerInfoFilter<br />

setID<br />

public void setID(java.lang.String ID)<br />

Set the identifier of the layerInfoFilter. Typically set for asynchrounous communication or stored queries<br />

108 PCI Geomatics


Parameters:<br />

ID - identifier of the LayerInfoFilter<br />

isDirectOutput<br />

public boolean isDirectOutput()<br />

Indicate if the output needs to be sent directly or accessed indirectly via a URL or file<br />

Returns:<br />

true if the rensponse is returned directly, false otherwise<br />

setDirectOutput<br />

public void setDirectOutput(boolean directOutput)<br />

Indicatea if the output needs to be sent directly or accessed indirectly via a URL or file<br />

Parameters:<br />

directOutput - true if the rensponse is returned directly, false otherwise<br />

getXMLLayerInfoFilter<br />

public java.lang.String getXMLLayerInfoFilter()<br />

Get the XML encoding of the layer info filter. This could be used in Javascript to send directly the query from a browser.<br />

Returns:<br />

XML encoding of the filter. null if any problem is found. Encoded specifically for HTTP Get.<br />

getLayerInfoFilterURL<br />

public java.lang.String getLayerInfoFilterURL()<br />

Get the URL corresponding to the query based on HTTP Get<br />

Returns:<br />

URI of the request<br />

displayLayerInfoResult<br />

public void displayLayerInfoResult()<br />

Send the layer info query and display the result in the browser window identified by windowName.<br />

Class LayerInfoFilterConfig<br />

<strong>Geomatica</strong> <strong>WebServer</strong> Suite <strong>Installation</strong> <strong>Guide</strong> 109


Chapter 8 - API Reference for the WMS<br />

Class Extent<br />

This class represents an extent of a figure or drawing. It is written to replace the Rectangle2D.Double that is only available Java 1.2. This class will<br />

ensure that the class is portable among different JVM.<br />

Field Summary<br />

Fields inherited from class com.pcigeomatics.drawing.geom.RectangleDouble<br />

height, width, x, y<br />

Constructor Summary<br />

Extent()<br />

This default constructor builds an extent where the upper left corner is set to (0,0) and the width and height are both set to 0.0.<br />

Extent(double x, double y)<br />

Constructs and initializes a Extent at the specified origin in user-space.<br />

Extent(double x, double y, double width, double height)<br />

Constructs and initializes an Extent with the specified origin in user-space, width, and height.<br />

Extent(Point2d point)<br />

Constructs and initializes a RectangleDouble at the specified origin in user-space.<br />

Extent(RectangleDouble r)<br />

Constructor taking a RectangleDouble as parameter.<br />

Method Summary<br />

java.lang.Object<br />

Extent<br />

Extent<br />

java.lang.String<br />

java.lang.String<br />

clone( )<br />

Makes a copy of of an Extent object.<br />

createIntersection(Extent extent)<br />

Returns a new Extent object representing the intersection of this Extent with the specified Extent extent.<br />

createUnion(Extent extent)<br />

Returns a new Extent object representing the union of this Extent with the specified extent.<br />

returnStringBBOX( )<br />

Get a string representing the Extent.<br />

String( )<br />

Get a string representing the Extent.<br />

110 PCI Geomatics


Methods inherited from class com.pcigeomatics.drawing.geom.RectangleDouble<br />

Extent<br />

public Extent()<br />

This default constructor builds an extent where the upper left corner is set to (0,0) and the width and height are both set to 0.0.<br />

Extent<br />

public Extent(double x,<br />

double y,<br />

double width,<br />

double height)<br />

Constructs and initializes an Extent with the specified origin in user-space, width, and height.<br />

Parameters:<br />

x - upper left x coordinate<br />

y - upper left y coordinate<br />

width - width of the extent<br />

height - height of the extent<br />

Extent<br />

public Extent(double x,<br />

double y)<br />

Constructs and initializes a Extent at the specified origin in user-space. The width and height are both set to 0.0.<br />

Parameters:<br />

x - the X ordinate of the upper left corner of the newly constructed Extent<br />

y - the Y ordinate of the upper left corner of the newly constructed Extent<br />

Extent<br />

public Extent(Point2d point)<br />

Constructs and initializes a RectangleDouble at the specified origin in user-space. The width and height are both set to 0.0.<br />

Class Extent<br />

add, add, add, buffer, contains, contains, createIntersection, createUnion, equals, getCenter, getHeight, getMaxX,<br />

getMaxY, getMinX, getMinY, getWidth, hashCode, intersect, intersects, intersects, isEmpty, main, moveBy, setFromDiagonal,<br />

setFromDiagonal, setRectangle, setRectangle, union<br />

Methods inherited from class java.lang.Object<br />

equals, finalize, getClass, notify, notifyAll, wait, wait, wait<br />

Constructor Detail<br />

<strong>Geomatica</strong> <strong>WebServer</strong> Suite <strong>Installation</strong> <strong>Guide</strong> 111


Chapter 8 - API Reference for the WMS<br />

Parameters:<br />

point - Point2d origin of the rectangle<br />

Extent<br />

public Extent(RectangleDouble r)<br />

Constructor taking a RectangleDouble as parameter.<br />

Parameters:<br />

r - RectangleDouble used to initialize the Extent<br />

Method Detail<br />

createIntersection<br />

public Extent createIntersection(Extent extent)<br />

Returns a new Extent object representing the intersection of this Extent with the specified Extent extent.<br />

Parameters:<br />

extent - the Extent to be intersected with this Extent<br />

Returns:<br />

the largest Extent contained in both the specified extent and in this Extent<br />

createUnion<br />

public Extent createUnion(Extent extent)<br />

Returns a new Extent object representing the union of this Extent with the specified extent.<br />

Parameters:<br />

extent - the Extent to be combined with this Extent<br />

Returns:<br />

the smallest Extent containing both the specified extent and this Extent.<br />

clone<br />

public java.lang.Object clone()<br />

Makes a copy of of an Extent object. The ULC, width, and height will have the exact same values.<br />

Overrides:<br />

clone in class RectangleDouble<br />

Returns:<br />

the Clone of the Extent.<br />

112 PCI Geomatics


toString<br />

public java.lang.String toString()<br />

Get a string representing the Extent. The format of the String is "Extent : ULX = #x#, ULY = #y#, width = #w#, height = #h#", where:<br />

• #x# is the upper left X value<br />

• #y# is the upper left Y value<br />

• #w# is the width<br />

• #h# is the height<br />

This is often used for debugging purposes.<br />

Overrides:<br />

toString in class RectangleDouble<br />

Returns:<br />

a String in the given.<br />

returnStringBBOX<br />

public java.lang.String returnStringBBOX()<br />

Get a string representing the Extent. The format of the String is "lx, by, rx, ty", where:<br />

• lx is the left most X value<br />

• by is the bottom most Y value (equal to: ty-height)<br />

• rx is the right most X value (equal to: lx + width)<br />

• ty is the top most Y value<br />

Returns:<br />

a String in the given format.<br />

Class Point2d<br />

java.lang.Object<br />

com.pcigeomatics.drawing.geom.Point2d<br />

All Implemented Interfaces:<br />

java.lang.Cloneable<br />

public class Point2d<br />

extends java.lang.Object<br />

implements java.lang.Cloneable<br />

Class Point2d<br />

<strong>Geomatica</strong> <strong>WebServer</strong> Suite <strong>Installation</strong> <strong>Guide</strong> 113


Chapter 8 - API Reference for the WMS<br />

Point2D represents a 2 dimensional point with coordinates in double precision. This class is provided as a replacement of Point2D.Double (Java2) for Java<br />

1.1.<br />

Since:<br />

09/03/2001<br />

Field Summary<br />

double x<br />

The X coordinate of this Point2d.<br />

double y<br />

The Y coordinate of this Point2d.<br />

Constructor Summary<br />

Point2d()<br />

Constructs and initializes a Point2d with coordinates (0,0).<br />

Point2d(double x, double y)<br />

Constructs and initializes a Point2d with the specified coordinates.<br />

Method Summary<br />

static Point2d<br />

add(Point2d p1, Point2d p2)<br />

Add coordinates p1 to p2 to create new point<br />

java.lang.Object clone()<br />

Creates a new object of the same class and with the same contents as this object.<br />

double<br />

static double<br />

double<br />

double<br />

static Point2d<br />

distance(double PX, double PY)<br />

Returns the distance from this Point2d to a specified point.<br />

distance(double X1, double Y1, double X2, double Y2)<br />

Returns the distance between two points.<br />

getX()<br />

getY()<br />

Returns the X ordinate of this Point2d in double precision.<br />

Returns the Y ordinate of this Point2d in double precision.<br />

scale(Point2d p1, double scale)<br />

Scale coordinates p1 by factor scale<br />

114 PCI Geomatics


void<br />

static Point2d<br />

x<br />

public double x<br />

The X coordinate of this Point2d.<br />

y<br />

public double y<br />

The Y coordinate of this Point2d.<br />

Point2d<br />

public Point2d()<br />

setLocation(double x, double y)<br />

Sets the location of this Point2d to the specified double coordinates.<br />

substract(Point2d p1, Point2d p2)<br />

Subtract coordinates p2 from p1 to create new point<br />

java.lang.String toString()<br />

Returns a String that represents the value of this Point2d.<br />

Methods inherited from class java.lang.Object<br />

equals, getClass, hashCode, notify, notifyAll, wait, wait, wait<br />

Field Detail<br />

Constructor Detail<br />

Constructs and initializes a Point2d with coordinates (0,0).<br />

Point2d<br />

public Point2d(double x,<br />

double y)<br />

Constructs and initializes a Point2d with the specified coordinates.<br />

Parameters:<br />

x - the X ordinate of the point<br />

y - the Y ordinate of the point<br />

Method Detail<br />

Class Point2d<br />

<strong>Geomatica</strong> <strong>WebServer</strong> Suite <strong>Installation</strong> <strong>Guide</strong> 115


Chapter 8 - API Reference for the WMS<br />

getX<br />

public double getX()<br />

Returns the X ordinate of this Point2d in double precision.<br />

Returns:<br />

the X ordinate of this Point2d.<br />

getY<br />

public double getY()<br />

Returns the Y ordinate of this Point2d in double precision.<br />

Returns:<br />

the Y ordinate of this Point2d.<br />

setLocation<br />

public void setLocation(double x,<br />

double y)<br />

Sets the location of this Point2d to the specified double coordinates.<br />

Parameters:<br />

x - the X ordinate of the point<br />

y - the Y ordinate of the point<br />

distance<br />

public double distance(double PX,<br />

double PY)<br />

Returns the distance from this Point2d to a specified point.<br />

Parameters:<br />

PX - the X ordinate of the first point<br />

PY - the Y ordinate of the first point<br />

Returns:<br />

the distance between this Point2d and a specified point.<br />

distance<br />

public static double distance(double X1,<br />

double Y1,<br />

double X2,<br />

double Y2)<br />

Returns the distance between two points.<br />

Parameters:<br />

X1 - the X ordinate of the first point<br />

116 PCI Geomatics


Y1 - the Y ordinate of the first point<br />

X2 - the X ordinate of the second point<br />

Y2 - the Y ordinate of the second point<br />

Returns:<br />

the distance between the two sets of specified coordinates.<br />

add<br />

public static Point2d add(Point2d p1,<br />

Point2d p2)<br />

Add coordinates p1 to p2 to create new point<br />

Parameters:<br />

p1 - first point<br />

p2 - second point<br />

Returns:<br />

new point (p1+p2)<br />

substract<br />

public static Point2d substract(Point2d p1,<br />

Point2d p2)<br />

Subtract coordinates p2 from p1 to create new point<br />

Parameters:<br />

p1 - first point<br />

p2 - second point<br />

Returns:<br />

new point (p1-p2)<br />

scale<br />

public static Point2d scale(Point2d p1,<br />

double scale)<br />

Scale coordinates p1 by factor scale<br />

Parameters:<br />

p1 - first point<br />

scale - scale to apply to point<br />

Returns:<br />

new point scale * p1<br />

toString<br />

public java.lang.String toString()<br />

Class Point2d<br />

<strong>Geomatica</strong> <strong>WebServer</strong> Suite <strong>Installation</strong> <strong>Guide</strong> 117


Chapter 8 - API Reference for the WMS<br />

Returns a String that represents the value of this Point2d.<br />

Overrides:<br />

toString in class java.lang.Object<br />

Returns:<br />

a string representation of this Point2D.<br />

clone<br />

public java.lang.Object clone()<br />

Creates a new object of the same class and with the same contents as this object.<br />

Overrides:<br />

clone in class java.lang.Object<br />

Returns:<br />

a clone of this instance.<br />

Throws:<br />

java.lang.OutOfMemoryError - if there is not enough memory.<br />

See Also:<br />

Cloneable<br />

Class RectangleDouble<br />

java.lang.Object<br />

com.pcigeomatics.drawing.geom.RectangleDouble<br />

All Implemented Interfaces:<br />

java.io.Serializable, java.lang.Cloneable<br />

Direct Known Subclasses:<br />

Extent<br />

public class RectangleDouble<br />

extends java.lang.Object<br />

implements java.lang.Cloneable, java.io.Serializable<br />

The RectangleDouble class defines a rectangle specified in double precision coordinates. It was created to be JDK1.0 compatible.<br />

118 PCI Geomatics


See Also:<br />

Serialized Form<br />

Field Summary<br />

double<br />

double<br />

double<br />

double<br />

Constructor Summary<br />

height<br />

The height of this RectangleDouble.<br />

width<br />

The width of this RectangleDouble.<br />

x<br />

The x coordinate of the upper left corner of this RectangleDouble.<br />

y<br />

The y coordinate of the upper left corner of this RectangleDouble.<br />

RectangleDouble()<br />

Constructs a new RectangleDouble.<br />

RectangleDouble(double initX, double initY)<br />

Constructs and initializes a RectangleDouble at the specified origin in user-space.<br />

RectangleDouble(double initX, double initY, double initWidth, double initHeight)<br />

Constructs and initializes a RectangleDouble object from the specified coordinates.<br />

RectangleDouble(Point2d initPoint)<br />

Constructs and initializes a RectangleDouble at the specified origin in user-space.<br />

Method Summary<br />

void<br />

add(double newx, double newy)<br />

Adds a point, specified by the double precision arguments newx and newy, to this RectangleDouble.<br />

void<br />

add(Point2d p)<br />

Adds a point, specified by the double precision arguments newx and newy, to this RectangleDouble.<br />

void<br />

add(RectangleDouble r)<br />

Adds a RectangleDouble object to this RectangleDouble.<br />

void<br />

buffer(double distanceX, double distanceY)<br />

Increase the size of the rectangle by the amounts given.<br />

java.lang.Object clone()<br />

Clone the rectangle<br />

boolean<br />

contains(double xIn, double yIn)<br />

Tests if a specified coordinate is inside the boundary of this RectangleDouble.<br />

Class RectangleDouble<br />

<strong>Geomatica</strong> <strong>WebServer</strong> Suite <strong>Installation</strong> <strong>Guide</strong> 119


Chapter 8 - API Reference for the WMS<br />

boolean<br />

RectangleDouble<br />

RectangleDouble<br />

boolean<br />

Point2d<br />

double<br />

double<br />

double<br />

double<br />

double<br />

double<br />

int<br />

static void<br />

boolean<br />

boolean<br />

boolean<br />

void<br />

void<br />

contains(double xIn, double yIn, double wIn, double hIn)<br />

Tests if the interior of this RectangleDouble entirely contains the specified set of rectangular coordinates.<br />

createIntersection(RectangleDouble r)<br />

Returns a new RectangleDouble object representing the intersection of this RectangleDouble with the specified RectangleDouble.<br />

createUnion(RectangleDouble r)<br />

Returns a new RectangleDouble object representing the union of this RectangleDouble with the specified RectangleDouble r.<br />

equals(RectangleDouble anotherRectangle)<br />

This method checks if two RectangleDoubles are similar, i.e same coordinates.<br />

getCenter()<br />

Get the center of the rectangle<br />

getHeight()<br />

Get the height of the rectangle.<br />

getMaxX()<br />

Get the maximum X coordinate of the rectangle.<br />

getMaxY()<br />

Get the maximum Y coordinate of the rectangle.<br />

getMinX()<br />

Get the minimum X coordinate of the rectangle.<br />

getMinY()<br />

Get the minimum Y coordinate of the rectangle.<br />

getWidth()<br />

Get the width of the rectangle.<br />

hashCode()<br />

Returns the hashcode for this RectangleDouble.<br />

intersect(RectangleDouble src1, RectangleDouble src2, RectangleDouble dest)<br />

Intersects the pair of specified source RectangleDouble objects and puts the result into the specified destination RectangleDouble<br />

object.\<br />

intersects(double xIn, double yIn, double wIn, double hIn)<br />

Tests if the interior of this RectangleDouble intersects the interior of a specified set of rectangular coordinates.<br />

intersects(RectangleDouble r)<br />

Tests if the interior of this RectangleDouble intersects the interior of a specified RectangleDouble<br />

isEmpty()<br />

Determines whether or not this RectangleDouble is empty.<br />

moveBy(double dx, double dy)<br />

Move the rectangle by the offset (dx,dy).<br />

setFromDiagonal(double x1, double y1, double x2, double y2)<br />

Sets the diagonal of the rectangle based on the two specified coordinates.<br />

120 PCI Geomatics


x<br />

public double x<br />

The x coordinate of the upper left corner of this RectangleDouble. It can also be considered the minimum X coordinate.<br />

y<br />

public double y<br />

The y coordinate of the upper left corner of this RectangleDouble. It can also be considered the maximum Y coordinate.<br />

width<br />

public double width<br />

The width of this RectangleDouble.<br />

height<br />

public double height<br />

The height of this RectangleDouble.<br />

RectangleDouble<br />

public RectangleDouble()<br />

Constructs a new RectangleDouble. The location and size (width and height) are all initialized to 0.<br />

Class RectangleDouble<br />

void<br />

setFromDiagonal(Point2d p1, Point2d p2)<br />

Sets the diagonal of the rectangle based on the two specified point in double precision.<br />

void<br />

setRectangle(double newX, double newY, double newWidth, double newHeight)<br />

Sets the location and size of this RectangleDouble to the specified double values.<br />

void<br />

setRectangle(RectangleDouble sourceRectangle)<br />

Copy the settings of the specified RectangleDouble, sourceRectangle, to thisRectangleDouble.<br />

java.lang.String toString()<br />

Returns the String representation of this RectangleDouble.<br />

static void<br />

union(RectangleDouble src1, RectangleDouble src2, RectangleDouble dest)<br />

Unions the pair of source RectangleDouble objects and puts the result into the specified destination RectangleDouble dest object.<br />

Methods inherited from class java.lang.Object<br />

equals, getClass, notify, notifyAll, wait, wait, wait<br />

Field Detail<br />

Constructor Detail<br />

<strong>Geomatica</strong> <strong>WebServer</strong> Suite <strong>Installation</strong> <strong>Guide</strong> 121


Chapter 8 - API Reference for the WMS<br />

Location ( x = 0.0, y = 0.0 )<br />

ize ( width = 0.0, height = 0.0 )<br />

RectangleDouble<br />

public RectangleDouble(double initX,<br />

double initY,<br />

double initWidth,<br />

double initHeight)<br />

Constructs and initializes a RectangleDouble object from the specified coordinates.<br />

Parameters:<br />

initX - initial X ordinate of the upper left corner of the newly constructed RectangleDouble.<br />

initY - initial Y ordinate of the upper left corner of the newly constructed RectangleDouble.<br />

initWidth - initial width of the newly constructed RectangleDouble.<br />

initHeight - initial height of the newly constructed RectangleDouble.<br />

RectangleDouble<br />

public RectangleDouble(double initX,<br />

double initY)<br />

Constructs and initializes a RectangleDouble at the specified origin in user-space. The width and height are set to 0.<br />

Parameters:<br />

initX - initial X ordinate of the upper left corner of the newly constructed RectangleDouble.<br />

initY - initial Y ordinate of the upper left corner of the newly constructed RectangleDouble.<br />

RectangleDouble<br />

public RectangleDouble(Point2d initPoint)<br />

Constructs and initializes a RectangleDouble at the specified origin in user-space. The width and height are set to 0.<br />

Parameters:<br />

initPoint - Point2d origin of the rectangle<br />

Method Detail<br />

getMinX<br />

public double getMinX()<br />

Get the minimum X coordinate of the rectangle.<br />

Returns:<br />

minimum X coordinate of the rectangle.<br />

122 PCI Geomatics


getMaxX<br />

public double getMaxX()<br />

Get the maximum X coordinate of the rectangle. This is equivalent to getMinX() + getWidth().<br />

Returns:<br />

maximum X coordinate of the rectangle.<br />

getMinY<br />

public double getMinY()<br />

Get the minimum Y coordinate of the rectangle. This is equivalent to getMaxY() - getHeight().<br />

Returns:<br />

minimum Y coordinate of the rectangle.<br />

getMaxY<br />

public double getMaxY()<br />

Get the maximum Y coordinate of the rectangle.<br />

Returns:<br />

maximum Y coordinate of the rectangle.<br />

getWidth<br />

public double getWidth()<br />

Get the width of the rectangle.<br />

Returns:<br />

width of the rectangle.<br />

getHeight<br />

public double getHeight()<br />

Get the height of the rectangle.<br />

Returns:<br />

height of the rectangle.<br />

setRectangle<br />

public void setRectangle(double newX,<br />

double newY,<br />

double newWidth,<br />

double newHeight)<br />

Sets the location and size of this RectangleDouble to the specified double values.<br />

Parameters:<br />

Class RectangleDouble<br />

<strong>Geomatica</strong> <strong>WebServer</strong> Suite <strong>Installation</strong> <strong>Guide</strong> 123


Chapter 8 - API Reference for the WMS<br />

newX - the new X ordinate of the upper left corner of this rectangle.<br />

newY - the new Y ordinate of the upper left corner of this rectangle.<br />

newWidth - the new width of this rectangle.<br />

newHeight - the new height of this rectangle.<br />

setRectangle<br />

public void setRectangle(RectangleDouble sourceRectangle)<br />

Copy the settings of the specified RectangleDouble, sourceRectangle, to thisRectangleDouble.<br />

Parameters:<br />

sourceRectangle - the RectangleDouble to copy.<br />

setFromDiagonal<br />

public void setFromDiagonal(double x1,<br />

double y1,<br />

double x2,<br />

double y2)<br />

Sets the diagonal of the rectangle based on the two specified coordinates. This method takes care of determining the minimum and maximum values of<br />

the x and y coordinates of each point. It will perform a swap if needed.<br />

Parameters:<br />

x1 - the first specified X coordinate<br />

y1 - the first specified Y coordinate<br />

x2 - the second specified X coordinate<br />

y2 - the second specified Y coordinate<br />

setFromDiagonal<br />

public void setFromDiagonal(Point2d p1,<br />

Point2d p2)<br />

Sets the diagonal of the rectangle based on the two specified point in double precision. This method takes care of determining the minimum and maximum<br />

values of the x and y coordinates of each point. It will perform a swap if needed.<br />

Parameters:<br />

p1 - the first specified point.<br />

p2 - the second specified point.<br />

equals<br />

public boolean equals(RectangleDouble anotherRectangle)<br />

This method checks if two RectangleDoubles are similar, i.e same coordinates.<br />

Returns:<br />

true if the two rectangles are similar false if the two rectangles are different<br />

124 PCI Geomatics


isEmpty<br />

public boolean isEmpty()<br />

Class RectangleDouble<br />

Determines whether or not this RectangleDouble is empty. An RectangleDouble is considered as empty if width or height are less or equal 0.0.<br />

Returns:<br />

true if this RectangleDouble is empty; false otherwise.<br />

createIntersection<br />

public RectangleDouble createIntersection(RectangleDouble r)<br />

Returns a new RectangleDouble object representing the intersection of this RectangleDouble with the specified RectangleDouble.<br />

Parameters:<br />

r - the RectangleDouble to be intersected with this RectangleDouble<br />

Returns:<br />

the largest RectangleDouble contained in both the specified RectangleDouble and in this RectangleDouble<br />

createUnion<br />

public RectangleDouble createUnion(RectangleDouble r)<br />

Returns a new RectangleDouble object representing the union of this RectangleDouble with the specified RectangleDouble r.<br />

Parameters:<br />

r - the RectangleDouble to be combined with this RectangleDouble<br />

Returns:<br />

the smallest RectangleDouble containing both the specified RectangleDouble r and this RectangleDouble.<br />

add<br />

public void add(double newx,<br />

double newy)<br />

Adds a point, specified by the double precision arguments newx and newy, to this RectangleDouble. The resulting RectangleDouble is the smallest RectangleDouble<br />

that contains both the original RectangleDouble and the specified point.<br />

After adding a point, a call to contains with the added point as an argument does not necessarily return true. The contains method does not return true<br />

for points on the right or bottom edges of a rectangle. Therefore, if the added point falls on the left or bottom edge of the enlarged rectangle, contains<br />

returns false for that point.<br />

Parameters:<br />

newx - the X coordinates of the new point.<br />

newy - the Y coordinates of the new point<br />

add<br />

public void add(Point2d p)<br />

Adds a point, specified by the double precision arguments newx and newy, to this RectangleDouble. The resulting RectangleDouble is the smallest RectangleDouble<br />

that contains both the original RectangleDouble and the specified point.<br />

<strong>Geomatica</strong> <strong>WebServer</strong> Suite <strong>Installation</strong> <strong>Guide</strong> 125


Chapter 8 - API Reference for the WMS<br />

After adding a point, a call to contains with the added point as an argument does not necessarily return true. The contains method does not return true<br />

for points on the right or bottom edges of a rectangle. Therefore, if the added point falls on the left or bottom edge of the enlarged rectangle, contains<br />

returns false for that point.<br />

Parameters:<br />

p - Point2d the new point to add in the extent<br />

add<br />

public void add(RectangleDouble r)<br />

Adds a RectangleDouble object to this RectangleDouble. The resulting RectangleDouble is the union of the two RectangleDouble objects.<br />

Parameters:<br />

r - the RectangleDouble to add to this RectangleDouble.<br />

contains<br />

public boolean contains(double xIn,<br />

double yIn)<br />

Tests if a specified coordinate is inside the boundary of this RectangleDouble.<br />

Parameters:<br />

xIn - the x coordinates to test.<br />

yIn - the y corrdinates to test.<br />

Returns:<br />

true if the specified coordinates are inside the boundary of this RectangleDouble; false otherwise.<br />

contains<br />

public boolean contains(double xIn,<br />

double yIn,<br />

double wIn,<br />

double hIn)<br />

Tests if the interior of this RectangleDouble entirely contains the specified set of rectangular coordinates.<br />

Parameters:<br />

xIn - the X ordinates of the upper left corner of the specified set of rectangular coordinates<br />

yIn - the Y ordinates of the upper left corner of the specified set of rectangular coordinates<br />

wIn - the width of the specified set of rectangular coordinates<br />

hIn - the height of the specified set of rectangular coordinates<br />

Returns:<br />

true if this RectangleDouble entirely contains specified set of rectangular coordinates; false otherwise.<br />

intersect<br />

public static void intersect(RectangleDouble src1,<br />

126 PCI Geomatics


Class RectangleDouble<br />

RectangleDouble src2,<br />

RectangleDouble dest)<br />

Intersects the pair of specified source RectangleDouble objects and puts the result into the specified destination RectangleDouble object.\<br />

Parameters:<br />

src1 - the first of a pair of RectangleDouble objects to be intersected with each other<br />

src2 - the second of a pair of RectangleDouble objects to be intersected with each other<br />

dest - the RectangleDouble that holds the results of the intersection of src1 and src2<br />

intersects<br />

public boolean intersects(double xIn,<br />

double yIn,<br />

double wIn,<br />

double hIn)<br />

Tests if the interior of this RectangleDouble intersects the interior of a specified set of rectangular coordinates.<br />

Parameters:<br />

xIn - the X ordinates of the upper left corner of the specified set of rectangular coordinates<br />

yIn - the Y ordinates of the upper left corner of the specified set of rectangular coordinates<br />

wIn - the width of the specified set of rectangular coordinates<br />

hIn - the height of the specified set of rectangular coordinates<br />

Returns:<br />

true if this RectangleDouble intersects the interior of a specified set of rectangular coordinates; false otherwise.<br />

intersects<br />

public boolean intersects(RectangleDouble r)<br />

Tests if the interior of this RectangleDouble intersects the interior of a specified RectangleDouble<br />

Parameters:<br />

r - the of RectangleDouble object to be intersected with this one.<br />

Returns:<br />

true if this RectangleDouble intersects the interior of r; false otherwise.<br />

union<br />

public static void union(RectangleDouble src1,<br />

RectangleDouble src2,<br />

RectangleDouble dest)<br />

Unions the pair of source RectangleDouble objects and puts the result into the specified destination RectangleDouble dest object.<br />

Parameters:<br />

src1 - the first of a pair of RectangleDouble objects to be combined with each other<br />

src2 - the second of a pair of RectangleDouble objects to be combined with each other<br />

<strong>Geomatica</strong> <strong>WebServer</strong> Suite <strong>Installation</strong> <strong>Guide</strong> 127


Chapter 8 - API Reference for the WMS<br />

dest - the RectangleDouble that holds the results of the union of src1 and src2<br />

moveBy<br />

public void moveBy(double dx,<br />

double dy)<br />

Move the rectangle by the offset (dx,dy).<br />

Parameters:<br />

dx - offset in X in user space<br />

dy - offset in Y in user space<br />

buffer<br />

public void buffer(double distanceX,<br />

double distanceY)<br />

Increase the size of the rectangle by the amounts given.<br />

Parameters:<br />

distanceX - is the amount to add on each side (left and right) of the retangle.<br />

distanceY - is the amount to add on each top and the bottom of the retangle.<br />

getCenter<br />

public Point2d getCenter()<br />

Get the center of the rectangle<br />

Returns:<br />

Point2D center of the rectangle in user-space coordinate<br />

clone<br />

public java.lang.Object clone()<br />

Clone the rectangle<br />

Overrides:<br />

clone in class java.lang.Object<br />

Returns:<br />

Clone of the rectangle<br />

hashCode<br />

public int hashCode()<br />

Returns the hashcode for this RectangleDouble.<br />

Overrides:<br />

hashCode in class java.lang.Object<br />

128 PCI Geomatics


Returns:<br />

the hashcode for this RectangleDouble.<br />

toString<br />

public java.lang.String toString()<br />

Returns the String representation of this RectangleDouble.<br />

Overrides:<br />

toString in class java.lang.Object<br />

Returns:<br />

a String representing this rectangle.<br />

Class RectangleDouble<br />

<strong>Geomatica</strong> <strong>WebServer</strong> Suite <strong>Installation</strong> <strong>Guide</strong> 129


Chapter 8 - API Reference for the WMS<br />

130 PCI Geomatics


Index<br />

A<br />

Abstract Parameter 42<br />

AccessConstraint Parameter 43<br />

Add Several Map Layers 68<br />

adding<br />

buttons 56<br />

elements 54<br />

measurement tools 58<br />

Query Buttons 59<br />

AllProject.xml 67<br />

ALT attribute 57<br />

Alter Zoom Values 57<br />

API 77<br />

applet 55<br />

AllProject.xml 67<br />

configuration files 17<br />

create configuration file 67<br />

layers.xml 67<br />

MapViewer configuration 67<br />

applet and browser 11<br />

Applet DTD 74<br />

Application Programming Interface 77<br />

APPLY button 55<br />

ArrayButtonName variable 56<br />

Assisted Configuration 40<br />

Attribute<br />

alt 57<br />

base 27, 28<br />

border 56<br />

default-style 73<br />

exception-format 70<br />

height 57<br />

info-format 70<br />

layerid 45, 73<br />

map-format 70<br />

mapService-Config.dtd 47<br />

MapViewer.dtd 74<br />

maxx 69<br />

maxy 69<br />

minx 69<br />

miny 69<br />

name 56<br />

onmousedown 57<br />

queryable 44, 73<br />

src 56<br />

srs 69<br />

131


type 27, 28, 71<br />

url 70<br />

version 71<br />

visible 71, 73<br />

width 57<br />

Automatic Configuration<br />

See Self-Configured<br />

B<br />

basic model 52<br />

Bbox Element 46<br />

BORDER attribute 56<br />

Bounding Box 46, 72<br />

browser 11<br />

Build Query Expressions 63<br />

Buttons 56<br />

C<br />

Capabilities 25, 42, 52, 70, 73<br />

Capabilities_DTD_URL parameter 42<br />

Change the Supported-Bbox 72<br />

check boxes 55<br />

CheckForm 55<br />

CheckFormQuery 55<br />

class<br />

Extent 109<br />

Layer 88<br />

LayerInfoFilterConfig 97<br />

MapViewerApplet 77<br />

Point2d 113<br />

RectangleDouble 118<br />

client<br />

WCS 10<br />

WFS 9<br />

WMS 11<br />

WMS applet 11<br />

Combo Box 58<br />

Config Parameter 67<br />

config.xml<br />

contact information 32<br />

deployment parameters 32<br />

fees and constraints 32<br />

file contents 31<br />

metadata configuration 33<br />

online resource parameter 32<br />

service information 32<br />

system properties 34<br />

temporary directory section 32<br />

WCS 31<br />

Configuration File<br />

Config Folder 17<br />

MapViewer Applet 67<br />

Servlet 39<br />

web.xml (WFS) 21<br />

wfs_init.properties 21<br />

Configure the MapViewer Applet 67<br />

Contact_Information 43<br />

coordinate display 53<br />

coverage, definition of 10<br />

Create your HTML file 54<br />

Create Your XML File 52<br />

CRS file<br />

EPSG codes 32<br />

Customized Configuration 40<br />

D<br />

data source configuration file (WFS) 27<br />

Debug 42<br />

default configuration 39<br />

Default Style Attribute 73<br />

deploy.xml file<br />

deploy elements and descriptions 36<br />

hierarchical structure of elements 35<br />

hierarchy of deploy and group paths 38<br />

location in WCS 35<br />

Description Element 71<br />

Determine the Supported-Styles 72<br />

display coordinates 64<br />

display overview 64<br />

132 PCI Geomatics


display the coordinates 53<br />

DisplayFeatureInfo 60<br />

DOCTYPE Definition 68<br />

Document Type Definition file (DTD) 17<br />

Drop-down Combo Box 58<br />

DTD 45<br />

GeoWSServlet Servlet 39, 45<br />

MapViewer 74<br />

E<br />

EASI Servlet 43<br />

Element<br />

abstract 45, 46<br />

bbox 45, 46<br />

description 71<br />

extent 69<br />

Filter 27, 28<br />

hostname 46<br />

layerid 68<br />

layertype 44, 46<br />

map 44, 45, 68, 71<br />

maplayer 44, 45, 71<br />

mapprovider 45, 46<br />

mapservice-config 44, 45<br />

mapService-Config.dtd 47<br />

MapViewer.dtd 74<br />

mapviewer-config 68, 69<br />

metadata 71<br />

port 46<br />

Source 27, 28<br />

Sources 27, 28<br />

style 45, 46<br />

supported-bbox 72<br />

supported-styles 72<br />

title 45, 71<br />

urladdress 46<br />

viewport 69<br />

WMSProvider 68, 70<br />

Environment Variables<br />

JAVA_HOME 14<br />

EPSG codes<br />

CRS text file 32<br />

publishing to the WMS 53<br />

SRS attribute 69<br />

Error in Tomcat (low memory) 18<br />

Exception-format Attribute 70<br />

Export the XML Project 41<br />

Extensible Stylesheet Language for Transformation (XSLT) 18<br />

Extent Element 69<br />

F<br />

Factor 58<br />

Feature_info 70<br />

features, definition of 9<br />

Fees Parameter 42<br />

Focus<br />

using WCS client 10<br />

using WFS client 9<br />

using WMS client 11<br />

Focus_HostName 40, 42<br />

Focus_Port 40, 42<br />

FocusConnector 46<br />

G<br />

GDBQuery 63<br />

generate Capabilities file 73<br />

<strong>Geomatica</strong><br />

installation 13<br />

<strong>Geomatica</strong> Focus<br />

using WCS client 10<br />

using WFS client 9<br />

using WMS client 11<br />

<strong>Geomatica</strong> <strong>WebServer</strong> Monitor 49<br />

GeoWSServlet Servlet 39<br />

GetMap 42<br />

GIFs 70<br />

graphics 18<br />

<strong>Geomatica</strong> <strong>WebServer</strong> Suite <strong>Installation</strong> <strong>Guide</strong> 133


H<br />

HEIGHT attribute 57<br />

HostName 42<br />

Hostname Element 46<br />

HTML files 53<br />

HTTP port 16<br />

HTTP Server 13<br />

I<br />

icons 18<br />

Info-format Attribute 70<br />

initialization properties (parameters)<br />

WFS 23<br />

WMS 41<br />

<strong>Installation</strong><br />

<strong>Geomatica</strong> 13<br />

Java Developer’s Kit (SDK) for Windows 14<br />

Tomcat server on Windows 14<br />

WAR file 16<br />

Intended Audience 7<br />

J<br />

Java<br />

install on Windows 14<br />

JavaScript 57<br />

adding buttons 56<br />

areaMeasure 59<br />

browserCheck 64<br />

circleMeasure 59<br />

cursorTool 64<br />

displayCoordinate 64<br />

DisplayFeatureInfo 60<br />

LayerOnOff 55<br />

LayerQueryableSimple 56<br />

lengthMeasure 59<br />

Line 62<br />

PanAndZoom 57<br />

Polygon 62, 63<br />

PropertyQuery 63<br />

QueryPointMode 61, 62<br />

redirectWindow 63<br />

SendQuery 63<br />

setTimeout 60<br />

toggleInfoQuery 60<br />

toggleInfoQueryLine 61<br />

toggleInfoQueryPoly 62<br />

zoom factor 58<br />

ZoomIn 57<br />

ZoomInDefault 57<br />

ZoomInPercent 57<br />

ZoomInPercentDefault 57<br />

ZoomOut 57<br />

ZoomOutDefault 57<br />

ZoomOutPercent 58<br />

ZoomOutPercentDefault 57<br />

ZoomPercentForm 58<br />

ZoomWindow 57<br />

ZoomZoom 57<br />

JPEGs 70<br />

JSMapViewer.js file 55, 57<br />

K<br />

KeyWord Parameter 42<br />

L<br />

Layerid Attribute 68, 73<br />

LayerOnOff function 55<br />

LayerQueryable 60<br />

LayerQueryableSimple 56<br />

layers.xml 67<br />

Layertype Tag 46<br />

logos 18<br />

Loop 55<br />

Low Memory Error 18<br />

M<br />

Manual Configuration<br />

See Customized<br />

134 PCI Geomatics


Map 70<br />

Map Element 68, 71<br />

Map Request 70<br />

map, definition of 10<br />

Map-format Attribute 70<br />

Maplayer Element 45, 68, 71<br />

Mapprovider Tag 46<br />

MapService_Configuration 40, 42<br />

MapService-Config DTD 47<br />

Mapservice-config Element 45<br />

MapViewer Applet 67<br />

MapViewer DTD 67, 74<br />

Mapviewer-config Element 68, 69<br />

MapViewerTemplate1.html 52<br />

MapViewerTemplates 51<br />

Maxx 69<br />

Maxy 69<br />

Measurement.js 58<br />

Metadata Element 71<br />

Microsoft Windows - recommended 8<br />

MIME 70<br />

Minx 69<br />

Miny 69<br />

Modify the Templates 52<br />

Monitor 50<br />

mosaics<br />

about 35<br />

setting 36<br />

Multipurpose Internet Mail Extensions 70<br />

N<br />

NAME attribute 56<br />

Name Parameter 42<br />

new window 63<br />

O<br />

OGC Web Mapping Server 71<br />

OGC_Compliancy_Mode 42<br />

OGC-WMT 71<br />

OnlineResource Parameter<br />

configuring the WFS 25<br />

configuring the WMS 42<br />

ONMOUSEDOWN attribute 57<br />

Open Geospatial 25, 42, 52<br />

open new page 63<br />

Overview 64<br />

P<br />

Parameter<br />

Capabilities_DTD_URL 42<br />

Focus_HostName 40, 42<br />

Focus_Port 40, 42<br />

fs.application.schema.namespace.url 26<br />

Initialization 41<br />

MapService_Configuration 40, 41, 42<br />

Path_Contact_Information 43<br />

Service_Abstract 42<br />

Service_AccessConstraint 43<br />

Service_Debug 42<br />

Service_Fees 42<br />

Service_KeyWord 42<br />

Service_Name 42<br />

Service_OnlineResource 42<br />

Service_Title 42<br />

setting in WMS 43<br />

wfs.application.schema.namespace. prefix 26<br />

wfs.bad.file.action 24<br />

wfs.capabilities.service.abstract 25<br />

wfs.capabilities.service.name 25<br />

wfs.capabilities.service.online.resource 25<br />

wfs.capabilities.service.title 25<br />

wfs.data.sources.filename 23<br />

wfs.invalid.characters.action 24<br />

wfs.share.matching.layer.name.action 24<br />

wfs.transaction.allow 24<br />

wfs.transaction.timeout 25<br />

Parameters 41<br />

Path_Contact_Information 43<br />

Percent Values 58<br />

<strong>Geomatica</strong> <strong>WebServer</strong> Suite <strong>Installation</strong> <strong>Guide</strong> 135


Port 42<br />

Port Tag 46<br />

Post.html 63<br />

Prevent corrupted or blank images 70<br />

PropertyQuery 63<br />

Publishing Your Data<br />

features 26<br />

maps 49<br />

maps in a Web page 50<br />

Q<br />

Query 55<br />

query tools 59<br />

display coordinate 64<br />

GDBQuery 63<br />

General Query button 60<br />

Line Query button 61<br />

Polygon Query button 61<br />

Query Select Point button 61<br />

saved queries 63<br />

Spatial Query buttons 61<br />

Query.js 60<br />

Queryable Attribute 73<br />

R<br />

reconfigure <strong>Geomatica</strong> Focus with EASI 43<br />

redirectWindow 63<br />

remote Tomcat reset 43<br />

Replace the Description 71<br />

Replace the Metadata 71<br />

Replace the Title 71<br />

reset the MapService 43<br />

Reset.html 44<br />

Restart Tomcat 18<br />

S<br />

Saved queries 63<br />

scripting, EASI, query tools<br />

EASI servlet 43<br />

section 32<br />

Self-Configured Configuration 39<br />

Semi-Automatic Configuration<br />

See Assisted<br />

SendQuery 62<br />

Service_Abstract 42<br />

Service_AccessConstraint 43<br />

Service_Debug 42<br />

Service_Fees 42<br />

Service_KeyWord 42<br />

Service_Name 42<br />

Service_OnlineResource 42<br />

Service_Title 42<br />

servlet<br />

WCS 10<br />

WFS 9<br />

WMS 11<br />

Servlet Configuration File 39<br />

Export from <strong>Geomatica</strong> Focus 41<br />

Servlet DTD 39<br />

Set the Maplayer Attributes 73<br />

setTimeout 60<br />

show coordinates 64<br />

Solaris 8<br />

Spatial Reference System (SRS) 45, 46, 69<br />

SRC attribute 56<br />

SRS Attribute 69<br />

standard HTTP port 16<br />

Start <strong>Geomatica</strong> <strong>WebServer</strong> Monitor 50<br />

Stop Tomcat 18<br />

Style 46<br />

Supported-bbox Child Element 72<br />

Supported-styles Element 72<br />

Syntax<br />

GeoWSServlet Servlet 44<br />

MapViewer Applet 68<br />

Syntax of Servlet Configuration File 45<br />

System Requirements 7<br />

136 PCI Geomatics


T<br />

Templates 51, 52<br />

Title Element 45, 71<br />

Title Parameter 42<br />

toggleAllButton 57<br />

toggleInfoQuery 60<br />

Tomcat<br />

install on Windows 14<br />

low memory error 18<br />

remote reset 43<br />

restart 18<br />

stop 18<br />

testing the server 15<br />

Type Attribute 71<br />

U<br />

URL Address 70<br />

URL Attribute 70<br />

URLConnector 46<br />

V<br />

Validate XML File 45<br />

Version Attribute 71<br />

View 55<br />

viewer 64<br />

Viewport Element 69<br />

Visible Attribute 73<br />

Visible Layers 55<br />

vue 55<br />

W<br />

WCS 7<br />

configuring the servlet 31<br />

deployment file 35<br />

publishing your coverages 35<br />

testing the servlet 34<br />

troubleshooting 38<br />

WCS folder 16<br />

WCS images folder 16<br />

WCS META-INF folder 16<br />

WCS schemas folder 17<br />

WCS WEB-INF folder 17<br />

Web Archive (WAR) file 16<br />

web.xml<br />

WFS 21, 22<br />

WMS 43<br />

WFS 7<br />

configuring the servlet 21<br />

data source configuration file 27<br />

publishing your feature data 26<br />

testing the servlet 26<br />

troubleshooting 28<br />

wfs.application.schema.namespace. 26<br />

wfs.application.schema.namespace.url 26<br />

wfs.bad.file.action 24<br />

wfs.capabilities.service.abstract 25<br />

wfs.capabilities.service.name 25<br />

wfs.capabilities.service.online.resource 25<br />

wfs.capabilities.service.title 25<br />

wfs.data.sources.filename 23<br />

wfs.invalid.characters.action 24<br />

wfs.share.matching.layer.name.action 24<br />

wfs.transaction.allow 24<br />

wfs.transaction.timeout 25<br />

wfs_init.properties 21<br />

WFS conf folder 17<br />

WFS demo folder 17<br />

WFS folder 17<br />

WFS images folder 17<br />

WFS META-INF folder 17<br />

WFS WEB-INF folder 17<br />

WIDTH attribute 57<br />

WMS 7<br />

WMS Application folder 17<br />

WMS Config Folder 17<br />

WMS DTD Folder 17<br />

WMS folder 17<br />

WMS help folder 18<br />

<strong>Geomatica</strong> <strong>WebServer</strong> Suite <strong>Installation</strong> <strong>Guide</strong> 137


WMS images folder 18<br />

WMS JavaScript Folder 18<br />

WMS MapViewer.jar file 18<br />

WMS MapViewerTemplate.html file 18<br />

WMS META-INF folder 18<br />

WMS WEB-INF folder 18<br />

WMS XSLT folder 18<br />

WMSProvider Element 70<br />

WMT_XML 70<br />

X<br />

XML files<br />

Applet Configuration 52, 67<br />

Export from <strong>Geomatica</strong> Focus 41<br />

Servlet Configuration 41<br />

Z<br />

Zoom 57<br />

Zoom Factor 58<br />

Zoom Functions 57<br />

ZoomIn() 58<br />

ZoomInPercent() 58<br />

ZoomOut() 58<br />

ZoomOutPercent() 58<br />

ZoomPercentForm 58<br />

138 PCI Geomatics

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!