Introduction to Geomatica Course Guide Version 9.0 Copyright Notice This publication is a copyrighted work owned by: PCI Geomatics 50 West Wilmot Street Richmond Hill, Ontario Canada L4B 1M5 The information in this document is subject to change without notice and should not be construed as a commitment by PCI Geomatics. PCI Geomatics assumes no responsibility for any errors that may appear in this document. The software described in this document is furnished under a license and may only be used or copied in accordance with the terms of such license. No responsibility is assumed for the use or reliability of the information that is derived through the use of PCI Geomatics software. Copyright ? 1996 - 2003 by PCI Geomatics. All rights reserved worldwide. This publication is protected by Copyright law. Purchasers of PCI licenses are given limited permission to reproduce this manual, provided such copies are for their use with licensed PCI software only and are not sold or distributed to third parties. All such copies must contain the title page and this notice page in their entirety. Trademark Acknowledgments Geomatica, EASI/PACE, ImageWorks, GCPWorks, OrthoEngine, GeoGateway, RADARSOFT, FLY!, PCI Author, PCI Modeler, GeoAnalyst, and Agroma are registered trademarks of PCI Geomatics. InstallShield is a registered trademark of InstallShield Software Corporation. Microsoft is a registered trademark, and Windows is a trademark of Microsoft Corporation. MrSID TM is a registered trademark of LIZARDTECH Inc. Copyright 1995 - 1999 LizardTech, Inc. All rights reserved. UNIX is a registered trademark of UNIX System Laboratories, Inc. All other trademarks and registered trademarks are the property of their respective owners. Table of Contents Table of Contents Introduction: Learning PCI Geomatica .................................... 1 Module 1: Viewing Data in Focus ........................................... 13 Lesson 1.1 Adding and Managing Layers ................................. 14 Lesson 1.2 Using the Zoom and Pan Tools .............................. 25 Lesson 1.3 Using the Measuring Tool ....................................... 32 Lesson 1.4 Using Visualization Tools ........................................ 34 Module 2: Image Processing with Focus .............................. 39 Lesson 2.1 Enhancing Image Data ........................................... 40 Lesson 2.2 Editing a Look-Up Table ......................................... 52 Lesson 2.3 Working with Spatial Filters ..................................... 59 Lesson 2.4 Introduction to EASI Modeling ................................ 65 Module 3: Vector Processing with Focus ............................. 73 Lesson 3.1 Viewing Vector Data in Focus ................................. 74 Lesson 3.2 Collecting and Editing Vectors ................................ 79 Lesson 3.3 Managing Vector Attributes ..................................... 89 Lesson 3.4 Buffering Vectors .................................................... 93 Lesson 3.5 Dissolving Vectors .................................................. 97 Module 4: Image Classification with Focus ........................ 105 Lesson 4.1 Unsupervised Classification .................................. 108 Lesson 4.2 Post-Classification Analysis - Unsupervised ......... 113 Lesson 4.3 Initializing Supervised Classification ..................... 117 Lesson 4.4 Collecting Training Sites ....................................... 124 Lesson 4.5 Analyzing Training Sites ....................................... 133 ii PCI Geomatics Lesson 4.6 Running a Supervised Classification .................... 141 Lesson 4.7 Post-Classification Analysis - Supervised ............. 144 Module 5: Using Focus Algorithms ..................................... 151 Lesson 5.1 Creating Image Subsets ....................................... 152 Lesson 5.2 Generating a Pan-sharpened Image ..................... 159 Lesson 5.3 Generating a Perspective Scene .......................... 167 Module 6: Visual Scripting with PCI Modeler ...................... 173 Lesson 6.1 Introduction to Visual Scripting ............................. 174 Lesson 6.2 Filtering Images and Creating Polygons ............... 192 Lesson 6.3 Scripting Multiple Inputs and Data Merges ........... 207 Module 7: Map Publishing with Focus ............................... 217 Lesson 7.1 Introduction to a Map Project ................................ 218 Lesson 7.2 Building a Map Structure ....................................... 227 Lesson 7.3 Representing Map Elements ................................. 235 Lesson 7.4 Building a Map Surround ...................................... 245 Module 8: FLY! 3-D Visualization ......................................... 249 Lesson 8.1 Starting FLY! and Opening a Terrain .................... 250 Lesson 8.2 Controlling Your Flight .......................................... 255 Lesson 8.3 Creating Flight Paths and Movie Loops ................ 259 PCI Geomatics 1 Introduction Learning PCI Geomatica Welcome to Learning PCI Geomatica, the official guide for Introduction to Geomatica training. This guide is written for new and experienced users of geospatial software. In this course you will master the basics of several PCI Geomatica applications, including the new Geomatica Focus technology - an advanced graphical environment for image processing and analysis from PCI Geomatics. This edition has eight modules. Each module contains lessons that you work through in class with the help of your instructor. The lessons are built on basic tasks that you are likely to perform in your daily work. They provide instruction for using the software to carry out essential processes while sampling key Geomatica applications and features. Please note that training for OrthoEngine is not included in this guide. If you require more information about OrthoEngine training please ask your instructor. About this Training Guide This edition of Learning PCI Geomatica is for use in a classroom setting with a qualified PCI instructor. All PCI instructors are experts in geomatics and PCI software. Your instructor is available throughout the training course to answer any questions you may have. You can take the manual with you after the course has finished so feel free to make notes on the pages or on separate paper if you prefer. Each module in this book contains a series of hands-on exercises that let you work with the software and a set of sample data that you access from your workstation hard disk. Lessons have brief introductions followed by tasks and procedures in numbered steps. The scope of this guide is confined to the core PCI software applications included in the Geomatica suite. However, some remote sensing concepts are reviewed in the modules and lessons. If you require more background information, please ask your instructor for assistance. 2 PCI Geomatics Modules and Lessons When you are ready to proceed, your instructor will tell you where the sample data for each module is located. Please wait for your instructor to introduce the course material before working in the modules. Students who are unfamiliar with the file structure of geospatial data should carefully review the remaining sections in this introduction before moving on to the course work in the modules. The eight modules in this course give instruction for a range of activities from image processing to 3-D visualization. Six of the eight modules are based on Geomatica Focus and two provide instruction for other Geomatica applications. The modules in this book are: ? Module 1 - Viewing Data in Focus ? Module 2 - Image Processing with Focus ? Module 3 - Vector Processing with Focus ? Module 4 - Image Classification with Focus ? Module 5 - Using Focus Algorithms ? Module 6 - Visual Scripting with PCI Modeler ? Module 7 - Map Publishing with Focus ? Module 8 - FLY! 3-D Visualization All of the lessons in this book are used with sample data sets provided for you. After training you can review the exercises using the demo data that comes with Geomatica. The sample data files, used in this course, are included on the Geomatica software CD ROM. You will find the sample data in the demo file folder, under the Geomatica directory on your system hard disk. When you install the software you can add the demo folder during the installation process. Caution For your classroom training, your instructor will tell you where the sample data is located. Please wait for your instructor to tell you how to access the sample data and which of the sample data you will be using. Learning PCI Geomatica - Introduction PCI Geomatics 3 Geospatial Data Structures Data for the geospatial sciences are stored in complex computer files that are often incompatible with specific software packages and computer platforms. If you have worked with more than one type of geospatial data, you are likely aware of the problems that can arise when mixing data from more than one file type. Files can come in hundreds of different formats and often require considerable preparation or preprocessing before they can be combined in a work project. Most geospatial formats store image data in one file and supplementary data, such as bitmaps and vector polygons, in another file using different file names for each data type. Metadata, such as signatures and statistical tables, are stored as yet another file type. As information is added to a data set it becomes more complex requiring more files to store the new data. Very complex data sets can be difficult to manage because they use different file name extensions for each data type. Sometimes this creates confusion and opportunities for error as you try to maintain the correct file associations in your work. PCI Geomatics has developed two unique technologies that make data management easier: GeoGateway and the PCIDSK file format. The following sections explain how GeoGateway technology and the PCIDSK format work in Geomatica to make your data management easier. GeoGateway Technology in Geomatica GeoGateway, also known as Generic Database (GDB) technology, is key to the Geomatica applications. GeoGateway makes it possible to view and integrate geospatial data from more image formats than any other geomatics software. It allows you to use as much data as you require in your work and to combine images of any data type, resolution, and size. You can use image files, with their accompanying metadata, in the same georeferenced viewer even after combining various file formats and data types. The inherent limitations of some file formats can be overcome by GeoGateway through the Geomatica software applications. For more user- friendly formats, Geomatica offers a versatile array of tools to make the most of your data. For example, large data formats, such as HDF-EOS, can be reprojected into more than 25 supported projection systems. 4 PCI Geomatics The list of file formats that GeoGateway uses is constantly under development. As new formats appear, GeoGateway is updated by the PCI software development team. Currently there are more than eighty usable geospatial file types. Many popular formats such as ARC/INFO, ArcView, AutoCAD, and MicroStation are fully supported. New and emerging standards such as GeoTIFF are also supported in Geomatica. GeoGateway operates behind the scenes in the Geomatica applications. The illustration below shows a file selection window for Geomatica Focus. When you click the Files of type box, in the lower-middle of the window, you can see the list of file formats that can be opened directly into a Geomatica application. Figure 1 GeoGateway in Geomatica With GeoGateway technology you can work through a mapping project by assembling raster and vector data from different sources and different file formats without having to preprocess or reformat the data. GeoGateway acts as a digital interpreter for the Geomatica applications. File formats are read by GeoGateway when you open them in an application. The data is then automatically configured for use in your Geomatica project. Together, GeoGateway and Geomatica read, view, and process distribution formats, and read, edit, and write exchange formats. Learning PCI Geomatica - Introduction PCI Geomatics 5 You can integrate and simultaneously process both raster and vector data without the difficulties common to more complex data sets that use different geospatial formats. PCIDSK and Geomatica In the 1980s, the Canada Centre for Remote Sensing (CCRS) designed a file format, called UNIDSK. This file format is somewhat like a conventional database file. The UNIDSK format arranges multiple data types in a single, compound file that uses one file name extension. PCI has developed and refined the UNIDSK database format and has called it PCIDSK. Like the UNIDSK format, PCIDSK files resemble data bases but with some very important differences. Conventional database files are composed of records, each containing fields together with a set of metadata for searching, sorting, recombining, and other functions. PCIDSK files contain all of the features of a conventional database and more. They store a variety of data types in a compound file that uses a single filename extension. The image data are stored as channels and auxiliary data are stored as segments. All data types are stored together in the file using .pix as the file name extension. The data type and format of the component determines whether searching, sorting and recombining operations can be performed with the software application tools. 6 PCI Geomatics The PCIDSK File Format In PCIDSK files, images and associated data, called segments, are stored in a single file. This makes it easier to keep track of imagery and auxiliary information. Figure 2 Conventional files and PCIDSK files PCIDSK Files Conventional Files Using a single file for each set of data simplifies basic computing operations. Since all data is part of the same file you can add or remove parts of it without having to locate, open, and rename more files. PCIDSK files are identical in all operating environments and can be used on networked systems without the need to reformat the data. Image Files Training site files Histogram files Image channels Training site segments Histogram segments Saved Separately using differentSaved as a single DSK file using the file name file name extensionsextension .pix Learning PCI Geomatica - Introduction PCI Geomatics 7 Working with Geomatica Focus Geomatica Focus is the newest development in PCI software. It is designed to work with dozens of data formats, through GeoGateway, and to take advantage of the PCIDSK file format. When you start Geomatica on your system desktop, the Geomatica Toolbar opens and the Focus application starts automatically. The Geomatica toolbar holds the commands that start each of the Geomatica applications. Figure 3 The Geomatica Toolbar When you pass your mouse over a command on the toolbar the name of the application appears as a ToolTip beside your mouse pointer. The illustration below shows the basic parts of the Focus interface. Figure 4 The Focus Interface B A E A. Menu bar B. Toolbar C. Maps and Files tree tabs D. Work area E. View area F. Status bar F C D 8 PCI Geomatics Managing Data in Focus In Figure 5 you can see what Focus looks like with an open PCIDSK file. On the right, in the Focus view area, you can see the file imagery. On the left you can see both image and auxiliary data as channels and segments in the Maps and Files trees. The color channels are separated into red, green, and blue layers and show the electromagnetic spectrum (EMS) frequency range for the source image. The Maps Tree When you work with Focus, the Maps tree lists the channels that make up the image in the view area along with the auxiliary data you are using in your work. It contains the things that can be shown in the Focus view area, including the channels that make up the image and any results from algorithms that are stored in system memory. Items appearing in the Maps tree are not necessarily data saved on a hard disk and they do not effect the original data files. Figure 5 An open PCIDSK file. The Focus Maps tree lists the color channels fro the Image. Learning PCI Geomatica - Introduction PCI Geomatics 9 Note Channels, segments, and layers, appearing in the Focus Maps tree, are stored in your system memory. The Files Tree Both the Maps and the Files tree provide a way to browse and manage and manage your data. Figure 6 shows the entire contents of a PIX file, grouped by data type, in the Focus Files tree. Figure 6 The Focus Files tree lists the auxiliary data You can show or hide the vector and bitmap segments, listed in the Files tree, in the Focus view area. Like the PCIDSK format, Geomatica Focus keeps image channels and auxiliary data segments in the same place. 10 PCI Geomatics Note The data listed in the Files tree is stored in the source file on your system hard disk. Some of the data types, listed in the Files tree, are not viewable as image components. The same list can contain other auxiliary data types such as lookup tables (LUT), pseudo-color tables (PCT), and signatures. You use the Focus software tools and dialog boxes to work with these data types. Working with Geomatica Project Files Geomatica Project Files provide a way for you to organize data for complex projects in one large file. Your GPR files not only store Maps, Areas, and Layers but also include all path information to your data, your viewing preferences, such as the last zoom level you worked at, and all associated map elements. The GPR file is also capable of including multiple Maps, Areas, and all associated Layers. Geomatica Project Files are saved as ASCII text files with a .gpr extension. Learning PCI Geomatica - Introduction PCI Geomatics 11 Understanding Maps, Areas, Layers, and Segments The files, listed in the Maps tree, are a hierarchy of elements that make up a Geomatica project. Maps tree elements have common properties that you can control from the Maps and Files trees, the menu bar, and context- sensitive shortcuts. Maps The element at the top of the hierarchy is the Map. This is the workspace that holds all of the data for your work. You can have more than one map in a project. The Map is also a page that contains the extents of your project canvas. You can adjust the map size to control the size of your printed output. When Focus is in map view mode, you can adjust the size and position of the image relative to the canvas. You can also add surround elements to your map. Areas The area element holds the file boundaries for either image or vector layers. Areas can include multiple layers and segments for a geographical region and you can have as many areas in a project as you wish. Each Area has a unique georeference system. When new image files are added to an area they are referenced automatically. Layers Layers hold the data that is displayed in the view area. Made up of segments, layers can be rearranged in the Maps tree to vary the image in the view area. You change the order of layers by dragging them up or down the Maps tree. When you move a layer, you move the segments that belong to it as well. Segments Segments are all of the components that make up a layer. For example, channels, vectors, bitmaps, and Lookup tables (LUT) can all be considered as segments when they appear as part of a layer. 12 PCI Geomatics Starting Your Work In the lessons that follow, you will have an opportunity to work with several Geomatica applications and to carry out several tasks using Focus. Your overall goal is to become familiar with the software and to see how you can use Geomatica in your own work. There are no right or wrong questions and answers in this edition. You can work at your own pace and you can access your instructor at any time if you run into difficulties. Please leave time for classroom discussions and group instruction as required by your PCI instructor. Thank you for attending Introduction to PCI Geomatica. PCI Geomatics 13 Module 1 Viewing Data in Focus Module 1 has Five Lessons: Lesson 1.1 Adding and Managing Layers Lesson 1.2 Using Zoom Tools Lesson 1.3 Using Measure Tools Lesson 1.4 Using Visualization Tools Viewing Data Geomatica Focus is one of the most interactive software programs on the market today for working with spatial data. A major strength of Focus is its ability to easily view and navigate your databases. When you work with Focus, the Maps tree lists the areas, layers, and segments that make up the image in the view area. Layers and segments appearing in the Focus Maps tree are stored in your system memory. You can show or hide the items in the Maps tree by clicking the check box to the left of the item you want. You can also change the priority of a layer by dragging it up or down the Maps tree. The goal is to make data viewing as efficient as possible. Module 1 will discuss many of the features in Focus for viewing your data including adding and managing layers, using zoom tools, measure tools and visualization tools. At the end of this module, you will be able to successfully navigate the Focus interface with your data. Lesson 1.1 Adding and Managing Layers 14 PCI Geomatics Lesson 1.1 Adding and Managing Layers In this lesson you will: ? Open a File ? Use Map View Mode and Area View Mode ? Add Layers using the Add Layer Wizard ? View the Layer Manager ? View Layer Properties ? View File Properties To begin this lesson, make sure the Geomatica toolbar is open and Focus is running on your desktop. Open Geomatica from the Windows Start menu. To open Focus, click the Focus icon on the Geomatica toolbar. Figure 1.1 Focus icon on the Geomatica toolbar To open an image file in Focus: 1. In the Focus File menu, click Open. A File Selection window opens. 2. In the Geomatica program files, locate and open the demo folder. 3. In the demo folder click irvine.pix. 4. Click Open. If you are having difficulty finding the demo folder, ask your instructor for help. A Landsat true-color image of Irvine, California opens in the Focus viewer. Learning PCI Geomatica - Module 1: Viewing Data in Focus PCI Geomatics 15 Figure 1.2 The irvine.pix image Map View Mode versus Area View Mode There are two modes in which you can work in Focus. Map View Mode and Area View Mode. Map View Mode allows you to see the Map or blank sheet of paper upon which your project is placed. You may also set the dimensions of the page, and organize elements of your project in Map View Mode. Area View Mode hides the Map (blank sheet of paper) and allows the user to work within one Area. In a typical Focus project, you would first use Map View Mode to specify the size of your Map. Area View Mode would then be used for all processing of data. At the end of your project when map output is required, you would return to Map View Mode to organize the elements of your map project for presentation purposes. To view in Map View Mode: 1. In the Focus toolbar, click on Map View. The map upon which irvine.pix is placed becomes visible. Lesson 1.1 Adding and Managing Layers 16 PCI Geomatics Figure 1.3 Area View Mode on the Toolbar 2. In the Maps tree, right-click on the Map level. 3. From the pull down list, select Properties. The Map Properties dialog box opens. 4. From the Map Properites dialog box, select the Page Setup tab. 5. Change the orientation of the page to Landscape. 6. Click OK. The page orientation becomes landscape in the Focus viewer. Now that the Map orientation has been determined, we can change back to Area View mode for further processing. To toggle back to Area View Mode: ? From the View pull-down menu at the top of the Focus window, select Area View Mode. The Map (white sheet) disappears and you may continue working with the irvine.pix file. Learning PCI Geomatica - Module 1: Viewing Data in Focus PCI Geomatics 17 Using the Add Layer Wizard The Add Layer Wizard lets you quickly add several types of existing data layers to your project. The Add Layer Wizard makes it easier to locate the exact layers you want to display without having to search for them. To add a layer with the Add Layer Wizard: 1. In the Maps tree, right-click the Area level. 2. In the shortcut menu, select Add. The Add Layer Wizard Opens. Tip Alternatively, select Add from the Layer pull-down menu in Focus or select the Add Layer Wizard from the Focus toolbar. Figure 1.4 The Add Layer Wizard Note To create a new (empty) raster, vector or bitmap layer, select New Raster Layer, New Vector Layer, or New Bitmap Layer by right- clicking on the Area level in the Maps Tree. Lesson 1.1 Adding and Managing Layers 18 PCI Geomatics 3. For the type of layer you want to add, select Grayscale. 4. Click Next. The Add Layer Wizard shows the available channels for the current image. 5. In the Add Layer Wizard, click Browse. The Select GeoGateway File window opens. 6. From the demo folder, locate and open eltoro.pix. 7. Click Open. The eltoro.pix file is added to the list of available files in the Add Layer Wizard and the layers and segments for the new file are shown in the available channels list. 8. In the available channels list, select the SPOT panchromatic channel. 9. In the add Layer Wizard, click Finish. The panchromatic layer opens on top of the irvine.pix layer in the Focus view area and is listed in the Maps tree. The components of the eltoro.pix file appear in the Files trees. Note The Maps tree lists all the data open in the view area. The image listed at the top of the Maps tree is the top image layer in the viewer. Adding Layers from the Files Tree When a file is loaded into Focus, a default layer is displayed in the viewer and listed in the Maps tree. All other layers contained in the same file are listed in the Files tree. It is possible to load any of these layers (stored on disk) into the viewer and the Maps tree. To add a layer from the Files tree: 1. In the Focus viewer, click on the Files tab. A list of available files and layers will be displayed for eltoro.pix and irvine.pix. 2. Expand the list of vectors for irvine.pix by clicking on the + symbol on the left. The available vector layers are listed. 3. Right-click on the transportation layer. Learning PCI Geomatica - Module 1: Viewing Data in Focus PCI Geomatics 19 4. From the shortcut menu, select View. The transportation vector layer will now appear in the Maps tree as well as in the viewer. Figure 1.5 Adding a Layer to the Maps Tree from the Files Tree. Using the Layer Manager The Layer Manager manages all layer properties in a convenient table format. The table shows the current properties of each object in the map, and the hierarchical structure including maps, areas, and layers. This tool is very useful for managing a large combination of data layers, both raster and vector, such as when making a map. Using the Layer Manager you are able to control what layers lay on top of one another to ensure that nothing gets covered up. To open the Layer Manager: ? From the Layer pull-down menu on the Focus menu bar, select Layer Manager. The Layer Manager window opens. Lesson 1.1 Adding and Managing Layers 20 PCI Geomatics Figure 1.6 The Layer Manager Note Each parameter set using the Layer Manager is also accessible by right clicking on the layer under the Maps Tab and selecting Properties. Changing Layer Properties with the Layer Manager In the Layer Manager table, object names are listed in the table rows. Object properties are listed in the table columns. Like the Focus Maps and Files trees, icons are shown beside each object in the Name column. Properties in the Layer Manager show the state of your layers in your current project. They can be changed according to the available edits for the specific layers you are using. To change Layer Visibility in the Layer Manager: 1. In the Layer Visible Column, deselect the transportation and eltoro layers. The check marks for transportation and the eltoro image are removed. 2. Click OK. The Layer Manager closes and the Eltoro image and the transportation vector layer are no longer displayed in the viewer. Note Changes in the Layer Manager are shown in the Maps tree automatically when you click OK or Apply. A layer must be open, and its map must be active to make changes. The check box indicates active layers and maps. Learning PCI Geomatica - Module 1: Viewing Data in Focus PCI Geomatics 21 Layer Properties In the shortcut menus, Focus provides Properties panels for all layer types. The Properties panels have layer-specific settings so you can adjust the properties for any layer when you need to. Layer Properties panels have tabs along the top of the panel that begin with General properties, such as the layer name, and priority. The remaining tabs differ depending on the layer type you have chosen. When you click a properties panel tab, you open attribute controls that are specific to your layer. To view Layer Properties: 1. In the Maps tree, right-click on the Irvine image layer. A shortcut menu appears. 2. From the shortcut menu, select Properties. Figure 1.7 Layer Properties selected from the Maps Tree The Layer Properties window opens. Lesson 1.1 Adding and Managing Layers 22 PCI Geomatics Figure 1.8 Layer Properties The Layer Properties window displays some of the important details of that particular layer. The General tab indicates the name of the layer, its priority, the resample method, and current enhancement for that layer. The Source Images tab lists which layers are displayed as RGB, and which file the layers are from. The Source LUTs tab displays available look up tables for each band. In the Display tab, you can alter transparency for each band and opacity for the layer. Finally, the Display within Zoom Scale tab allows you to specify a zoom scale for the layer. In this example, you will change the transparency of the Irvine image layer. To set layer transparency: 1. In the Layer Properties window, click on the Display tab. 2. Select the Transparency option by clicking in the white box on the left. The Transparency section becomes active. 3. In each of the Red, Green and Blue Values(s) text boxes, specify the values 20:255. 4. Click OK. The Layer Properties box closes and changes take effect in the Focus viewer. The low pixel values 0-19 from each band remain apparent in the viewer while all other values (20-255) become transparent. This is useful for removing particular pixel value ranges in order to more easily visualize your data. 5. To return to normal display, deselect the transparency option. Learning PCI Geomatica - Module 1: Viewing Data in Focus PCI Geomatics 23 File Properties The File Properties panel lets you view characteristics about a file in the Files tree. The File Properties panel has tabs for showing general file information, as well as history, metadata and projection information. To view File Properties: 1. In the Focus viewer, select the Files tab. 2. Right-click on irvine.pix. A shortcut menu appears. Figure 1.9 File Properties 3. From the shortcut menu, select Properties. The File Properties dialogue box opens. Within the File Properties box you will find important information such as file size, creation date, raster size, pathname, history, metadata, and projection information. Lesson 1.1 Adding and Managing Layers 24 PCI Geomatics Figure 1.10 File Properties of Irvine.pix In this lesson you: ? Opened a File ? Used Maps View Mode and Area View Mode ? Added Layers using the Add Layer Wizard ? Viewed the Layer Manager ? Viewed Layer Properties ? Viewed File Properties Learning PCI Geomatica - Module 1: Viewing Data in Focus PCI Geomatics 25 Lesson 1.2 Using the Zoom and Pan Tools In this lesson you will: ? Use the Overview and Zoom Windows ? Pan Around an Image ? Use the Zoom Tools ? Create Named Regions When working with images in Focus, it is important to be able to navigate around the image effectively. The zoom and overview windows, panning, zooming, and creating named regions allow you to navigate quickly and effectively. Using the Overview Window When you open an image data in Focus, the Overview Window shows a smaller version of the image in the Focus view area. The Overview window has a bounding outline that you can use to control the view in the view area. You can resize the bounding outline and zoom the view area image. By default the Overview Window is turned off when you open Focus, so we will first turn it on. To display the Overview Window: 1. From the Tools pull-down menu in Focus, select Options. The Options dialog box opens. 2. From the list on the left, select General interface. The General interface options appear on the right of the window. 3. In the show section, select the Overview Window box. A check mark appears in the Overview Window box. 4. In the bottom left corner of the Options window, click OK. The Options window closes and an Overview window appears in the bottom left corner of the Focus viewer. A red bounding box outlines the area you are zoomed to. Lesson 1.2 Using the Zoom and Pan Tools 26 PCI Geomatics Figure 1.11 Turning on the Overview WIndow To zoom using the Overview window: 1. Inside the Overview window, move your mouse pointer over a corner of the red bounding box. 2. When your mouse pointer changes to a double headed arrow, you can drag the bounding box in or out from the corner. The bounding outline resizes and the irvine.pix image in the view area zooms in or out relative to the area defined by the bounding outline. When the bounding outline is smaller than the image in the Overview window, you can click inside it and pan through the image in the Focus view area. Dragging the bounding outline in the Overview window moves the image in the Focus View area without changing the zoom level. Using the Zoom Window The zoom window lets you see a linked copy of your image data in a separate viewer. You can zoom the images independently, using one image to locate features and the other to zoom them for a closer look. To open and use the Zoom Window: 1. From the View pull-down menu on the Focus menu bar, select Zoom Window. The Zoom window opens. Learning PCI Geomatica - Module 1: Viewing Data in Focus PCI Geomatics 27 Figure 1.12 Zoom Window 2. In the upper-left corner, click on the Lock Window Position button. Now when you click in the Focus viewer, the image in the Zoom window does not change. 3. To unlock the Zoom window, click the Lock Window Position button again. Zoom Tools There are several ways to zoom an image in the Focus viewer. You can zoom in or out to a particular location even when you have multiple images opened. The following tools are located on the Focus Zoom Toolbar. Figure 1.13 The Zoom Toolbar Lesson 1.2 Using the Zoom and Pan Tools 28 PCI Geomatics Pan Tool When you have a very large image file open in Focus or when you have your image zoomed closer than overview you can pan around the image in the Focus view area. There are two ways to pan around images. To pan an image: 1. On the Focus toolbar, click the Pan button. 2. Click anywhere on the image in the Focus view area. Your mouse pointer changes to a hand pointer. 3. To pan through your image, click and drag the image in the direction you want. Or: 1. In the Overview window, click inside the preview bounding box. 2. Drag the bounding box toward your region of interest. The image in the Focus viewer pans to match the location of the bounding box in the Overview window. Note You can also scroll an image in Focus using the standard scroll bars along the horizontal and vertical edges of the Focus view area. Zoom Interactive To use the Zoom Interactive Tool: 1. On the Focus toolbar, click the Zoom Interactive button. 2. Use your mouse to define an area to zoom into. The image in the Focus viewer zooms to the area you defined. Zoom In/Zoom Out Tools To zoom an image with the Zoom In/Zoom Out tools: 1. In the Focus view area, click in the image. 2. On the Focus toolbar, click the Zoom In button. The image is enlarged by a factor of 2. 3. To zoom out, click the Zoom Out button. Learning PCI Geomatica - Module 1: Viewing Data in Focus PCI Geomatics 29 1:1 Image Resolution To view 1:1 image resolution: 1. In the Focus viewer, click on the airport. 2. On the Zoom toolbar, click the Zoom to 1:1 Image Resolution button. The image changes to display at 1:1 resolution. Creating Named Regions You can create a custom view of your map or image with the Named Regions tool. Upper left and lower right corner coordinates are used to define new named regions. Adding a new Named Region First, define the boundaries of your new region using the zoom tools on the Focus toolbar. To add a Named Region: 1. Using the zoom tools on the Focus toolbar, zoom to the airport. The image zooms to show the selected region. 2. From the View menu, select Named Regions. You can also click the Named Regions command on the Zoom Toolbar. The Named Regions dialog box opens. Figure 1.14 Named Regions dialog box 3. In the lower-left of the Named Regions dialog box, click the + Add button. A new Named Region is added to the Named Regions Maps tree. The new Named Region is automatically shown as Named Region 1. Lesson 1.2 Using the Zoom and Pan Tools 30 PCI Geomatics 4. Type a name for your region, in this case airport. Figure 1.15 Named Regions dialog box with Airport region defined 5. On your keyboard, press Enter or Return. 6. Repeat steps 1 through 4 to create another named region for a different location, such as the lake. Tip Click on the Advanced button to define your Named Region using exact coordinate information. Edit your coordinates by typing them directly into the Advanced Named Regions dialog box. To display a Named Region in the Focus view area: 1. On the Zoom toolbar, click the Zoom to Overview button. If you closed the Named Regions dialog box, reopen it by clicking the Named Regions command from the Focus toolbar so you can select the named region you want to display. 2. In the Named Regions dialog box, click the Airport region. 3. Click Apply. The airport region is displayed in the viewer. 4. To close the Named Regions dialog box, click OK. Tip When you have created a named region, you can right-click in the Focus view area and select Named Region from the Zoom To submenu. Learning PCI Geomatica - Module 1: Viewing Data in Focus PCI Geomatics 31 To remove a Named Region: 1. Make sure the Named Region you want to remove is highlighted in the Named Regions Map Tree. 2. In the lower left of the Named Regions dialog box, click the Remove. The named region is removed from the Maps tree. Note To save your Named Regions, you must save your current project. In this lesson you: ? Used the Overview and Zoom Windows ? Panned Around an Image ? Used the Zoom Tools ? Created Named Regions Lesson 1.3 Using the Measuring Tool 32 PCI Geomatics Lesson 1.3 Using the Measuring Tool In this lesson you will: ? Measure the Distance between Features ? Use the Coordinate Display Measuring Distances and Area You can measure features in the Focus viewer using the Measure tool. Select either the Line, Polygon, Rectangle or Ellipse tool to compute measurements of distance and area. To use the Measure tool: 1. On the Tools toolbar in the Focus viewer, click the arrow to the right of the Measure tool. 2. In the drop-down list, select Polygon. The Polygon measurement tool is now active. Figure 1.16 Accessing the Measure Tool in Focus 3. Using the zoom tools on the Focus toolbar, zoom to the airport. The image zooms to show the selected region. 4. Roughly outline the airport using the Polygon measurement tool. Measurements for the area are displayed in the bottom left corner of the Focus viewer. Learning PCI Geomatica - Module 1: Viewing Data in Focus PCI Geomatics 33 Figure 1.17 Measuring Airport Area using the Polygon Measurement tool. Experiment with the other measurement tools available in Focus. Ask your instructor if you need assistance. Note You are able to specify the units of measure by selecting the arrow beside the measurement tool and selecting the appropriate units from the Linear Units, Area Units, or Angle Units menus. In this lesson you: ? Measured the Distance between Features ? Used the Coordinate Display Lesson 1.4 Using Visualization Tools 34 PCI Geomatics Lesson 1.4 Using Visualization Tools In this lesson you will: ? Open a Landsat multispectral image and a SPOT HRV1 subset image in Focus ? Use the Focus Visualization Tools to examine the two images Focus Visualization Tools Focus provides a set of active visualization tools that can automate the way you visualize your data. The visualization tools are ideal for work requiring change detection between images acquired at different times. You can also use the visualization tools to ensure accuracy in your map projects when you use imagery as a background layer to update vector or bitmap data. The visualization tools let you view and compare multiple image layers simultaneously in a variety of ways. You can automatically browse a set of image layers or blend different images to see specific parts of one image through another. The visualization tools are versatile and can be used with any of the Focus enhancements or filters to make your work easier and more precise. In this lesson, you will open two images in the Focus view area and experiment with the visualization tools. While you work through this lesson, try to consider ways that the visualization tools will help you in your daily work. To begin, you will need to close any open projects or imagery in Focus. To close a previous project: 1. On the Focus toolbar, click the New Project command. The Save Project panel opens. 2. On the Save Project panel, click No. 3. Focus closes momentarily then re-opens with no open files or imagery. You are now ready to begin the lesson. Learning PCI Geomatica - Module 1: Viewing Data in Focus PCI Geomatics 35 Next, you will open the irvine.pix and the eltoro.pix files in the demo folder on your workstation hard disk. The eltoro.pix imagery covers a smaller area than the irvine.pix imagery, so you will want the Eltoro imagery to appear on top of the Irvine imagery. To open your first file: 1. On the Focus toolbar, click the Open command. 2. In the File Selection window, open irvine.pix from the demo folder. The irvine.pix file opens in the Maps and Files trees and the imagery opens in the Focus view area. To open the second file: 1. Repeat steps 1 and 2 above. This time, in the File Selection window, open the eltoro.pix file. The eltoro.pix image file opens in the Maps and Files trees and the eltoro imagery opens in the view area. 2. On the Focus toolbar, click the Zoom To Overview command. Figure 1.18 eltoro.pix and irvine.pix open in Focus The two images are now visible in the Focus view area. Lesson 1.4 Using Visualization Tools 36 PCI Geomatics Now that you can see both images in the Focus view area, you can open the visualization tools panel. To open the Visualization Tools panel: ?From the View pull-down menu in Focus, click Visualization Tools. The Visualization Tools panel opens. Figure 1.19 Visualization Tools panel Four visualization tools are available when you work with more than one image. When your work includes more than two image files, a fifth tool, the Loop tool, is available for visualization. Flicker Tool The Flicker tool switches your view between the two images making it easier to see subtle differences between them. You can use the Flicker tool manually or you can set it up to work automatically at the speed you want. Take some time now to experiment with the Flicker tool. You can change the frame rate of the flicker by clicking in the Speed box and typing a new frame rate. When you have finished experimenting with the Flicker tool, click the Swipe tab. Learning PCI Geomatica - Module 1: Viewing Data in Focus PCI Geomatics 37 Swipe Tool The Swipe tool swipes one image across another, one segment at a time, so that at any point during the process, you are looking at a specific proportion of the images. You can adjust the size of the swipe segment, change the swipe from horizontal to vertical, and set the frame rate for the swipe movement across the screen. When you have finished experimenting with the Swipe tool, click the Blend tab. Blend Tool The Blend tool slowly merges two image layers together. The slow transition from one view to another helps you see changes between image layers. You can manually adjust the position of the blend to increase and decrease the blend percentage, or use the auto mode features to change the frame rate and the step size. When you have finished experimenting with the Swipe tool, click the Cycle tab. Band Cycling Band cycling is a quick way to cycle through different channel or wavelength ranges in a specified color component and to create new color composites. You can control the speed and range of channels that you are cycling through using this tool. To use the Band Cycling tool: 1. In the visualization tools Cycle panel, click one of the color channel options. The colour that you choose will be the one that the input image channels will cycle through for display. 2. To start Automatic Cycling, click the play button. The cycling continues to the end of the specified display range and then begins again. 3. To stop cycling, click Stop. The number at the bottom of the Visualization Tools panel is the channel being displayed. When you click on another tab or close the panel, the RGB layer reverts back to the original RGB combination. When you click Apply and Close, the RGB layer is updated to reflect the new display combination and the layer name is updated. Lesson 1.4 Using Visualization Tools 38 PCI Geomatics Loop Tool The fifth visualization tool is the Loop tool. To make this tab available, you must have more than two layers open in the Focus work area. When you have finished experimenting with the Cycle tool, close the panel. To open the third file: 1. On the Focus toolbar, click the Open command. 2. In the File Selection window, open radarsat.pix from the demo folder. The radarsat.pix file opens in the Maps and Files trees and the imagery opens in the Focus view area. Now that you have three images in the Focus view area, you can reopen the visualization tools panel and select the Loop tab, which is now available. Take some time now to work with the Visualization tools to see the adjustments and effects you can achieve on your own. Note the differences between the three images. The eltoro.pix file reveals a significant buildup of urban development around the airport. The imagery in the irvine.pix data shows relatively little development at the time this image was acquired. The radarsat.pix file shows very different information compared to the other optical files. In this lesson you: ? Opened a Landsat multispectral image, a SPOT HRV1 image, and a Radarsat image in the same Focus view area ? Used the Focus Visualization Tools to examine the different images PCI Geomatics 39 Module 2 Image Processing with Focus Module 2 has Four Lessons: Lesson 2.1 Enhancing Image Data Lesson 2.2 Editing a Look-up Table Lesson 2.3 Working with Spatial Filters Lesson 2.4 Introduction to EASI Modeling Image Data Geomatica Focus provides many tools for processing raster image data. Enhancements are used to display images so that objects or features in your imagery are easier to interpret. In Focus, images can be displayed with standard enhancements or with customized enhancements created by editing look-up tables. This will be outlined in the first two lessons. In this module you will also become familiar with applying spatial filters, both low-pass and high-pass, to enhance areas of low or high spatial frequency. Finally you will be introduced to EASI Modeling. Lesson 2.1 Enhancing Image Data 40 PCI Geomatics Lesson 2.1 Enhancing Image Data In this lesson you will: ? Open an image file and choose a default enhancement ? Use the toolbar enhancement commands ? Adjust toolbar enhancements ? Change the image contrast and brightness ? Enhance images from the shortcut menu Image Enhancement and RADARSAT Data Unenhanced images are often impossible to understand visually when you open them in an image viewer. In Focus, image files are enhanced automatically using a default enhancement. You can choose the type of enhancement that Focus applies to images when they are opened. In this lesson, you will compare the standard set of enhancements available in Focus. To begin, you will open an image and remove the default enhancement so that you can view the original unenhanced radar image. Then, you will select the default enhancement that best suits your needs. Digital numbers in images from the same sensor can vary because of land cover or environmental changes in the scene. Enhancements are based on statistics from each image. Therefore, the effects of an enhancement can vary in different images taken from the same sensor. The RADARSAT image used in this lesson is stored in a 16-bit unsigned channel that supports a dynamic range from 0 to 65,535 digital numbers. The usable image values in the radarsat.pix file are 0 to 30,000 digital numbers. The image appears dark, with no enhancement, because it uses less than half of the available range. Learning PCI Geomatica - Module 2: Image Processing with Focus PCI Geomatics 41 To begin this lesson, make sure the Geomatica toolbar is open and Focus is running on your desktop. Figure 2.1 Focus icon on the Geomatica toolbar To open an image in Focus: 1. In the Focus File menu, click Open. A File Selection window opens. 2. In the Geomatica program files, locate and open the demo folder. 3. In the demo folder click radarsat.pix. 4. Click Open. A black and white Synthetic Aperture Radar (SAR) image of Irvine, California opens in the Focus view area. An Adaptive enhancement is applied by default. Figure 2.2 The radarsat.pix image with default enhancement The contents of the radarsat.pix file appears in the Maps tree as a Standard 2 Beam Mode image channel. Tip To expand the Maps tree, click the + to the left of any item in the list. Lesson 2.1 Enhancing Image Data 42 PCI Geomatics Figure 2.3 The Maps tree showing the radarsat.pix contents Next, you will remove the default enhancement using the Raster toolbar commands. To remove the default enhancement: 1. In the Focus toolbar, click the arrow to the right of the Enhancements command. A drop-down list opens. Figure 2.4 The Focus Enhancements command list 2. In the drop-down list, click None. The enhancement is removed and the view area shows the image with no enhancement. Learning PCI Geomatica - Module 2: Image Processing with Focus PCI Geomatics 43 Choosing a Default Enhancement You can change the default enhancement to any of the six basic enhancements listed in the Enhancements drop-down list. Your new enhancement will then be applied to any image file you open in Focus. To change a default enhancement: 1. In the Focus menu bar, click the Tools menu. 2. From the drop-down list click Options. The Options dialog box opens. Figure 2.5 Focus Options dialog box 3. In the list on the left, select Layers. 4. In the Layers option panel, click the Default Visual Enhancement arrow. 5. In the Default Enhancement list, click the Root enhancement. 6. To change the default enhancement from Adaptive to Root, click Apply. 7. Click OK. Now when you open any image file in Focus the Root enhancement is applied by default. Lesson 2.1 Enhancing Image Data 44 PCI Geomatics Enhancing Images with Focus There are three methods for enhancing images with Focus. You can use the Toolbar, Maps tree, and Look-up Table Editor methods for enhancing imagery. Now that you have changed the default enhancement you can try out the standard enhancements available in Focus. You will use the Maps tree and the LUT methods later. For now, try the quick method for applying an enhancement, with the commands on the Raster toolbar. There are several commands on the Raster toolbar for enhancing and adjusting the appearance of your images quickly. Figure 2.6 The Raster toolbar The Raster toolbar includes contrast and brightness controls along with a list of standard enhancements. Figure 2.7 The Enhancements command list The standard Focus Raster enhancements are Linear, Root, Adaptive, Equalization, and Infrequency. Learning PCI Geomatica - Module 2: Image Processing with Focus PCI Geomatics 45 Using the Linear Stretch Enhancement The linear stretch enhancement improves the overall contrast of an image by stretching the minimum and maximum values in the image over the entire available dynamic range. If necessary, remove any enhancement from the radarsat.pix image and apply the linear enhancement so you can see the effect. To apply the linear enhancement: 1. On the Raster toolbar, click the arrow to the right of the Enhancements command. The drop-down list opens. 2. In the drop-down list, click Linear. The image changes, showing more contrast and detail. With the linear enhancement applied, you can see more detail in the image. In the lower left, you can see a coastline and in the upper right, a mountain range. Note To see the entire RADARSAT image in the viewer, click the Zoom to Overview command in the Focus toolbar. Next, apply the root enhancement from the Raster toolbar so you can see even more detail in the image. The radarsat.pix image appears to gain more detail and the Raster toolbar shows the symbol for the Root enhancement. Lesson 2.1 Enhancing Image Data 46 PCI Geomatics Figure 2.8 radarsat.pix with root enhancement With the root enhancement applied, a T-shaped object is revealed near the left center of the image. Next, you will use the zoom commands to improve the detail of this feature. Figure 2.9 The zoom toolbar To zoom the image feature: 1. Click on or near the T-shaped object in Focus view area. The cursor moves to the center of the image. 2. On the Zoom toolbar, click the Zoom 1:1 Image Resolution command. The image zooms to 1:1 resolution. 3. Click the Root enhancement once again. This time, Focus uses the statistics from the zoomed portion of the image to calculate the root enhancement. There is only a slight change in the display of the image. With the image zoomed and the root enhancement reapplied, the T-shaped object can be identified as airport runways. Learning PCI Geomatica - Module 2: Image Processing with Focus PCI Geomatics 47 Figure 2.10 radarsat.pix with root enhancement at 1:1 resolution You can see how the root and linear enhancements make your imagery clearer and easier to interpret. Now try using the other enhancement commands in the list to give different views of the radarsat.pix image. Note When an image is zoomed, Focus uses the zoomed image statistics to calculate the enhancement. When an overview of the image is set in the view area, Focus uses all the image statistics to calculate the enhancement. Lesson 2.1 Enhancing Image Data 48 PCI Geomatics Adjusting Toolbar Enhancements You can control how Focus computes each of the standard enhancements before they are applied to an image. When Focus collects statistics for applying an enhancement, the Tail Trim option omits the upper and lower 2% of the image histogram and removes any outliers in the upper part of the pixel range. Next, you will compare an enhancement before and after adjusting the tail trim options from the Raster toolbar. Note the difference between images that are enhanced with the Tail Trim and images that are not. Make sure the radarsat.pix file is still open in your Focus view area. To adjust enhancement statistics: 1. If necessary, on the Zoom toolbar, click the Zoom to Overview command. The RADARSAT image zooms out so that the entire image fills the view area. 2. In the Enhancements drop-down list, click None. The image appears dark, with little or no contrast. 3. Open the Enhancements list and clear the Tail Trim option. With the enhancement set to None and the Tail Trim option cleared, you can now test the effects of the Tail Trim option. 4. Once again, open the Enhancements list and click the Linear command. You can see very little change in the image. The pixel values for the image are averaged out over the entire display range. Now, you will apply the same enhancement but this time, you will include the Tail Trim option. Note the differences between the two enhancements. Learning PCI Geomatica - Module 2: Image Processing with Focus PCI Geomatics 49 To apply the Tail Trim option: 1. In the Enhancements list, select the Tail Trim option. 2. Open the Enhancements list and click the Linear enhancement command again. This time the image contrast changes dramatically. Now the pixel values for the image are averaged out over the display range but the first 2% and the last 2% of values are omitted from the enhancement computation. You can adjust the amount of tail trim from the enhancements command list from 1% to 5%. To adjust the amount of Tail Trim: 1. In the Raster toolbar, open the Enhancements list. 2. At the bottom of the list, choose Set Trim%. The Set Trim% submenu opens. 3. In the Set Trim% submenu, click 5. 4. In the Enhancements list, click Linear. The new settings reveal even more detail in the image. The linear enhancement now omits the first 5% and the last 5% of the pixel values when the enhancement is calculated. Next, you will use the Contrast and Brightness commands to make your imagery clearer and to reveal image details. Note To see the effects of adjusting the enhancement, it must be re- applied by clicking the Enhancements command on the Focus toolbar. You can also apply image enhancements with the shortcut menu in the Maps tree. The same image enhancement commands are found in the shortcut menu, along with other tools. Lesson 2.1 Enhancing Image Data 50 PCI Geomatics Adjusting Image Contrast and Brightness Interpreting image data is often made easier by simply adjusting the image contrast and brightness. You can increase or decrease the image contrast and brightness, with Raster toolbar controls. To increase the image contrast: ? On the Raster toolbar, click the Contrasts command. To decrease the image contrast: 1. On the Raster toolbar, click the arrow to the right of the Contrasts command. The Contrasts command list opens. 2. In the Contrasts command list, click Decrease. The Decrease contrast command replaces the Increase contrast command. 3. Now, click the Decrease contrast command. You can see a change in your image contrast each time you click the command. Note Each click changes the image contrast by approximately 10%. The Brightness command works the same way as the Contrasts command. By selecting the down arrow to the right of the Raster toolbar command, you can increase, decrease, or reset the image brightness. To increase the image brightness: ?On the Raster toolbar, click the Brightness command. Note Each click changes the image brightness by approximately 10%. Learning PCI Geomatica - Module 2: Image Processing with Focus PCI Geomatics 51 To decrease the image brightness: 1. On the Raster toolbar, click the arrow to the right of the Brightness command. The Brightness command list opens. 2. In the Brightness command list, click Decrease. The Decrease brightness command replaces the Increase brightness command on the Raster toolbar. 3. Click the Decrease brightness command. You can see a change in your image brightness each time you click the command. To enhance an image from the shortcut menu: 1. In the Maps tree, right-click the radarsat.pix layer. The shortcut menu opens. 2. In the shortcut menu, click Enhance. 3. In the Enhance submenu, click any of the enhancements to apply them to your image. In this lesson you: ? Opened an image file and choose a default enhancement ? Used the toolbar enhancement commands ? Adjusted toolbar enhancements ? Changed the image contrast and brightness ? Enhanced images from the shortcut menu In the next lesson, you will use the advanced features in Focus to create a custom enhancement for your imagery using a Look-up table editor. Lesson 2.2 Editing a Look-Up Table 52 PCI Geomatics Lesson 2.2 Editing a Look-Up Table In this lesson you will: ? Open the Focus Look-up Table (LUT) editor from the Histogram display panel ? Use the Graph editing tools in the look-up table editor ? Trace-edit a histogram to create a custom enhancement ? Use the Toggle command to switch between custom enhancements The Focus Look-up Table (LUT) editor gives you greater control over the enhancement process by allowing you to directly edit an image histogram, compare the same image using different enhancements, and change the look-up table to any values, within a range, that you wish. To begin this lesson, make sure radarsat.pix is open in the Focus view area and the image is zoomed to an overview. Tip You can quickly clear a project from Focus by clicking the New Project command on the Focus toolbar. When the Save project dialog box opens, click No. Focus clears all file information and is ready for a new project. To open the LUT Editor: 1. In the Maps tree, right-click the radarsat.pix layer. 2. In the shortcut menu, click Enhance. 3. In the Enhance submenu, click Edit LUTs. Learning PCI Geomatica - Module 2: Image Processing with Focus PCI Geomatics 53 Figure 2.11 Edit LUT command The Histogram Display panel opens. Figure 2.12 Histogram Display panel 4. In the Histogram Display panel, click on the histogram in the middle of the panel. Lesson 2.2 Editing a Look-Up Table 54 PCI Geomatics The LUT Editor opens showing two histograms: a gray histogram for the original image and a red histogram for the enhanced image. Figure 2.13 LUT Editor showing the radarsat.pix image with a root enhancement You use the black line, to the right of the red histogram, and the level markers on the x-axis and y-axis of the graph, to set the histogram limits. Moving the markers changes the minimum and maximum values for both input and output levels. The exact values are shown in the text fields in the LUT values area. The x-axis graph shows the input values from 0, on the left, to 255 on the right. The y-axis shows the output values from 0, in the lower left, to 255 in the upper-left. To edit using the LUT editor: 1. Click the right-hand level marker on the x-axis of the graph. 2. Drag the marker to the left along the x-axis. 3. Click on one of the enhancement commands in the Functions panel on the right. The shape of the enhancement histogram changes to show the new LUT values and the radarsat.pix image changes to show the new value range. Learning PCI Geomatica - Module 2: Image Processing with Focus PCI Geomatics 55 Figure 2.14 Drag the LUT marker to the left Using the LUT Tools You can undo edits and compare different versions of a histogram for the same image data using the tools on the LUT editor. When the LUT Editor is opened, Focus stores a copy of the histogram as a smaller version, and displays it to the right of the LUT editor in the preview window. When you make changes, you can switch between the original and the edited LUT using the Toggle command, or you can use the Copy command to copy the edited LUT and save it as a temporary back up version. Figure 2.15 LUT Editor tools A B C D A. Graph editing toolbar B. LUT preview C. Enhancement commands D. LUT values Lesson 2.2 Editing a Look-Up Table 56 PCI Geomatics Using the LUT Enhancement Commands Enhancements are applied to values within the bounds defined by the x-axis and y-axis markers. The vertical markers, along the left side of the graph, set the minimum and maximum output grayscale values. The horizontal markers, along the bottom of the graph, set the range of input grayscale values for an enhancement. The markers are moved by clicking and dragging the handles up and down, or left and right. From the Tail Trimming drop-down list, you may select a value between 1 and 5. This is the percentage of tail trim to be applied with the enhancement. After you apply an enhancement, it can be edited and customized. Next, you will customize an enhancement by trace-editing the LUT histogram. Trace-Editing the LUT You can use the LUT Editor to create custom enhancements by directly editing the red histogram in the LUT graph. In the LUT editor you can trace the general contours of the histogram you want. Focus redraws the image in the view area to show the new histogram values you created. To trace-edit the red LUT histogram: 1. In the LUT Editor, on the Graph editing toolbar, click the Manual Mode command. 2. In the graph area of the LUT Editor, click and hold at any point along the black line in the LUT. 3. Drag the mouse up or down, right or left to form the contour you wish to view. The cursor position is updated, in the X and LUT (X) text boxes below the x-axis, as you drag your mouse. 4. Release the mouse button. The histogram changes to display the new values you have set and the imagery in the Focus view area is redrawn according to the new histogram. You can also move the entire histogram to the right or left of the X axis boundaries. To move the entire histogram: Learning PCI Geomatica - Module 2: Image Processing with Focus PCI Geomatics 57 1. In the graph area, click and hold your right mouse button. 2. Drag the entire graph to the left or to the right. 3. Release your right mouse button. The modified LUT is applied to the imagery in the view area. You can create different custom enhancements and switch them between the preview window and the LUT editor using the Copy and Toggle commands on the LUT Editor. To compare custom enhancements: 1. In the LUT Editor, on the Graph editing toolbar, click the Manual Mode command. 2. Create a custom enhancement by trace-editing the histogram. 3. On the Graph editing toolbar, click Copy. A copy of the histogram you just created appears in the preview window. 4. Create a new trace-edit enhancement or click the Toggle command again. The histogram in the LUT editor changes to the preview histogram and your new histogram is now in the preview window. You can also edit the LUT directly in a spreadsheet-style panel. In this module you will not edit the LUT directly but you can experiment on your own to see what changes can be made by adjusting the values in the LUT. To open the Look-Up Table for the histogram: ? On the Graph editing toolbar, click Edit Table. The LUT opens. Lesson 2.2 Editing a Look-Up Table 58 PCI Geomatics In this lesson you: ? Opened the Focus Look-up Table (LUT) editor from the Histogram display panel ? Used the Graph editing tools in the look-up table editor ? Trace-edited a histogram to create a custom enhancement ? Used the Toggle command to switch between custom enhancement views In the next lesson you will use high-pass and low-pass filters to filter more sample data. Learning PCI Geomatica - Module 2: Image Processing with Focus PCI Geomatics 59 Lesson 2.3 Working with Spatial Filters In this lesson you will: ? Reduce image graininess with a low-pass filter ? Preserve image details with a speckle filter ? Emphasize image borders and edges with a high-pass filter The Image Filter Kernel Spatial filters are used to enhance areas of low or high spatial frequency. Low-pass filters are used to produce smooth images and reduce noise or graininess. High-pass filtering is used to highlight fine spatial detail such as edges. The Focus Filter panel provides the tools to apply both high- pass and low-pass filters. The filter process uses a moving box, referred to as a kernel, that samples the image and applies the filter to the center pixel in the sample. After the filter is applied to the first sample, Focus moves the box one pixel to the right and applies the filter again. The sampling box dimensions, measured in pixels, must always be an odd number, for example, 3x3 or 11x15. When the entire image has been sampled, Focus applies the changes to the image in the view area. Coherent signal scattering in SAR data often causes image speckle or salt and pepper effects. Speckle is inherent in most SAR images, and can inhibit accurate image interpretation. There are several image filters in Focus to help manage image speckle. Applying a Low-Pass Filter Low-pass filters allow low spatial frequency variations to pass through, while removing or suppressing the higher spatial frequencies. You will begin this lesson by applying a low-pass filter to the radarsat.pix image. To apply a low-pass filter: 1. Make sure the radarsat.pix file is open in Focus. 2. In the Maps tree, below the New Area icon, right-click the radarsat.pix file. Lesson 2.3 Working with Spatial Filters 60 PCI Geomatics 3. In the shortcut menu, click Filter. The Filter panel opens. Figure 2.16 Focus Filter panel 4. Under the Filter Size caption, set the filter size to 9 by 9. 5. Under the Low Pass tab, click the Average Filter option. 6. In the lower left of the Filter panel, click Apply to View. The image in the display area appears smoother. Note Image filters are not cumulative. Each filter is applied to the original data stored in the image file. Take some time now to experiment with other low-pass filters and kernel size settings to compare the effects on the image. Learning PCI Geomatica - Module 2: Image Processing with Focus PCI Geomatics 61 Applying a Speckle Filter All SAR images, like the one in the radarsat.pix file, contain some speckle. The low-pass filter has reduced the image speckles, but has degraded some of the finer detail in the image. Special low-pass filters called Speckle Filters can preserve image details by not filtering pixels associated with linear features. Next, you will apply a speckle filter to preserve some of the linear features in the image. To apply a Speckle Filter: 1. In the Filter panel, if necessary, click the Low-Pass tab. 2. Under Speckle Filters, click the Gamma filter option. The Speckle filter commands are now available. 3. Below the Filter Size caption, use the scroll buttons to set the filter size to 7 by 7, or double-click in each of the size boxes and type 7. Note You must enter correct image mode values for the RADARSAT image files you are working with. The number of looks and the image amplitude information is available in the format definition included with your data. The radarsat.pix image is in amplitude format and includes four looks. Next, you will use this information to set up your speckle filter. 4. Below the Speckle Filter Setup caption, click in the Number of Looks box. 5. At the insertion point, type 4. 6. Click the arrow beside the Image Format box. 7. In the drop-down list, click Amplitude. 8. In the lower left of the Filter panel, click Apply to View. Use one of the Zoom tools to zoom the image and see the effects of the filter. You can see that image speckle is suppressed, while the linear details are preserved. Lesson 2.3 Working with Spatial Filters 62 PCI Geomatics Figure 2.17 The radarsat.pix image with speckle filter Applying a High-Pass Filter High-pass filters emphasize border pixels between contrasting areas, and are often referred to as edge detectors. Like speckle filters, they highlight pixel contrasts associated with linear features and edge details. Next, you will use a high-pass filter on the Landsat 7 panchromatic image. To apply a High-Pass filter: 1. From the demo folder, open the l7_pan.pix file. A Landsat 7 Panchromatic image opens in the Focus view area. 2. In the Maps tree, right-click the l7_pan.pix layer. 3. In the drop-down list, click Filter. The Filter panel opens. 4. On the Filter panel, click the High Pass tab. Learning PCI Geomatica - Module 2: Image Processing with Focus PCI Geomatics 63 Figure 2.18 The Filter panel showing the High Pass controls 5. Under the Filter Size caption, use the arrows to select a filter size, or type in a value of 7. 6. Under the High-Pass tab select the Edge Sharpening Filter. 7. Click Apply to File. A new window will open and the program will ask where you want to save the new filtered image. 8. Save the filtered image in the same file (l7_pan.pix) but create a new layer for the image. 9. Select New Layer by clicking on the arrow for channel selection, then specify a name for the layer. Call the new layer Edge Filter. Figure 2.19 Lesson 2.3 Working with Spatial Filters 64 PCI Geomatics 10. Click Ok. The high-pass filtered image will be saved to a new layer within the l7_pan.pix file. Try selecting other filter options and compare the results. In this lesson you: ? Reduced image graininess with a low-pass filter ? Reduce SAR image speckle with a speckle filter ? Emphasized image borders and edges with a high-pass filter Learning PCI Geomatica - Module 2: Image Processing with Focus PCI Geomatics 65 Lesson 2.4 Introduction to EASI Modeling In this lesson you will: ? Add a 32-bit real image channel ? Create and run a simple model in EASI Modeling to generate an NDVI image ? Save your model as an EAS file EASI Modeling EASI Modeling is a generalized image processing and raster GIS tool. Using a special programming language, you enter a set of equations that make up a model to describe how layers of imagery, bitmaps, and vector attribute data should be combined. The result can be new channels of data and a text report. You compose your script in the text editor in the EASI Modeling dialog box and use the Run command to execute them. Text, describing the model, is entered manually or imported from a file. Model equations are applied to each pixel in the selected PCIDSK database. EASI Modeling in Focus operates on a single input file that you select from the drop-down list in the modeling window. The basic steps required to run a simple model are outlined in this lesson. Tip You can combine a group of files, regardless of bounds, projection, data type, or resolution into a single output file with the Focus File Merge Wizard. Data in the new merged file will be resampled to a common projection and resolution. When you start the File Merge Wizard, follow the instructions at the top of the Wizard panels for each step. The File Merge Wizard is accessed from the Tools menu on the main Focus menu bar. Lesson 2.4 Introduction to EASI Modeling 66 PCI Geomatics Caution When using the EASI Modeling program in Focus, the model is performed directly on the database file. It is highly recommended that you backup the input file before the model is run. Note The image and bitmap layers must exist in the database PIX file prior to running the model. To add the required image and bitmap layers to a PIX file loaded in Focus, right click on the file in the File Tab and from the New submenu select Image Layer (or Bitmap Layer). Adding an Image Channel Locate and open the file irvine.pix. You can add any number of empty channels to a PIX file with Focus. You will need to add an empty 32-bit real channel in which to store the results of the NDVI calculation that you are going to perform. To add a new image channel: 1. Make sure the irvine.pix file is open in the Focus view area. 2. If necessary, in the Focus work area, click the Files tab. 3. At the top of the Files tree, right-click the irvine.pix folder. The shortcut menu opens. 4. In the New submenu, click Raster Layer. The Add Image Channel dialog box opens. Figure 2.20 Add Image Channel dialog box Learning PCI Geomatica - Module 2: Image Processing with Focus PCI Geomatics 67 5. In the Add Image Channel dialog box, change the 32-bit real box from 0 to 1. 6. In the lower middle of the Add Image Channel dialog box, click Add. Focus adds a new image channel to the irvine.pix file. Under Existing, the number of 32-bit real channels changes from 0 to 1. 7. Click Close. Simple Modeling The on-line help provides details on the entire EASI scripting language. EASI Modeling in Focus is designed primarily for simple image modeling. Table 1 lists the standard set of arithmetic operations available in modeling expressions. Table 1: Standard arithmetic operations A wide set of mathematical intrinsic functions are also available, including the sin(), cos(), tan(), asin(), acos(), atan(), ln(), log10(), exp(), exp10(), rad(), deg(), abs(), int(), random() and frac() functions. a + b Addition a - b Subtraction a * b Multiplication a / b Division a ^ b Exponentiation ( a ) Parentheses, also square brackets [] - a Unary negation Lesson 2.4 Introduction to EASI Modeling 68 PCI Geomatics Basic Modeling Logic In addition to simple assignment equations, it is also possible to construct simple logical operations in the Focus Modeling command window. These operations take the form of "IF" statements. Table 2 lists the possible comparison and logical functions. Table 2: Possible comparison and logical functions It is also possible to use brackets to ensure operations take place in the expected order. Tip For more details on EASI modeling expressions, launch the context sensitive help from the Focus EASI Modeling window and select Expressions. This will provide more details on numeric, string, logical and modeling (channel, bitmap and special variable) expressions. In this example you will calculate a Normalized Difference Vegetation Index (NDVI) using the red and near-infrared bands in the irvine.pix file. The results will be output to the empty 32-bit image channel. a > b a greater than b a < b a less than b a = b a equals b a <> b a not equal b a <= b a less than or equal b a >= b a greater than or equal b a OR b a is true or b is true a AND b a is true and b is true !a a is not true Learning PCI Geomatica - Module 2: Image Processing with Focus PCI Geomatics 69 To start EASI Modeling in Focus: ? From the Tools menu on the Focus menu bar, select EASI Modeling. The EASI Modeling window opens. Figure 2.21 EASI Modeling window You compose your script in the text editor in the EASI Modeling dialog box. First, you will select the input file to which the model will be applied. To select an input file: 1. Click the Input File arrow. 2. Select irvine.pix from the drop-down list. 3. If no files are listed for the current project, click More. The Open dialog box appears. 4. Locate and select irvine.pix. The file is highlighted and the name appears in the File name field. 5. Click Open. The Open dialog box closes and the file appears in the Input File field. You can now create a new script or load an existing script. Lesson 2.4 Introduction to EASI Modeling 70 PCI Geomatics To calculate a Normalized Difference Vegetation Index: 1. In the EASI Modeling window, type the following model: %12=(%4-%3)/(%4+%3) Figure 2.22 EASI Modeling window with NDVI model 2. Check the box beside Display Result(s). 3. Execute the model by clicking Run. The results of the NDVI calculation are now displayed in the Focus window and are saved to channel 12 on irvine.pix. Note The modeling window provides the option of displaying the results to the Focus viewer. It is not necessary to save this new layer back to the database as the modeling program operates on the database file itself, rather than on the display. Once you have reviewed the results on-screen, you can simply delete the new layer by right-clicking on the layer under the Files Tab and selecting Delete. Learning PCI Geomatica - Module 2: Image Processing with Focus PCI Geomatics 71 Saving EASI Models Now that you have created your first EASI model, you will save this model as an EAS file. To save your EASI model: 1. In the EASI Modeling dialog box, click Save. The File To Save dialog box opens. 2. When you have selected a folder for your EAS file, click in the File name box. 3. At the insertion point type NDVI.EAS. 4. Click Save. The File to Save dialog box closes and you are returned to the EASI Modeling dialog box. In this lesson you: ? Added a new 32-bit real image channel ? Created and ran a simple model in EASI Modeling to generate an NDVI image ? Saved your model as an EAS file Lesson 2.4 Introduction to EASI Modeling 72 PCI Geomatics PCI Geomatics 73 Module 3 Vector Processing with Focus Module 3 has Five Lessons: Lesson 3.1 Viewing Vector Data in Focus Lesson 3.2 Collecting and Editing Vectors Lesson 3.3 Managing Vector Attributes Lesson 3.4 Buffering Vectors Lesson 3.5 Dissolving Vectors Vector Data In addition to support for raster image data, Geomatica Focus provides a variety of tools for vector data collection and analysis. While raster data’s grid-cell structure is most useful for capturing continuous features (such as elevation, soil type, or temperature), vector data uses points, lines and polygons to represent spatial data (such as landmarks, road networks, or political boundaries). Vector data has advantages related to precision in graphics, traditional cartography, and data volume, while raster data is more advantageous for computation, update, and use in continuous space. By supporting both raster and vector data, Geomatica Focus can provide an extremely wide array of applications for geospatial data processing. In this module you will explore several typical tasks in vector data processing with Focus: loading and viewing vector layers, editing existing vectors, examining and editing vector attributes, as well as buffering and dissolving vectors. Representing vector data will be covered in Module 7: Map Publishing. Lesson 3.1 Viewing Vector Data in Focus 74 PCI Geomatics Lesson 3.1 Viewing Vector Data in Focus In this lesson you will: ? Load and view a vector layer ? Identify vector layer attributes using the attribute manager ? Select and examine specific features from the vector layer Working with Vector Layers Geographic features and their attributed data are stored in layers. Each layer of data can either represent a single set of geographic information such as hydrography, or a combination of information features such as road networks. Data layers can be displayed on-screen, and can consist of lines, polygons, and symbols that represent your project information. You can show or hide your layers by checking them in the Maps tree. When you want to work with a layer, you must make it active by selecting it in the Maps tree. For this lesson, begin by starting a new project in Focus. To open a new project: 1. On the Focus toolbar, click New Project. A Save Project window opens, prompting you to save the project. 2. Click No. A new project will open. To load a vector layer in Focus: 1. From the File pull-down menu on the Focus menu bar, select Open. A File Selection window opens. 2. From the demo folder, select the file railroad.pix. 3. Click Open. The File Selection window closes and the Railroads vector layer from the railroad.pix file is displayed in the viewer and listed in the Maps tree. Because this file only contains one vector layer, it is the default layer loaded into the Focus viewer. Learning PCI Geomatica - Module 3: Vector Processing with Focus PCI Geomatics 75 Tip Another way to load a vector layer is to use the Add Layer Wizard. This is a good method if you have multiple layers in a file and you wish to specify specific layers to load. Examining Vector Attributes The Attribute Manager displays vector layer statistics. This database contains all of the information that is displayed graphically. This information can be changed or updated and will consequently alter the appearance of the vector layer. Use the dialog box to view and edit vector layer point data for vector files. The file names associated with an attribute table appear in the Maps and Files tree in the main panel. To open the attribute manager for a vector layer: 1. In the Maps tree, right-click the railroad.pix layer. A shortcut menu appears. 2. From the bottom of the shortcut menu, select the Attribute Manager. The Attribute Manager opens. Figure 3.1 The Attribute Manager The Attribute Manager shows the attributes of the vector file you selected. Lesson 3.1 Viewing Vector Data in Focus 76 PCI Geomatics Tip Alternatively, click Open the Attribute Manager on the Tools toolbar, or select Attribute Manager from the Layer menu. In the Attribute Manager, you are able to select vectors, find and replace vector attributes, customize table definitions, set preferences, search for records using query by example, add records, sort records, add fields, compute attributes, join tables, and aggregate attributes. To select an individual vector: 1. On the Editing toolbar in the Focus viewer, click the Selection Tools arrow. The Selection Tools drop-down list appears. 2. From the drop-down list, select Individual. Figure 3.2 Selecting a Vector Learning PCI Geomatica - Module 3: Vector Processing with Focus PCI Geomatics 77 3. Click a vector in the viewer of the railroad.pix file. The vector is now highlighted in the viewer in green. 4. To disable the Individual command, click Selection Tools on the Editing toolbar or use the Escape key on the keyboard. When the vector is selected graphically, it is also becomes highlighted in the Attribute Manager. This allows you to examine the attributes of an individual feature. To select multiple vector features: 1. From the Selection Tool drop-down list, select Area. 2. In the Focus view area, draw an Area around the vectors you want to select. Figure 3.3 Selecting Multiple Vectors 3. When you have finished outlining the area, double-click. The vectors inside and intersecting the area you outlined are now highlighted in green. 4. To disable the Area command, click Selection Tools on the Editing toolbar or use the Escape key on your keyboard. Lesson 3.1 Viewing Vector Data in Focus 78 PCI Geomatics Once the vectors have been selected, you can view summary statistics for the selected vectors. At the bottom of the Attribute Manager, several statistics are listed for each attribute in the table, including count, minimum, maximum, mean, median, mode, standard deviation, and sum. The Attribute Manager provides a number of useful statistics for both individual a group of selected features. Figure 3.4 Statistics for a Group of Vectors In this lesson you: ? Loaded and viewed a vector layer ? Identified vector layer attributes using the attribute manager ? Selected and examined specific features from the vector layer Learning PCI Geomatica - Module 3: Vector Processing with Focus PCI Geomatics 79 Lesson 3.2 Collecting and Editing Vectors In this lesson you will: ? Digitize new vectors using the digitizing tools ? Edit vectors using the vector editing tools Topology A vector is a series of vertices linked together with line segments. The vertices are x and y coordinates representing a position on a map. The vector has a first vertex and a last vertex. The first vertex is the same as the start node, while the last vertex is the same as the end node. In this respect, a vertex and a node are one in the same at the ends of the vector. However, in between the nodes of a vector, there are only vertices. Geomatica Focus handles topological and non-topological vector files. In a topological file, there is a spatial relationship between all vector features. Lines connect to each other by points, an area is defined by a series of connected lines, and lines are drawn in a given direction, from point to point with left and right polygons of defined attributes. In a non-topological vector file, simple geometric features will load and run faster than topologically based features, however individual features have no relationship with each other. For example, mutual polygons can have duplicate arcs overlapping one another. An ArcView shape file is one example of a non-topological file format. Although the following approach loads a raster layer to use as a reference image for editing, it is possible to edit a vector layer without a reference image layer. To add new vectors to an existing vector layer, you must load the existing vector layer in the viewer. Lesson 3.2 Collecting and Editing Vectors 80 PCI Geomatics To load the reference image and the vector layer: 1. From the File pull-down menu, select Open. The File Selection dialog box opens. 2. From the demo folder, open l7_ms.pix. The image appears in the viewer. The RGB image appears under New Area in the Maps tree, and the image name appears in the Files tree. 3. From the File pull-down menu, select Open. The File Selection dialog box opens. 4. From the demo folder, open railroad.pix. The layer appears in the viewer. In addition, the layer name appears in the Maps tree under New Area. Tip At this point, it may be necessary to alter the image enhancement in order to see the vector segment more clearly. Figure 3.5 Vector Layer on an Image Layer Learning PCI Geomatica - Module 3: Vector Processing with Focus PCI Geomatics 81 Because the vector layer and Landsat image have been georeferenced to the same coordinate system, it is now possible to make changes to the vector layer using the image as a guide. Before you start editing existing vectors or digitizing new vectors, it is a good idea to set your vector editing options. Vector Editing Options Search, Snap, and Weed Vertices have tolerances that can be specified when editing vectors. Search Tolerance limits the cursor search distance for a vector feature to select. Clicking the cursor within this tolerance of a feature selects it. Snap Tolerance limits the lines or vertices that are available to snap to, given the cursor's current position. Weed Vertices Tolerance specifies the minimum distance between the last vertex digitized and the current pointer position within which another vertex can be digitized. To set Vector Editing tolerances: 1. From the Tools pull-down menu in the Focus viewer, select Options. The Options dialog box opens. 2. From the list on the left, select Vector editing. The Vector editing options appear on the right of the window. 3. Set the Snap tolerance to 100 meters. 4. Click the Snap automatically option. 5. To apply this setting, click OK at the bottom of the Options dialog box. Drawing New Vectors In Focus, there are several tools used for digitizing new data into existing layers. Digitizing new lines can demarcate linear features such as road systems and river networks. Adding new points could identify points where samples have been taken in a study area. The polygon tool can be used to draw, enclose, and fill a polygon which is useful for collecting training sites in supervised classification. Regular shapes such as rectangles and ellipses can also be digitized in Focus. Finally, the trace tool is available for digitizing irregular features in the viewer. In this lesson you will digitize new lines on a railroad vector layer to reflect certain changes that the railroad company has made. Assume that the railroad company has decided to extend the railroad network southward in order to send and receive ocean shipments. Lesson 3.2 Collecting and Editing Vectors 82 PCI Geomatics To digitize a new line: 1. On the Editing toolbar, click on the arrow beside the New Shapes button. 2. From the drop-down list, select Line. 3. Zoom to the vector in the lower middle of the Focus viewer. 4. Position your cursor over the end of the vector. The end vertex is shown as a square inside a circle. The circle is the size of snap tolerance you set. This is the vertex to which your new line will be snapped. Figure 3.6 Snap to End Node 5. Click on the end vertex. Your cursor is now snapped to that location. 6. Drag out the cursor to create the next point, or vertex, along the existing road. 7. To create the vertex, click with your mouse. The first line segment is created. 8. Move the cursor to another position along the road. Learning PCI Geomatica - Module 3: Vector Processing with Focus PCI Geomatics 83 9. To create the next vertex, click with your mouse. The second line segment is created. 10. Continue this pattern, following the road until you reach the coastline. 11. To end the line, double-click where you want it to end. The double-click will add an end vertex. You have now digitized a new vector. Figure 3.7 Digitizing a New Vector 12. To disable Line digitizing, click the Line tool on the Editing toolbar. Lesson 3.2 Collecting and Editing Vectors 84 PCI Geomatics To edit existing vectors: 1. In the Maps tree, make sure the Railroads layer is selected. The Vector Editing icon on the Editing toolbar is now active. 2. On the Editing toolbar, click Vector Editing. The Vector Editing Tools toolbar appears. Figure 3.8 Vector Editing Tools The Vector Editing Tools contain several modes for editing. The top row of the toolbar includes: Find, Reverse, Add Vertices, Merge Line/Polygon, Split Line/Polygon, Extend, Auto Merge Line, Close Shape, Mirror Tools, Rotation Tools, and Break Line/Polygon. The bottom row of tools are used for navigating through vertices and include: Start Vertex, Previous Vertex, Midpoint, Next Vertex, End Vertex, Show Vertices, and Vertices (information). To select a vector using the Find tool: 1. On the Vector Editing Tools toolbar, click the Find button. 2. Select the vector you just created. The vector is highlighted in green. The rest of the Vector Editing Toolbar now becomes active. The start vertex is shown as a square inside a circle. The end vertex is represented by a square. Note Split Line/Polygon mode separates a vector or polygon into two or more components. In this lesson you will assume that the railroad company has encountered a problem with its new segment of railway. It must now bypass a small portion of its original path. Ensure that the new railroad vector is selected, highlighted in green, and the start and end vertices are showing. Learning PCI Geomatica - Module 3: Vector Processing with Focus PCI Geomatics 85 To split vectors: 1. On the Vector Editing Tools toolbar, click Split Line/Polygon. 2. Move the cursor to the position on the vector where you want the split to occur. A target appears along the line to indicate your position. It is represented as a circle between vertices and as a square at vertices. 3. Click where you want to split the vector. The vector is split at the selected position. Figure 3.9 Splitting a Vector Note You are not restricted to splitting the vector at an existing vertex. You can make a split at any point along the vector, or on any line/polygon segment. Now that your new vector is split, you will add new vertices to create a bypass route for the railroad. Lesson 3.2 Collecting and Editing Vectors 86 PCI Geomatics To add new vertices to an existing vector: 1. On the Vector Editing Tools toolbar, click Add Vertices. 2. Click either the start or end vertex of the selected vector. 3. Move the cursor to the new location. 4. Click at this location. A line segment is drawn out from the existing vertex and a new vertex is added at the new location. In addition, the new vertex becomes either the new start or end node. Figure 3.10 Adding New Vertices Note The Merge Line/Polygon tool combines two or more separate vectors or polygons into one continuous line or shape. The new bypass route now needs to be rejoined with the remaining section of rail. Learning PCI Geomatica - Module 3: Vector Processing with Focus PCI Geomatics 87 To merge vectors: 1. Select one of the vectors you wish to merge. 2. On the Vector Editing Tools toolbar, click Merge Line/Polygon. 3. Click either the first or last vertex of the selected vector. This is the vertex from which you want to start the merge. 4. Click either the first or last vertex of the other vector. A new line segment is formed between the two vectors. The line segment is merged at the vertices. Figure 3.11 Merging Vectors Note To merge at a location other than the ends, you need to first split the vector at that location and then do a merge operation. Now try some of the other Vector Editing Tools such as Extend, Auto Merge Line, Close Shape, Mirror Tools, Rotation Tools and Break Line/ Polygon. Lesson 3.2 Collecting and Editing Vectors 88 PCI Geomatics In this lesson you: ? Digitized new vectors using the digitizing tools ? Edited vectors using the vector editing tools Learning PCI Geomatica - Module 3: Vector Processing with Focus PCI Geomatics 89 Lesson 3.3 Managing Vector Attributes In this lesson you will: ? Add new vector attributes to a file ? Query attributes by example ? Find and replace existing attributes with new attributes Attributes Attributes are characteristics of a geographic feature (described by numbers or characters) typically stored in tabular format, and linked to the feature. In Geomatica Focus, attributes are stored in the Attribute Manager. From the Attribute Manager, it is possible to create new attributes, query existing attributes, and do mathematical operations on attributes in order to produce new information. To add new attributes in the Attribute Manager: 1. From the demo folder, open the file lakes.shp. 2. In the Maps tree, right-click on the lakes layer. A shortcut menu appears. 3. From the bottom of the shortcut menu, select the Attribute Manager. The Attribute Manager opens. 4. From the Field pull-down menu, select Add New. The Table Definition window opens and a new field is listed at the top. Lesson 3.3 Managing Vector Attributes 90 PCI Geomatics Figure 3.12 Adding a New Field 5. Click in the Name column for the new field and type LakeSize. 6. For the Description, type Size of Lakes. 7. For the Data type, select text. 8. In the text box beside Default value, type Medium. 9. Click OK. A Question window opens asking if you want to add the new field and save the layer. 10. Click OK. The Table Definition window closes and the new field is listed in the Attribute Manager. Now that a new field has been added, you will query the database in order to add new information in the field. A query must have two comparable values separated by a relational operator. This combination is a statement. You can include one or more statements in a query; each statement is joined with a logical AND or OR operator. This set of statements is an equation. Note Each query you construct can be saved with the vector layer and used again as is, or it can be modified to suit different search criteria. You can use numbers or text strings in a statement, in order to query either numeric or text data. Learning PCI Geomatica - Module 3: Vector Processing with Focus PCI Geomatics 91 To select records using Query by Example: 1. In the main menu of the Attribute Manager, click Record. 2. Click Query by, and then click Example from the submenu. The Query by Example dialog box opens. 3. From the list of Attributes on the left, select area. The area attribute is now highlighted. 4. From the list of relational operators, select the greater than operator. 5. Above the list on the right, click Attribute Values. 6. In the list of Attribute Values, scroll down select 0.193402. The statement you just built is now entered in the New Statement field. 7. To add this statement to the Statement List, click Add. Figure 3.13 The Query By Example Window 8. To perform the Query by Example, click OK. All records that correspond to the query are selected in the Attribute Manager. Note Query by Example only selects records based on the equation. It does not permanently change values in the Attribute Manager. To permanently replace records in the Attribute Manager, use Find and Replace. Lesson 3.3 Managing Vector Attributes 92 PCI Geomatics To replace attributes in the Attribute Manager: 1. From the Edit pull-down menu, select Replace. The Find and Replace dialog box opens. 2. In the Find what box, type Medium. 3. Click the Limit search to selected record(s) option. This will perform the search only in the records you selected as a result of your query by example. 4. In the Replace with box, type Large. Figure 3.14 The Find and Replace Window 5. Click Replace All. In the LakeSize field of the Attribute Manager, the default value of Medium has been replaced with a value of Large for the lakes that were selected based on your query. Perform another Query by Example to select small lakes. Then, replace the default value of Medium with a value of Small for those selected records. In this lesson you: ? Added new vector attributes to a file ? Queried attributes by example ? Found and replaced existing attributes with new attributes Learning PCI Geomatica - Module 3: Vector Processing with Focus PCI Geomatics 93 Lesson 3.4 Buffering Vectors In this lesson you will: ? Create a buffer around existing vectors Buffering is a fundamental spatial analysis operation. It defines an area of inclusion or exclusion around a geographic feature. By using a buffer, you are able to find what features are within a certain distance of another. For example, in a point layer showing wells, you can create 100 meter buffers around them and designate them as potential contamination zones. In this case your output consists of circles, with a 100 meter radius around each well. You can create Buffers for lines, points and polygons. In this lesson you will create a buffer around surface water areas to identify environmentally sensitive zones. You will use the hydrography data in the irvine.pix file. To open the hydrography vector layer: 1. In the Focus viewer, select the Files tree. 2. Right-click in the white space. A shortcut menu opens. 3. From the shortcut menu, select Add. A File Selection window opens. 4. From the demo folder, open irvine.pix. The irvine.pix file is listed in the Files tree as part of your project, but data is not loaded into the viewer. This allows you to select which layer(s) you wish to view. 5. From the list of vectors, right-click on the hydrography layer. 6. From the shortcut menu, select View. The hydrography layer is loaded into the viewer and is listed in the Maps tree. Lesson 3.4 Buffering Vectors 94 PCI Geomatics To create a buffer: 1. From the Analysis menu on the Focus menu bar, click Buffer. The Buffer Wizard opens. Figure 3.15 The Buffer Wizard Window 2. For the input File, select irvine.pix. 3. For the input Layer, select VED Hydrography from 1:100000 Map. 4. For Output, select the Display option. The results will be displayed in the viewer only and not saved to a file. Tip If vectors are selected in the active vector layer before opening the Buffer Wizard, you have the option to apply the buffer to the selected vectors only by clicking the Buffer selected shapes only option. 5. For the Buffer distance(s) options, select Simple. 6. In the Buffer levels list, type 1. Learning PCI Geomatica - Module 3: Vector Processing with Focus PCI Geomatics 95 You can create multiple buffers around an object with the Buffer levels option. The number you specify creates the same number of Level columns in your Buffer distance(s) table. You can then enter a different buffer size for each level. 7. In the Units list, select Meter. 8. In the Level1 column, type a value of 100. This will create a buffer of 100 meters around the hydrography vectors. 9. At the bottom of the window, click Next. The second panel opens where you can select your vertex, line, polygon, attribute and output options. For this lesson, you will use the default options. 10. Click Finish. The output is a Temporary Vector Layer displaying all areas within a 100 meter buffer of all vectors in the hydrography layer. Figure 3.16 Buffering Results Lesson 3.4 Buffering Vectors 96 PCI Geomatics To save the Temporary Vector Layer: 1. In the Maps tree, right-click the Temporary Vector Layer. 2. From the shortcut menu, select Save As. The Save As panel opens. 3. In the Output File list, type buffer.pix. 4. In the Format list, select PCIDSK (.pix). A new PCIDSK file will be created. 5. In the Layer box, type 100 meter hydrography buffer. Figure 3.17 Save As Panel 6. Click Save. The Save As panel closes and both the Maps tree and Files tree are updated with the new filename and layer description. In this lesson you: ? Created a buffer around existing vectors Learning PCI Geomatica - Module 3: Vector Processing with Focus PCI Geomatics 97 Lesson 3.5 Dissolving Vectors In this lesson you will: ? Open the Dissolve Wizard ? Set the data and options for the dissolve ? Set output options ? Complete a Dissolve Dissolving Using the Dissolve command, it is possible to merge features with common attributes. For example, to compute provincial populations from a layer containing population for individual counties, you could use an attribute for county-by-province to dissolve all counties into their respective provinces. In this example, the sum of the populations of each county in a state is calculated for the new state polygon. In a typical dissolve operation, the merging of features requires a common value in the chosen attribute field. In some cases, the adjacency of features can also be used. A dissolve can only be performed on vector layers; however, the vector layers do not need to be currently open in your project. When the dissolve is completed, your output is added to the Files tree, and if desired, to the Maps tree as well. Begin by starting a new project in Focus. To open a new project: 1. On the Focus toolbar, click New Project. A Save Project window opens, prompting you to save the project. 2. Click No. A new project will open. Lesson 3.5 Dissolving Vectors 98 PCI Geomatics To load the county vector layer in Focus: 1. From the Layer pull-down menu on the Focus menu bar, select Add. The Add Layer Wizard opens and a Map and Area level are listed in the Maps tree. 2. In the Add Layer Wizard, click the Vector option. 3. Click Next. 4. In the next window, click Browse. A Select GeoGateway File window opens. 5. From the demo folder, select the file californ.pix. 6. Click Open. The file selection window closes and the californ.pix file appears in the Add Layer Wizard in the list of available files. The available vector segements from the californ.pix file are listed in the lower window of the Add Layer Wizard. Figure 3.18 The Add Layer Wizard 7. From the list of available vector segments, select Counties. 8. Click Finish. The Counties vector layer appears in the viewer and is listed in the Maps tree. Learning PCI Geomatica - Module 3: Vector Processing with Focus PCI Geomatics 99 Figure 3.19 Counties Vector Layer This vector layer has embedded representation which displays certain counties in black. Representation will be discussed in Module 7. In a dissolve, a common attribute is needed as a basis for the dissolve operation. All features with this common attribute will be dissolved together. In this lesson, we are dissolving all counties together to form a state (California). The common attribute in this dissolve is state name, st_name. All polygons with a California state name will be dissolved together. First, you must add a new field to contain the common attribute of California. To add the state name attribute to the counties layer: 1. Open the Attribute Manager for the Counties layer. 2. From the Field pull-down menu, select Add New. The Table Definition window opens and a new field is listed at the top. Lesson 3.5 Dissolving Vectors 100 PCI Geomatics Figure 3.20 Adding a New Field 3. Click in the Name column for the new field and type st_name. 4. For the Description, type state name. 5. For the Data type, select text. 6. In the text box beside Default value, type California. 7. Click OK. A Question window opens asking if you want to add the new field and save the layer. 8. Click OK. The Table Definition window closes and the st_name field is listed in the Attribute Manager. Now that there is a common attribute for all vectors in the Counties layer, the dissolve can be performed based on this attribute. Learning PCI Geomatica - Module 3: Vector Processing with Focus PCI Geomatics 101 To dissolve the county boundaries: 1. From the Analysis pull-down menu in the Focus viewer, select Dissolve. The Dissolve dialog box opens. 2. For the Input File, use the Active Layer. This will perform the dissolve on the current layer. Note If your layer to be dissolved is not loaded in Focus, you can click Browse to select a file and layer, rather than using the Active Layer. 3. In the Output section, click the Save button. 4. Beside the File text box, click Browse. A File Selector window opens. 5. Navigate to the user folder. 6. Enter the name DissolveCounty.pix. 7. Click Save. The File Selector window closes and you are returned to the Dissolve dialog box. 8. Beside the Save button, check Display saved results. The results of the Dissolve will be shown in the Focus viewer. 9. In the Layer text box, type Dissolved county layer. 10. In the Dissolve option section, select all shapes. All shapes in the county layer will be dissolved rather than only adjacent shapes. Since there are separate islands in the layer, these will be dissolved with the rest of the areas on the mainland. 11. In the Based On column of the attribute table, select st_name. The dissolve will be based on the state name attribute. 12. In the Function column, for the attributes of area, 1980popu, 1980popu, 1991popu, and 1996popu, click on the black arrow to the right and choose Sum. Lesson 3.5 Dissolving Vectors 102 PCI Geomatics Figure 3.21 The Dissolve WIndow 13. Click OK. The Dissolve process is run and your results are displayed in the Focus viewer. 14. Beside the original Counties layer, check the Visibility check box. The Counties layer is no longer visible. Learning PCI Geomatica - Module 3: Vector Processing with Focus PCI Geomatics 103 Figure 3.22 Dissolved Output The county polygons that existed in the original file are gone. These have been dissolved into one larger polygon - California. The Attribute Manager for the new layer shows one record for the entire polygon - the state of California. Each of the selected population attributes are added together in the Attribute Manager of the dissolved output layer. The area of each county is summed to generate a total area value for California. Figure 3.23 Dissolved Counties Attribute Manager Lesson 3.5 Dissolving Vectors 104 PCI Geomatics In this lesson you: ? Opened the Dissolve Wizard ? Set the data and options for a dissolve ? Set output options ? Completed a Dissolve PCI Geomatics 105 Module 4 Image Classification with Focus Module 4 has Seven Lessons: Lesson 4.1 Unsupervised Classification Lesson 4.2 Post-Classification Analysis - Unsupervised Lesson 4.3 Initializing Supervised Classification Lesson 4.4 Collecting Training Sites Lesson 4.5 Analyzing Training Sites Lesson 4.6 Running Supervised Classification Lesson 4.7 Post-Classification Analysis - Supervised The Classification Process Digital image classification, also known as spectral pattern recognition, uses the spectral information for each pixel in an image file to group pixels into common spectral themes. Classified images are thematic maps containing a mosaic of pixels belonging to different classes. The objective of the classification process is to assign all pixels in an image to a finite number of categories, or classes of data, based on their pixel values. If a pixel satisfies a certain set of criteria, then it is assigned to the class that corresponds to that criteria. Classification distinguishes between information classes and spectral classes. Information classes are ground cover categories you are interested in identifying from the original spectral data in your imagery. They could include: agricultural crop types, plant or forest species, or geological material types. Spectral classes are groups of pixels with similar brightness values or spectral characteristics. In comparing information classes with spectral classes, you must determine how the classified image data is to be used and how the spectral classes translate into information classes. There are two different image classification methods: unsupervised and supervised. 106 PCI Geomatics Unsupervised Classification This is a highly computer-automated procedure. It allows you to specify parameters that the computer uses as guidelines to uncover statistical patterns in the data. In an unsupervised classification the software automatically divides the range of spectral values, contained in an image file, into classes. With Focus you can choose the number of classes the data is divided into. The classified results report the proportions of spectral values in the image and can therefore indicate the prevalence of specific ground covers. A classification report can indicate the presence of a specific ground cover because a proportion of the classified pixels fall within its known spectral signature. In such a case, you need to know what the spectral signature of the target ground cover is in order to identify its presence. Supervised Classification Supervised classification is more closely controlled by you than unsupervised classification. In this process, you select recognizable regions within an image, with help from other sources, to create sample areas called training sites. Your training sites are then used to train the computer system to identify pixels with similar characteristics. Knowledge of the data, the classes desired, and the algorithm to be used, is required before you begin selecting your training sites. By setting priorities to your classes, you supervise the classification of pixels as they are assigned to a class value. If the classification is accurate, each resulting class will correspond to the training areas that you originally identified. Supervised training requires you to construct your information classes from a priori (already known) knowledge of the data, such as: ? What type of classes need to be extracted? You may be looking for soil types, land use areas, or specific types of vegetation. ? What classes are most likely to be present in the data? In the case of classifications intending to identify land cover types, you’ll need to have some idea of the actual types of soil or types of vegetation represented by the data. Focus uses one of several programs to determine the numerical signatures for each training class. When Focus has determined the signatures for the classes, each pixel in the image is compared to the signatures and labelled as the class it resembles digitally. Learning PCI Geomatica - Module 4: Image Classification with Focus PCI Geomatics 107 In this module you will use the Focus classification tools to carry out both supervised and unsupervised classifications. You will work with image data located on your workstation hard disk. In the first lesson, you will use Focus to perform an unsupervised classification with the K-MEANS algorithm. In the lessons that follow, you will supervise a classification by creating classes for three different crop types in your image. Your instructor will tell you the location of the data files and when to begin working on the lessons. When you have finished reading this introduction, take some time to look over the contents of the irvine.pix file and the lessons before you start working. If you have any questions, please ask your instructor. Table 1: Contents of the irvine.pix file Data Type Segments and Imagery Landsat TM spectral 5 USGS landuse/landcover 1 Classification 1 Working channels 2 16-bit elevation data 1 ERS-1 radar data 1 Georeferenced segment 1 Lookup tables 5 Pseudo color lookup tables 2 Training area bitmaps 8 Signature segments 8 Vector segments 2 Ground control point segments 1 Lesson 4.1 Unsupervised Classification 108 PCI Geomatics Lesson 4.1 Unsupervised Classification In this lesson you will: ? Start a new classification session ? Initialize an unsupervised classification ? Run a classification and review the report Unsupervised Classification An unsupervised classification organizes image information into discrete classes of spectrally similar pixel values. To perform unsupervised classification with Focus, you work through panels and dialog boxes, to configure your data files and to choose the number of classes that the computer system will differentiate. When you have finished configuring your classification, you run the process. Focus automatically classifies the spectral values in the image data. You can view the classification results in the Focus view area and as a classification report. Starting a New Classification Session To begin working on this module, make sure Focus is open on your desktop. You will initialize your classification session from the Focus work area. You will perform your unsupervised classification on the irvine.pix file. Before you initialize your classification session you will need to start a new project and open the irvine.pix file from the demo folder. To start a new project and open irvine.pix: 1. On the Focus toolbar, click New Project. A Save Project window opens, prompting you to save the project. 2. Click No. A new project will open. 3. On the Project toolbar, click Open File. A File Selection window opens. 4. Open irvine.pix from the demo folder. Learning PCI Geomatica - Module 4: Image Classification with Focus PCI Geomatics 109 To initialize a classification session: 1. In the Maps tree, right-click the irvine.pix layer. A shortcut menu opens. 2. In the Image Classification submenu, click Unsupervised. The Session Selection window opens. Figure 4.1 The Session Selection window 3. Click, New Session. The Session Selection window closes and the Session Configuration panel opens. Figure 4.2 Session Configuration panel 4. In the Description box, type Unsupervised Session. 5. Leave the Red, Green, and Blue color values as they are. 6. In the Input Channels column, select channels 1 through 5. Next, you will select a working channel to store your classification. Lesson 4.1 Unsupervised Classification 110 PCI Geomatics 7. In the Output channel column, select channel 8 for your working channel. 8. In the lower left of the Session Configuration Panel, click Accept. The Session Configuration panel closes and the Classify panel opens. Focus also adds a Classification MetaLayer to the Maps tree to help you manage your classification session. Initializing Unsupervised Classification The Classify panel allows you to choose the type of algorithm and the parameters you want to use for your classification. You will use it now to select an algorithm and to set the number of training sites that Focus will use when you run the classification. Figure 4.3 The Classify panel To run the unsupervised classification: 1. In the Classify panel, under Algorithm, select K-means. 2. Under K-Means Parameters, click in the Max Class text box. 3. At the insertion point, type 10. 4. In the lower left of the Classify panel, click Classify. Focus runs the classification using the K-means algorithm. A progress monitor opens showing the progress of the classification. When the classification is complete, the progress monitor closes. A classification report window opens and the image in the Focus viewer changes to show the classified image. Learning PCI Geomatica - Module 4: Image Classification with Focus PCI Geomatics 111 Figure 4.4 The classified image The Maps tree now shows the Classification MetaLayer for the unsupervised classification above the original image layers. The Classification MetaLayer manages the classification session and also stores configuration information about your session. It lists the Output layer and the three-band reference image. You can view the original image by turning off the visibility of the Output layer within the Classification MetaLayer. Reading the Classification Report The classification report indicates the distribution of pixel values across the number of classes that you chose in the Classify panel. The report includes a date stamp and the file path for your classified imagery. The classification algorithm is listed with the input channels and the channel where your results are stored. Below the identifying information, the report lists the number of clusters created by the classification alongside the details for each cluster. Clusters are groups of pixels with similar spectral properties. Lesson 4.1 Unsupervised Classification 112 PCI Geomatics Figure 4.5 The Classification Report window The cluster report tells you how many pixels make up each class, as well as the mean brightness value and the standard deviation for each of the five image channels. In this lesson you: ? Started a new classification session ? Initialized an unsupervised classification ? Ran a classification and reviewed the report Learning PCI Geomatica - Module 4: Image Classification with Focus PCI Geomatics 113 Lesson 4.2 Post-Classification Analysis - Unsupervised In this lesson you will ? Combine classes into new aggregate classes Class Aggregation Unsupervised image classifiers do not always provide the desired number of truly representative classes. Aggregation can be used to combine separate classes into one class after a classification. A maximum of 255 classes can be reassigned in a single session. A common approach in unsupervised classification is to generate as many cluster classes as possible. With the benefit of reference data or first-hand knowledge of the scene, the analyst then aggregates the spectral clusters into meaningful thematic classes. To open the Aggregate dialog box: 1. In the Maps tree, right-click the Classification MetaLayer. A shortcut menu appears. 2. From the shortcut menu, select Post-classification Analysis. 3. In the submenu, click Aggregation. The Channel Setup dialog box opens. Lesson 4.2 Post-Classification Analysis - Unsupervised 114 PCI Geomatics Figure 4.6 The Channel Setup Dialog Box 4. In the Channel Setup dialog box, select channel 8 as the input channel. This is the channel that will be aggregated. It is typically the result of an unsupervised classification. 5. As the Output channel, select channel 9. The results of the aggregation will be stored in this channel. 6. Click Accept. The Aggregate panel opens. Figure 4.7 Aggregate Panel Learning PCI Geomatica - Module 4: Image Classification with Focus PCI Geomatics 115 To Aggregate classes: 1. For the viewing option, select Current Classes. This displays the classes that are currently selected in the Input Classes list. 2. In the list of Input Classes, hold down the SHIFT or CTRL key to select Class-06 and Class-07. Because these two classes are the current classes, only they are displayed in the Focus viewer. Figure 4.8 Focus viewer with Current Classes Displayed 3. In the Aggregate Classes area, click New. This creates a new empty aggregate class. 4. To add the input class to the aggregate class in the Aggregate Classes list, click Add. The new aggregate class, Class-11, indicates that it represents a combination of class 6 and 7. Lesson 4.2 Post-Classification Analysis - Unsupervised 116 PCI Geomatics Tip Aggregation is usually a lengthy process, especially if you want to test and compare several different aggregation scenarios. It is wise to use the Save Aggregate Session feature periodically as a backup so you don’t lose your work. 5. Click Apply to Output Channel. The results of the aggregate will be written to a new channel that you specified in the channel setup and the list of Aggregate Classes has been updated. Figure 4.9 Aggregate Panel after Applying Aggregation Once you have finished with the Aggregate panel, you can finish the classification session by removing the metalayer from the Maps tree. To end the classification session: ? In the Maps tree, right-click the Class Aggregation MetaLayer and select Remove. The metalayer is removed. In this lesson you: ? Aggregated classes Learning PCI Geomatica - Module 4: Image Classification with Focus PCI Geomatics 117 Lesson 4.3 Initializing Supervised Classification In this lesson you will: ? Open a new supervised classification session ? Add image channels ? Change the reference image RGB values to show a true color rendition ? Choose the spectral attributes of the image database that will be included in your classification ? Initialize a supervised classification Supervised Classification In supervised classification, you must rely on your own pattern recognition skills and a priori knowledge of the data to help Focus determine the statistical criteria (signatures) for data classification. To select reliable training sites, you should have some information, either spatial or spectral, about the pixels that you want to classify. The location of a specific characteristic, such as a land cover type, may be known through ground truthing. Ground truthing refers to the acquisition of knowledge about the study area from field work analysis, aerial photography, or personal experience. Ground truth data is considered to be the most accurate (true) data available about the area you want to study. They should be collected at the same time as the remotely-sensed data, so that the data corresponds as much as possible. Some ground truth data may not be accurate due to errors, inaccuracies, and human error. Global positioning system receivers are useful tools to conduct ground truth studies and collect training sites. Lesson 4.3 Initializing Supervised Classification 118 PCI Geomatics Initializing Supervised Classification Like unsupervised classification, supervised classification is initialized as a session in Focus. The initialization procedure also helps you manage subsequent classifications on the same files, without having to re-initialize a new session each time. To initialize a classification session: 1. In the Maps tree, right-click the irvine.pix layer. A shortcut menu opens. 2. In the Image Classification submenu, click Supervised. The Session Selection window opens. Figure 4.10 The Session Selection dialog box 3. In the lower left of the Session Selection dialog box, click New Session. A Session Configuration panel opens. Figure 4.11 Session Configuration panel showing default RGB values Learning PCI Geomatica - Module 4: Image Classification with Focus PCI Geomatics 119 The Session Configuration dialog box lists the contents of the irvine.pix file. When it opens, Focus automatically assigns Red, Green, and Blue (RGB) values to the first three channels. You use the session configuration panel to select the exact combination of channels for your purpose. You can assign the color channels that define the reference image for collecting your training sites and for doing any post-classification analysis. To configure the session: 1. In the description text field, type Supervised Classification Session. Tip When naming classification sessions, enter a name in the Description text field that will distinguish your current classification from others you create. 2. Beside the description text field, click on Add Layer. The Add Image Channels window opens. Figure 4.12 Adding Image Channels for Supervised Classification 3. Add 2 8-bit channels to irvine.pix. The first empty channel will contain training sites and the other will contain the supervised classification result. 4. Click Add. The channels will be added to the irvine.pix file. Lesson 4.3 Initializing Supervised Classification 120 PCI Geomatics Image Colors and Color Channels Recall that supervised classification requires you to rely on your own pattern recognition skills and a priori knowledge of the data to help Focus determine the spectral signatures for classifying the data. To select reliable training sites, you should know either spatial or spectral information about the pixels that you want to classify. You will need to visually identify your training areas from familiar colors in the imagery. Therefore, you need to select a three-band combination that helps you distinguish features of interest in your images. The session configuration panel automatically assigns the first three channels to the reference image displayed in the Focus view area. Next, you will select three bands to be displayed as a reference image in the Focus viewer. To change the RGB channels: ? In the Session Configuration panel, click the Red, Green, and Blue table cells beside the corresponding spectral bands or TM bands you wish to display. Figure 4.13 Session Configuration Panel After you have set the RGB values to display a three-band composite, you will select which channels the classification will be based on. You will include all five spectral bands in the irvine.pix file. Learning PCI Geomatica - Module 4: Image Classification with Focus PCI Geomatics 121 To select your input and output channels: 1. In the Input Channels column, click channels 1 through 5. Next, you will select a channel for collecting your training sites. You will use an empty channel that you created at the start of this lesson. 2. In the Training Channel column, click the cell in row 10. Next, you will select the channel to receive the classification result. In the Output Channel column, click the cell in row 11. Figure 4.14 The Session Configuration panel with training channels and output channels selected 3. In the lower left of the Session Configuration panel, click Accept. The Session Configuration panel closes and the Training Site Editing panel opens. Focus also adds a Classification MetaLayer to the Maps tree to help you manage your classification session. The metalayer contains three layers: the training channel, the three-band composite you selected and the output layer. Lesson 4.3 Initializing Supervised Classification 122 PCI Geomatics Figure 4.15 Classification MetaLayer Figure 4.16 Training Site Editing panel You have now initialized your classification session and are ready to begin collecting and editing your training sites. Learning PCI Geomatica - Module 4: Image Classification with Focus PCI Geomatics 123 In this lesson you: ? Opened a new supervised classification session ? Added image channels ? Changed the reference image RGB values to show a true color rendition ? Chose the spectral attributes of the image database that will be included in your classification ? Initialized a supervised classification Lesson 4.4 Collecting Training Sites 124 PCI Geomatics Lesson 4.4 Collecting Training Sites In this lesson you will: ? Create training site manually ? Create training sites with raster seeding ? Change the color of your training sites Training Sites and Ground Cover Recall that training sites are sets of pixels that represent what is recognized as a discernible pattern, or potential class. In supervised classification, Focus calculates statistics from sample pixels to create a parametric signature for the class. You designate training sites based on samples of different surface cover types in your imagery by drawing colored layers over the parts of the image that are likely to be the information classes you want to examine. Your samples or training sites are based on your familiarity with the geographical region and knowledge of the actual surface cover types shown in the image. For each pixel in your training areas, Focus uses the numerical data from the selected input channels to identify spectrally similar areas for each class you create. You have no way of knowing for certain what the actual ground cover in the irvine.pix image is. Therefore, you will name the three training areas crop A, crop B, and crop C. You have changed the spectral attributes of the imagery to a true color rendition. Now you can select the areas in the imagery for training sites based on visible color differences. Next, you will use the training site editor to create your training sites so you can use them as a basis for your supervised classification. Learning PCI Geomatica - Module 4: Image Classification with Focus PCI Geomatics 125 To create a new class: 1. In the Class menu on the Training Site Editing panel, click New. The editing table automatically assigns a numbered cell for your first class. Class-01 appears in the editing table. Figure 4.17 Training Site Editor with one class 2. In the Name column for the first class, type crop A. Next you will draw a training site for crop A over the reference image in the Focus work area. Collecting Training Sites After naming crop A with the Training Site Editor you can use the Focus Editing Toolbar commands to draw training sites for crop A over the image in the Focus view area. Tip To zoom your reference image while collecting training sites you can right-click the reference image and use the View Area shortcut, click any of the six toolbar commands, or use the Zoom To submenu in the View list on the Focus menu bar. Lesson 4.4 Collecting Training Sites 126 PCI Geomatics To create a training site for crop A: 1. If necessary, in the Maps tree, below the Classification MetaLayer, select the PCT layer labelled Training areas. You can use either Line, Polygon, Rectangle, Ellipse, Trace or Raster Seeding to create training sites. In this lesson, you will use Polygon. 2. On the Editing Toolbar, click the arrow to the right of the New Shapes command. 3. In the drop-down list, click Polygon. Figure 4.18 The New Polygon drop- down list You are now ready to draw a training site over the reference image in the work area. In this lesson, you will identify all of your training sites by their color in the irvine.pix imagery. The ground cover for crop A should appear as a mixture of black and dark blue pixels. For this example, you will begin selecting the training area in the black and dark blue colored patch located at approximately 430230E and 3728100N. Learning PCI Geomatica - Module 4: Image Classification with Focus PCI Geomatics 127 Caution Overlapping your training area boundaries reduces the reliability of your training sites. Try to draw the site within the bounds of the corresponding colored area in your irvine.pix imagery. To draw a training site: 1. Click the reference image within the bounds of the subject area where you want to start the training area outline. 2. Use your mouse pointer to draw a line to the next point of your polygon and click once. 3. Trace the outline of the polygon by clicking at the end of each line segment as shown in Figure 4.19. Figure 4.19 Drawing a new polygon over the reference image 4. To complete your polygon, double-click near the first point in your training site. The training site outline is filled with the default color for that class. Figure 4.20 shows a completed training site for crop A. Lesson 4.4 Collecting Training Sites 128 PCI Geomatics Figure 4.20 A selected training site Continue to collect a few more training sites for crop A. The more areas you identify as training sites, the higher the accuracy of your classification. Repeat all of the steps for creating a training site to produce two more classes. Be sure the training sites are based on reference image areas with distinctive coloring. Name the new classes crop B and crop C. Again, try to identify and select multiple training sites for each of the new classes. If you need more information, please ask your instructor for assistance. Learning PCI Geomatica - Module 4: Image Classification with Focus PCI Geomatics 129 Creating Training Sites with Raster Seeding The Raster Seeding tool will grow and fill a region of similar pixels. This is a convenient aid when creating irregularly shaped training sites or polygons from homogeneous groupings of pixels for training sites. By adjusting the tolerance, you slowly adjust the size of the grown region. A higher tolerance creates a larger region of growth whereas as a smaller tolerance creates a smaller region of growth. Add a fourth class, called water. You will use the Raster Seeding tool to collect training site for areas of water. To create a training site using raster seeding: 1. From the New Shapes drop-down list on the Editing toolbar, select Raster Seeding. Figure 4.21 Creating Training Sites with Raster Seeding The Seed Polygon dialog box opens. Lesson 4.4 Collecting Training Sites 130 PCI Geomatics Figure 4.22 Raster Seeding Window 2. As the Selection Criteria, select Classification Input. The output layer will automatically be the Training Areas layer. 3. Choose an Input Pixel Value Tolerance of 5. This will grow the seeded polygon to all pixel values within +/- 5 brightness values of the original selected pixel. 4. For Neighborhood, select 4 Connect. This will seed values on all sides, while 8 connect will seed diagonal pixels as well. 5. With the Raster Seeding window open, click inside the lake. The Raster Seeding tool will highlight a group of similar pixels to form a training site for water. 6. Collect several training sites using the Raster Seeding tool. Note You may have to adjust the tolerances in the Raster Seeding window to get the results you desire. Learning PCI Geomatica - Module 4: Image Classification with Focus PCI Geomatics 131 To erase training sites: 1. On the Editing Toolbar, click the arrow to the right of the Raster Erase command. Figure 4.23 The Erase Command on the Editing toolbar 2. In the drop-down list, select Erase Polygon. 3. Use your mouse to trace around the training area you want to erase from the image. 4. Double-click to erase. Changing Training Site Colors Focus automatically assigns colors to new training sites. Crop B may appear blue and crop C may appear yellow when they are drawn in the image view area. You can change the color of a training site to any color you wish. To change the color for a training site: 1. In the Training Site Editing table, click the color sample for the training site you want to change. A color adjustment panel opens for the training site you selected. 2. In the Basic Colors palette, click one of the basic colors. Fine adjustments to the color can be made using the Color Continuum and the Intensity Scale. There are four color models available in the color adjustment panel: Gray, RGB, CMYK, or HLS/IHS. 3. To choose a color model, choose from the list of Models. Lesson 4.4 Collecting Training Sites 132 PCI Geomatics Figure 4.24 The color adjustment panel 4. When you have finished adjusting your training area color, click OK. The color adjustment panel closes, and your new color appears in the Training Site Editing table. In this lesson you: ? Created training site manually ? Created training sites using raster seeding ? Changed the color of your training sites Learning PCI Geomatica - Module 4: Image Classification with Focus PCI Geomatics 133 Lesson 4.5 Analyzing Training Sites In this lesson you will: ? Examine signature statistics ? Create class histograms to test your training sites ? Check signature separability Training Site Analysis Often during classification, unique spectral classes appear that do not correspond to any of the information classes that you want to use. In other cases, a broad information class may contain a number of spectral sub- classes with unique variations. This can be caused by a mixture of ground cover types appearing in the image at the time it was recorded, or by shadows and variations in scene illumination. Focus offers several methods for insuring that your training sites are both representative and complete. You can analyze your training site data before running the classification by examining signature statistics, histograms, and signature separability. Lesson 4.5 Analyzing Training Sites 134 PCI Geomatics Signature Statistics The Signature Statistics panel displays the number of samples in the training area indicating whether you have collected enough pixels to accurately represent the land cover. In general, if you are classifying n bands, then you require a minimum of 10n pixels of training data for each class. The General report lists the mean and standard deviation for each input channel under the class's training areas. To view your signature statistics: 1. In the Training Site Editing panel, right-click on crop A. 2. In the shortcut menu choose Statistics. Figure 4.25 The Training Site Editing shortcut menu The Signature Statistics panel opens. Figure 4.26 The Signature Statistics panel 3. To display statistics for a selected class, click on the class in the Training Site Editing table. The statistics automatically update for the selected class. Learning PCI Geomatica - Module 4: Image Classification with Focus PCI Geomatics 135 Histograms You can view and test the reliability of your training sites by creating a histogram in the Class Histogram display panel. The histogram shows the frequency of training site pixels as a percentage of the number of pixels in your training sites. Your histogram should have a uni-modal shape displaying a single peak. A multi-modal histogram indicates the likelihood that the training sites for that class are not pure, but contain more than one distinct land cover class. Next, you will produce a histogram with Focus to check the reliability of your training sites. To create a histogram for a training site: ? From the Tools pull-down menu in the Training Site Editing window, select Histogram. Alternatively, you can select a class, right-click and select Histogram from the shortcut menu. Figure 4.27 Training site editor shortcut menu The Class Histogram Display panel opens, showing a histogram for the crop A training site. Lesson 4.5 Analyzing Training Sites 136 PCI Geomatics Figure 4.28 The Class Histogram for crop A The x-axis in the histogram represents the gray level value for the image channel with a range of 0 to 255. The y-axis shows the frequency count as a percentage of the total count of pixels in the training area corresponding to the gray value. Signature Separability Signature Separability is calculated as the statistical difference between pairs of spectral signatures. You can use the Signature Separability panel to monitor the quality of your training sites. Divergence is shown as both Bhattacharrya Distance and Transformed Divergence, with the Bhattacharrya Distance as the default calculation. Both Bhattacharrya Distance and Transformed Divergence are shown as real values between zero and two. A zero indicates complete overlap between the signatures of two classes and two indicates a complete separation between the two classes. These measurements are monotonically related to classification accuracies. The larger the separability values are, the better the final classification result will be. Values between 1.9 and 2.0 are considered good separability. Learning PCI Geomatica - Module 4: Image Classification with Focus PCI Geomatics 137 To open the Signature Separability panel: ? Open the Tools menu in the Training Site Editing dialog box, and click Signature Separability. The Signature Separability dialog box opens. Figure 4.29 Signature Separability dialog box Scatter Plot You can also use the Scatter Plot panel to show elliptical graphs for all four training sites. A class ellipse shows the maximum likelihood equiprobability contour defined by the class threshold value entered for the mean. Next, you will use the Plot Ellipses tool to assess the separability of your spectral classes and to refine and edit your training statistics. To display a scatter plot: 1. From the Tools menu in the Training Site Editing panel, select Scatter Plot. The Scatter Plot panel opens. Lesson 4.5 Analyzing Training Sites 138 PCI Geomatics Figure 4.30 Scatter Plot Panel In the Scatter Plot panel, you want to plot the mean and ellipse for each of the training classes. 2. For each class, select the Plot Mean option. 3. For each class, select the Plot Ellipse option. Tip To zoom the scatter plot, right-click inside the graph area on the scatter plot panel and choose Zoom In from the shortcut menu. You can also zoom by outlining a part of the scatter plot with your mouse. Try plotting different band combinations. If you find there is overlap in the hyperellipses between two or more classes in all band combinations, you may wish to go back and edit your original training sites. Overlap indicates there may be confusion between the classes in the final classified image. You can run a Classification Preview to preview the results based on your existing training site statistics. You can also modify these training site statistics by adjusting the threshold and bias. Learning PCI Geomatica - Module 4: Image Classification with Focus PCI Geomatics 139 To preview the classification: 1. In Training Site Editing panel, open the Tools menu and select Classification Preview. 2. From the Classification Preview drop-down list, select Maximum Likelihood with NULL Class. Figure 4.31 Classification Preview command This shows you a preview of how the input channels will be classified using the training sites you collected and saved in the training channel. The threshold is the radius, in standard deviation units, of a hyperellipse, surrounding the mean of the class in feature space. By changing the threshold values, we can reduce the chances of pixels being classified into more than one class. To adjust the Threshold value: 1. In the Training Site Editing table, under the Threshold column for crop C, type 2.5. In the Scatter Plot panel, the class ellipse for crop C adjusts automatically to show the change in the threshold value. Your Classification Preview is also updated to reflect the change. 2. Next, in the Threshold column for crop A, type 4. The size of the class ellipse for crop A increases and the preview updates as well. There are now more areas classified as crop A. 3. When you are finished examining the preview, set the Threshold for all classes back to the default value of 3. Lesson 4.5 Analyzing Training Sites 140 PCI Geomatics Tip Another way to force classes to separation is by using Bias. Bias is a value from 0 to 1 where higher values weigh one class in favour of another. It can also be used to resolve overlap between classes. 4. Click Save & Close. You have now saved your training sites and your classification preview has closed. You are now ready to run your supervised classification. In this lesson you: ? Examined signature statistics ? Created class histograms to test your training sites ? Checked signature separability Learning PCI Geomatica - Module 4: Image Classification with Focus PCI Geomatics 141 Lesson 4.6 Running a Supervised Classification In this lesson you will: ? Run your supervised classification ? Generate a classification report After you have analyzed the reliability of your training sites you can make Focus carry out the Classification. You will run your classification from the Focus Maps tree. To run your classification: 1. In the Focus Maps tree, right-click the Classification MetaLayer. 2. From the shortcut menu, select Run Classification. Figure 4.32 The Classification shortcut menu The Classify dialog box opens. Lesson 4.6 Running a Supervised Classification 142 PCI Geomatics Figure 4.33 The Classify dialog box You can choose from three classification methods in the Classify dialog box: Minimum Distance, Parallelepiped, and Maximum Likelihood. The maximum likelihood method allows a null class parameter option. In this case you want to extract three classes, but you know there are many more land cover classes represented in your imagery. Therefore, a high proportion of pixels should be left unclassified or null. For this example, you will use the Maximum Likelihood method with a null class. 3. In the Algorithm section, select the Maximum Likelihood option. 4. In the Maximum Likelihood Parameters section, choose the With NULL class option. 5. In the Classify Options section, choose Show Report. Tip To compare this classification with another classification, you should also select the Create PCT option. Creating a Pseudo Colour Table (PCT) will allow you to use the same colours to display these classes outside of the classification session. 6. In the lower left of the Classify panel, click Classify. The supervised classification appears in the Focus view area and a Classification Report window opens showing a report of the completed classification. Learning PCI Geomatica - Module 4: Image Classification with Focus PCI Geomatics 143 Figure 4.34 Classification Report window Your report should show a high overall training site accuracy. The information from each pixel in the training areas is compared to the information determined by the classifier algorithm. The overall accuracy represents the percentage of training area pixels that were correctly classified. Your training areas are ideal examples of the classes. In the next lesson you will work through post-classification editing. In this lesson you: ? Ran a supervised classification ? Generated a classification report Lesson 4.7 Post-Classification Analysis - Supervised 144 PCI Geomatics Lesson 4.7 Post-Classification Analysis - Supervised In this lesson you will: ? Initialize post-classification editing ? Set up a bitmap mask ? Draw a bitmap mask over your classified imagery ? Merge multiple classes into a null class Improving Classification Results In many cases, the classification algorithm will not always provide the desired level of accuracy. There are often occurrences of single pixel misclassification. A field may contain a few pixels of another class or there may be image data falling outside training sites that effects the classification results. Class editing is intended to correct these errors by allowing you to combine several classes into one. In the previous lesson, you ran your classification and reviewed the classification report. To improve your classification, you begin by assessing the accuracy of your results. Accuracy is a measure of the agreement between a standard that is assumed to be correct, and an image classification of unknown quality. The classification accuracy increases as it approaches the standard. Class Editing In this lesson you will combine several classes into one after you have edited your classification using the Focus editing tools. Like the aggregation process, class editing combines several classes into one. However, instead of combining classes throughout the image, you will combine the classes for all pixels under a bitmap mask. Note Using class editing does not affect the statistics of classes or alter the classification report. It simply combines classes visually. Learning PCI Geomatica - Module 4: Image Classification with Focus PCI Geomatics 145 To begin this lesson, you will initialize post-classification editing before drawing a bitmap mask over the image areas you wish to edit. To initialize post-classification editing: 1. In the Maps tree, right-click the Classification MetaLayer. 2. In the shortcut menu, open the Post-classification Analysis submenu and select Class Editing. The Class Editing panel opens. Figure 4.35 Class Editing panel 3. In the Image menu, click the Select Classified Image command. The Select Classified Image dialog box opens. Lesson 4.7 Post-Classification Analysis - Supervised 146 PCI Geomatics Figure 4.36 Select Classified Image dialog box 4. If necessary, scroll down the Database Channels list and, click 10 [8u]: Maximum Likelihood Classification (with NULL class). This is the channel you selected for output when you initialized the classification procedure. 5. Click Accept. The Class Editing panel now shows a class table associated with the supervised result in the Source Classes and the Destination Classes sections. 6. In the Image menu, click the Select Reference Image command. The Select Reference Image dialog box opens. Figure 4.37 Select Reference Image dialog box 7. In the Select Reference image list, locate and select the three channels you wish to display as a reference image. As you click each channel in the Select Reference Image panel, the channel number is added to the R, G, and B boxes, below the Database Channels list. 8. Click Accept. The RGB composite appears in the Focus viewer. 9. In the Visible Image list, click Classified. The classification image appears in the View Area and the Focus Raster Editing toolbar is enabled. Learning PCI Geomatica - Module 4: Image Classification with Focus PCI Geomatics 147 Masking an Image Area The area under the mask defines the location where classes are combined into a particular class. If you choose the Over Entire File option, all of the classes in the image are combined and the mask is not used in the editing process. Now that you have selected your reference image you can prepare to draw your bitmap mask. Masking an image area is similar to creating a training site. First, you will need to set up Focus to draw a mask. To create your bitmap mask: 1. In the Class Editing panel, open the Mask menu. 2. Click the Create Mask from new Bitmap option. A new bitmap layer is added to the Focus Maps tree. 3. In the Class Editing panel, set the Mask Properties to Opaque. 4. On the Focus Editing Toolbar, click the arrow to the right of the New Shapes button. 5. In the drop-down list, click New Polygon. 6. Draw a polygon over the part of the image you want to mask. Figure 4.38 Class Editing mask Lesson 4.7 Post-Classification Analysis - Supervised 148 PCI Geomatics Tip You may wish to use more than one mask to cover all of the image areas you wish to edit. To merge classes under the mask: 1. In the Class Editing dialog box, below the list of Source Classes, click Select All. All of the Source Classes and the Null class are selected. 2. For the Destination Classes, make sure the Null Class is selected. This will merge all the Source Classes into the Null class. Figure 4.39 Class Editing Panel with classes selected 3. Click the Merge Classes command. All crop pixels under the bitmap mask are reassigned to the Null class. 4. In the View area of the Class Editing dialog box, click the Clear Mask command. The mask is removed and the Null class is shown where the bitmap mask was drawn. Learning PCI Geomatica - Module 4: Image Classification with Focus PCI Geomatics 149 In this lesson you: ? Initialized post-classification editing ? Set up a bitmap mask ? Drew a bitmap mask over your classified imagery ? Merged classes into a null class Lesson 4.7 Post-Classification Analysis - Supervised 150 PCI Geomatics PCI Geomatics 151 Module 5 Using Focus Algorithms Module 5 has Three Lessons: Lesson 5.1 Creating Image Subsets Lesson 5.2 Generating a Pan-sharpened Image Lesson 5.3 Generating a Perspective Scene Algorithms in Focus Many processes, found in other PCI Geomatics applications, are available to you through the Focus work environment. Focus is equipped with dozens of process algorithms ranging from an Adaptive PCT Maker (ADAPT) to an algorithm that can process watersheds from elevation data (WTRSHED). This module provides an example of how to extend your image processing capabilities, using the Algorithm Librarian in the Focus work area, without running a second application. Your goal in this module is to fuse a low-resolution color image with a high-resolution panchromatic image resulting in a high-resolution color image. First, you will create two image subsets. Then, you will fuse the subset images to create a high-resolution color image. In the last lesson, you will create a perspective scene. Some algorithms may not be licensed for use with the Geomatica license you have purchased. Algorithms in the Algorithm Librarian that have a lock icon to the left of the algorithm name are not available. Please contact PCI Geomatics for more information on your license package and for advice on the best Geomatica license for your needs. Lesson 5.1 Creating Image Subsets 152 PCI Geomatics Lesson 5.1 Creating Image Subsets In this lesson you will: ? Create subset files from larger images ? Set the details of your subsets in the Clipping/Subsetting panel ? Save your subsets as new image files Creating Subset Files Clipping and subsetting data are effective methods working with large data sets. In research and testing situations, you may want to create subsets of a large data base. By working with small representative areas, you can reduce processing times or you can use your file subsets to test an image process. When you obtain a promising result on a subset, you can repeat the process on your larger, more complex scene. Make sure Focus is open on your system desktop. If you do not see the Focus work area, click the Focus command on the Geomatica toolbar. You will create your first subset image from the l7_ms.pix file located in the demo folder. To create your first subset: 1. From the File pull-down menu, click Open. The File Selection window opens. 2. In the Geomatica program files, locate and open the demo folder. 3. In the demo folder click l7_ms.pix. 4. Click Open. A color image opens in the Focus view area and the file contents appear in the Focus Maps tree. Learning PCI Geomatica - Module 5: Using Focus Algorithms PCI Geomatics 153 Figure 5.1 l7_ms.pix image 5. On the Focus menu bar, click Tools. 6. From the pull-down menu, select Clipping/Subsetting. Figure 5.2 Accessing Clipping/ Subsetting from the Tools Menu The Clipping/Subsetting panel opens. Lesson 5.1 Creating Image Subsets 154 PCI Geomatics Figure 5.3 Clipping/Subsetting panel In addition to defining the portion of your image to include in your subset, you will use the Clipping/Subsetting panel to designate the input file and to select an output file for your subset. To select the input and output files: 1. In the Input section of the Clipping/Subsetting File panel, make sure the l7_ms.pix file is selected. 2. From the list of Available Layers, select the six original TM bands. 3. In the Output File section of the Clipping/Subsetting File panel, type l7_ms_sub.pix. By default, the new file will be located in the user folder if a path is not specified. Tip To specify a specific path for your new file, click on Browse and navigate to another folder. Learning PCI Geomatica - Module 5: Using Focus Algorithms PCI Geomatics 155 Your new subimage has now been assigned a destination folder and file name. Next, you will define the size of l7_ms_sub.pix. To define the size of your subset file you use the controls and text boxes in the Define Clip Region portion of the Clipping/Subsetting panel. There are four methods for defining a clip region: User-entered Co- ordinates, Select a File, Select a Clip Layer, and Select a Named Region. For your first subimage, you will use User-entered Co-ordinates to define the area for your subset. To define the Clip Region: 1. For the Definition Method, choose User-entered Co-ordinates. 2. For the Co-ordinate Type, select Raster extents. 3. In the Upper Left Pixel text box, double-click and type 200. 4. In the Upper Left Line text box, double-click and type 500. 5. In the Lower Right Pixel text box double click and type 1224. 6. In the Lower Right Line text box, double-click and type 1524. As you enter the dimensions of your subset, Focus constructs a bounding box in the preview window showing the location and size of the subset image. Figure 5.4 Clip Region for l7_ms.pix Lesson 5.1 Creating Image Subsets 156 PCI Geomatics Now that you have defined the input and output files, the file layers, and the dimensions of the subset, you can create the l7_ms_sub.pix file. 7. At the bottom of the Clipping/Subsetting panel, click Apply. A progress monitor opens indicating Focus is creating a subset of l7_ms.pix according to your specifications. Creating a Second Subset File Now that you have worked through the procedure for creating a subset file, you can move on to create a second subset image from the l7_pan.pix file also located in the demo folder. You will need the second subset file to fuse with the l7_ms_sub.pix file later in this module. Note It is not necessary to open and load the file you want to subset before subsetting the image. You can go directly to Subset by clicking on File in the Focus menu bar and selecting Subset from the Utility submenu. To select the input and output files: 1. In the Input section of the Clipping/Subsetting panel, click Browse. 2. From the demo folder, select and open l7_pan.pix. The list of available layers is updated and the panchromatic data is displayed. 3. From the list of Available Layers, select the Panchromatic Band. 4. In the Output File section of the Clipping/Subsetting File panel, type l7_pan_sub.pix. By default, the new file will be located in the user folder if a path is not specified. Tip To specify a specific path for your new file, click on Browse and navigate to another folder. Learning PCI Geomatica - Module 5: Using Focus Algorithms PCI Geomatics 157 Your second subimage has now been assigned a destination folder and file name. Next, you will use Select a File to define the area for your l7_pan_sub.pix subset. To define the Clip Region: 1. For the Definition Method, choose Select a File. 2. Beside the File selection text box, click Browse. A File Selector window opens. Figure 5.5 File Selector Window 3. Navigate to the user folder and select l7_ms_sub.pix. Your panchromatic subset file will be based on the dimensions of the multispectral subset you just created. Focus constructs a bounding box in the preview window showing the location and size of the subset image. Lesson 5.1 Creating Image Subsets 158 PCI Geomatics Figure 5.6 Clip Region for l7_pan.pix Now that you have defined the input and output files, the file layers, and the dimensions of the subset, you can create the l7_pan_sub.pix file. 4. At the bottom of the Clipping/Subsetting panel, click Apply. A progress monitor opens indicating Focus is creating a subset of l7_pan.pix according to your specifications. In this lesson you: ? Created two subset files from larger images ? Set the details of your subsets in the Clipping/Subsetting panel ? Saved your subsets as new image files Learning PCI Geomatica - Module 5: Using Focus Algorithms PCI Geomatics 159 Lesson 5.2 Generating a Pan-sharpened Image In this lesson you will: ? Access the Algorithm Librarian ? Setup and use the PANSHARP Algorithm Algorithm Librarian The Focus Algorithm Librarian contains over 200 algorithms. Like the File trees in the Focus work area, the Algorithm Librarian lists algorithms in a tree of folders. The folders are organized by algorithm category. Some category folders contain a subcategory of algorithms. Each algorithm has a Module Control Panel (MCP) where you control your data by assigning the required information for the results you want. You open an algorithm MCP by double-clicking the algorithm in the librarian list or by right-clicking the algorithm and choosing Open from the shortcut menu. The Algorithm MCP is linked directly to the data you have open in Focus. The data listed in the MCP are the same as the data open in your current Focus project. Some algorithms work only on a single layer but in most cases algorithms can use most or all of the files and layers from your Focus project. In this lesson, you will use the subset files created in the previous lesson. Because the MCP is linked to the data in your project, you will remove the original files from which your subsets were created. This is helpful in this lesson to simplify the selection of bands when setting up the pan-sharpening algorithm. To remove files from your project: 1. In the Focus viewer, open the Files tree. 2. In the Files tree, right-click the l7_ms.pix file. The shortcut menu opens. 3. From the shortcut menu, select Remove. Lesson 5.2 Generating a Pan-sharpened Image 160 PCI Geomatics Figure 5.7 Remove File from Project The l7_ms.pix file is removed from your project, but is still saved on your harddisk. 4. Repeat these steps to also remove the l7_pan.pix file. PANSHARP The PANSHARP algorithm is used to fuse a high-resolution panchromatic image with a multispectral image, creating a high-resolution color image. This technique is often referred to as pan-sharpening. PANSHARP works with 8-bit, 16-bit or 32-bit real data and can fuse images acquired simultaneously by the same sensor or use images from different sensors. You will now access the Algorithm Librarian to apply the PANSHARP algorithm to the l7_ms_sub.pix and l7_pan_sub.pix files which should be open in your Focus viewer. Note If you have data selected in the Files tree, the Algorithm Librarian opens in special mode. The check mark beside a folder indicates that it contains algorithms you can use with the selected data type. Learning PCI Geomatica - Module 5: Using Focus Algorithms PCI Geomatics 161 To perform data fusion using PANSHARP: 1. From the Tools menu in the Focus viewer, select the Algorithm Librarian. A progress message indicates the Algorithm Librarian is starting and the Select Algorithm panel opens. Figure 5.8 Select Algorithm Panel 2. In the Select Algorithm panel, click the + beside the Image Processing folder. The tree expands to open a subcategory of folders. 3. In the Image Processing category click the + beside the Data Fusion folder. The tree expands again to show a list of algorithms. Lesson 5.2 Generating a Pan-sharpened Image 162 PCI Geomatics Figure 5.9 PANSHARP Algorithm in the Select Algorithm Panel 4. On the right side of the Select Algorithm panel, use the scroll bar to scroll down the list until you see the PANSHARP Algorithm. 5. Double-click the PANSHARP algorithm. The PANSHARP Module Control Panel opens. Figure 5.10 PANSHARP Module Control Panel Learning PCI Geomatica - Module 5: Using Focus Algorithms PCI Geomatics 163 You use the Module Control Panel (MCP) to select imagery, set parameters, and read algorithm log notes. The Module Control Panel Input Ports window contains duplicates of the Focus Maps and Files trees. As you scroll through the list in the Input Ports window you will see the contents of the Maps tree followed by the contents of the Files tree. The PANSHARP fusion algorithm has three input ports; the Input Multispectral Image Channels and the Panchromatic Image Channel, which are mandatory, and the Reference Image Channels, which is an optional input. You will now configure the input ports. To select the Input Multispectral Image Channels: 1. In the Module Control Panel, if necessary, click the Files tab. 2. In the Input Ports window, click the + to the left of the Input Multispectral Image Channels icon. The tree expands to show the Maps and Files trees. 3. To the left of Files, click the +. The Files tree expands to show the files associated with your project. 4. Click the + to the left of the l7_ms_sub.pix file. The list expands to show the available raster layers. 5. To select the Input Multispectral Image Channels, click inside the box to the left of all six bands of TM data. A check mark appears in each box. To select the Reference Image Channels: 1. In the Input Ports window, click the + to the left of the Reference Image Channels icon. The tree expands to show the Maps and Files trees. 2. To the left of Files, click the +. The Files tree expands to show the files associated with your project. 3. Click the + to the left of the l7_ms_sub.pix file. The list expands to show the available raster layers. 4. To select the Reference Image Channels, click inside the box to the left of TM Bands 2, 3, and 4. A check mark appears in each box. Lesson 5.2 Generating a Pan-sharpened Image 164 PCI Geomatics Note The Reference Image Channels used vary from sensor to sensor. The reference channels span the same wavelength response range as the panchromatic image layer specified for the InputPan input port. For Landsat, the recommended reference image layers are TM bands 2, 3, and 4. To select the Panchromatic Image Channel: 1. In the Input Ports window, click the + to the left of the Panchromatic Image Channel icon. The tree expands to show the Maps and Files trees. 2. To the left of Files, click the +. The Files tree expands to show the files associated with your project. 3. Click the + to the left of the l7_pan_sub.pix file. The list expands to show the available raster layers. 4. To select the Panchromatic Image Channel, click inside the box to the left of the Panchromatic Band. A check mark appears in the box. The input images have now been selected for the PANSHARP fusion algorithm. Next you will configure the output port. In the Output Ports section, the viewer option is selected by default. You will want to see the fused image after you have run the PANSHARP algorithm to compare it with the original images. Leave the Viewer option selected and move on to set your file output. To configure the Output Ports: 1. If necessary, click the + to the left of the Output: Pan Sharpened Image Channels icon. The tree expands to show Viewer and Untitled.pix as the available output options. For the current example, direct your output to both the viewer and to a PCIDSK output file. 2. In the Output Ports window, click inside the box to the left of Untitled.pix. A check mark appears in the box. Learning PCI Geomatica - Module 5: Using Focus Algorithms PCI Geomatics 165 Next, you will name the output file that will contain the sharpened image. 3. Click the Untitled.pix file name. The Untitled.pix file name is now highlighted in yellow. 4. Click the Untitled.pix file name again. You can now enter a new file name. 5. At the insertion point type pansharp.pix. If you do not specify a path, the file is saved in the user folder. Tip If you right-click on the Untitled.pix output option, you can Browse to a specific location to save your output file. Figure 5.11 PANSHARP Module Control Panel Input Ports 6. In the lower left of the Module Control Panel, click Run. Lesson 5.2 Generating a Pan-sharpened Image 166 PCI Geomatics A Progress Monitor opens on your desktop. When the algorithm has finished running, the progress monitor closes, the new image appears in the Focus viewer, and the new file contents are shown in the Maps tree. Figure 5.12 Pansharpened Result in Focus. You can switch back and forth between the fused and unfused images for a visual comparison by dragging the pansharp.pix file up and down in the Maps tree or by turning it on and off. Another way of comparing the images is by using the visualization tools explained in Lesson 1.4. In this lesson you: ? Accessed the Algorithm Librarian ? Setup and used the PANSHARP Algorithm Learning PCI Geomatica - Module 5: Using Focus Algorithms PCI Geomatics 167 Lesson 5.3 Generating a Perspective Scene In this lesson you will: ? Set up the PSGIMAG Algorithm ? Generate a 3D Perspective View ? View the 3D Perspective View 3-D Rendering with the Algorithm Librarian Under Image Processing in the Focus Algorithm Librarian, the 3-D Rendering subcategory includes four algorithms for rendering and viewing your data in three dimensions. The PSGIMAG (Image Perspective Scene Generation) algorithm creates a three dimensional perspective rendering using imagery and elevation data. This module is similar to PSG except that it can expand and interpolate foreground pixels and optionally overlay vectors. In this lesson you will use the pansharp.pix and dem.pix files to create a three dimensional perspective view of the area. First you will the DEM file, and then use the Algorithm Librarian to create the 3D perspective view. To open the DEM in Focus: 1. In the Focus File menu, click Open. The File Selection window opens. 2. In the Geomatica program files, locate and open the demo folder. 3. In the user folder click dem.pix. 4. Click Open. A grayscale DEM opens in the Focus viewer and the file contents appear in the Files tree. Lesson 5.3 Generating a Perspective Scene 168 PCI Geomatics Figure 5.13 DEM and PANSHARP Images in Focus To set up the PSGIMAG algorithm: 1. If necessary, from the Tools menu on the Focus menu bar, select the Algorithm Librarian. A progress message indicates the Algorithm Librarian is starting and then the Select Algorithm panel opens. 2. In the Select Algorithm panel, click the + beside the Image Processing folder. The tree expands to open a subcategory of folders. 3. In the Image Processing category click the + beside the 3-D Rendering folder. The tree expands again to show a list of algorithms. 4. In the 3-D Rendering subcategory, double-click the PSGIMAG algorithm. The PSGIMAG Module Control Panel opens. Learning PCI Geomatica - Module 5: Using Focus Algorithms PCI Geomatics 169 Figure 5.14 The PSGIMAG Module Control Panel Since the appropriate data (pansharp.pix and dem.pix) have been loaded into Focus, these files will appear in the Files tree list in the Input Ports window. To select the Input BW or RGB Layers: 1. In the Module Control Panel, if necessary, click the Files tab. 2. In the Input Ports window, click the + to the left of the Input BW or RGB Layer(s) icon. The tree expands to show the Maps and Files trees. 3. To the left of Files, click the +. The Files tree expands to show the files associated with your project. 4. Click the + to the left of the pansharp.pix file. The list expands to show the available raster layers. 5. To select the Input BW or RGB Layer(s), click inside the box to the left of the TM bands 1, 2 and 3. A check mark appears in each box. Lesson 5.3 Generating a Perspective Scene 170 PCI Geomatics To select the Elevation Layer: 1. In the Input Ports window, click the + to the left of the InputElevation: Elevation Layer icon. The tree expands to show the Maps and Files trees. 2. To the left of Files, click the +. The Files tree expands to show the files associated with your project. 3. Click the + to the left of the dem.pix file. The list expands to show the available raster layers. 4. To select the Elevation Layer, click inside the box to the left of the DEM layer. 5. A check mark appears in each box. Now that you have selected the input data, you can set the output for the perspective image. To configure the Output Ports: 1. If necessary, click the + to the left of the Output: Perspective Scene Layer icon. The tree expands to show Viewer and Untitled.pix as the available output options. For the current example, direct your output to both the viewer and to a PCIDSK output file. 2. Make sure the Viewer option is selected. 3. In the Output Ports window, click inside the box to the left of Untitled.pix. A check mark appears in the box. Next, you will name the output file that will contain the perspective image. 4. Click the Untitled.pix file name. The Untitled.pix file name is now highlighted in yellow. 5. Click the Untitled.pix file name again. You can now enter a new file name. 6. At the insertion point type psgimag.pix. If you do not specify a path, the file is saved in the user folder. Your 3-D rendering will now be saved as psgimag.pix. Before you run the PSGIMAG algorithm, you will set the input parameters. Learning PCI Geomatica - Module 5: Using Focus Algorithms PCI Geomatics 171 To set the input parameters: 1. In the PSGIMAG Module Control Panel, click the Input Params 1 tab. The Module Control Panel displays the Input Parameter controls. Figure 5.15 The PSGIMAG Input Params 1 Tab 2. Leave the Elevation parameter empty. 3. Set Background Colour to 0, 0, 220. This will produce a blue background. 4. Set Edge Colour to 128, 128, 128. This will set the sides of the perspective scene to grey. 5. Set Viewpoint to 860, 1090. This is your viewing position in the original image. 6. Set Height Above Surface to 20. You will be viewing from 20 meters above the ground. 7. Set Field of View to 45. 8. Set View Direction to 45. Lesson 5.3 Generating a Perspective Scene 172 PCI Geomatics You will be looking north-east in the image. 9. Set View Inclination to 30. You will be looking down 30 degrees from horizontal. 10. Set the Number of Front Pixels to 128. 11. Leave the Background Elevation Value empty. 12. In the lower left of the PSGIMAG Module Control Panel, click Run. A progress monitor appears while the PSGIMAG algorithm is running. When the Algorithm is completed, the Module Control Panel automatically displays the contents of the log tab. Figure 5.16 PSGIMAG Result In this lesson you: ? Set up the PSGIMAG Algorithm ? Generated a 3D Perspective View ? Viewed the 3D Perspective View PCI Geomatics 173 Module 6 Visual Scripting with PCI Modeler Module 6 has Three Lessons: Lesson 6.1 Introduction to Visual Scripting Lesson 6.2 Filtering Images and Creating Polygons Lesson 6.3 Scripting Multiple Images and Data Merges The Modeler Graphical Language In this module, you will use another Geomatica application with similarities to the Focus Algorithm Librarian, but with several unique features. PCI Modeler provides a powerful set of tools that arrange modular commands and algorithms together in a customized data flow. Graphical elements in Modeler are ordered like a command-line script, but there is neither a command-line nor a scripting language. Using the graphical objects, you build a script by linking configurable modules together in the Modeler workspace. When all the data requirements of your script are correct, you click the Run command on the Modeler toolbar. You can save your customized script using the file name extension .mod. Your MOD scripts can also be used to batch process any number of data files. Building your visual script is easy. You use your mouse to choose from dozens of modules in a library of algorithms. Modules have active parts called glyphs and ports that connect the modules together and direct the flow of your data. Processing parameters are controlled with panels and dialog boxes for each module in your script. The data flow for your work is shown graphically by pipes that connect your script from input through process and then to output. Before you build and run a script in Lessons 6.2 and 6.3, you will explore the Modeler interface and become familiar with the icons, glyphs, ports, and pipes that make up the Modeler graphical language. Lesson 6.1 Introduction to Visual Scripting 174 PCI Geomatics Lesson 6.1 Introduction to Visual Scripting In this lesson you will: ? Explore the Modeler workspace and the Module Librarian ? Build a simple script and review the graphical components In Module 5 you used the Algorithm Librarian in Geomatica Focus to fuse images and create a perspective scene. Modeler allows you to perform the same processes as the Focus algorithm librarian, but with the advantage of graphical tools and batch processing capabilities. Use this lesson to explore and to become familiar with the Modeler components and the techniques you will need to use in the lessons that follow. Exploring the Modeler Interface Although Modeler shares many of the Focus Algorithm Librarian features, it is a separate application. You use Modeler in a workspace independent of Focus and select graphical elements from the Module Librarian. Modeler also has its own, independent, image viewers. In this lesson you will explore the Modeler interface and become familiar with how to create and run a Modeler visual script.You start Modeler from the Geomatica toolbar. To start Modeler: ? On the Geomatica toolbar, click the Modeler icon. Figure 6.1 Geomatica toolbar Modeler command The Module Librarian and the Modeler workspace open on your desktop. Figure 6.2 shows the four areas of the Modeler workspace. Learning PCI Geomatica - Module 6: Visual Scripting with PCI Modeler PCI Geomatics 175 Figure 6.2 The Modeler workspace When you select a module from the Module Librarian, you click it once and drag the module from the Select Module window onto the Modeler workspace. You can use any number of modules as building blocks for your script. After you have placed the module onto the workspace you use the module glyphs and panels to configure the data flow for running your script. Like the Select Algorithm panel in Geomatica Focus, the Module Librarian organizes modules into categories and subcategories. After selecting the category and subcategory, you choose a module from the Select Module window. Figure 6.3 shows an import module in the Select Module window. Figure 6.3 IMPORT Module in the Module Librarian Menu Bar Toolbar Display Bar Workspace Lesson 6.1 Introduction to Visual Scripting 176 PCI Geomatics To use a module as a building block in your visual script: 1. In the Select Module window, click once on the module icon and drag it to the Modeler workspace. 2. Click again inside the workspace. The module appears in the workspace as a component of your script. Figure 6.4 shows an IMPORT module open in the Modeler workspace. Figure 6.4 IMPORT module in the Modeler workspace Data flow in a Modeler script follows the basic sequence of the processes you need to accomplish in your work. Every script you write begins with at least one module for data input and ends with at least one module for data output. You determine the input and the output and the operations that take place between these two basic types of modules. Figure 6.5 shows a simple Modeler script that you will build from the instructions that follow. Take some time now to practice dragging a module onto the Modeler workspace. Next, you will use several modules and connect them together to create a simple script. Learning PCI Geomatica - Module 6: Visual Scripting with PCI Modeler PCI Geomatics 177 Figure 6.5 A simple Modeler script The script in Figure 6.5 contains two IMPORT modules, an IMAGEADD module, a VIEWBW module, and an EXPORT module. This script imports two image files, combines them using the IMAGEADD algorithm, renders the new image to a viewer, and then exports the image data to a new file. Building a Visual Script You can select Modeler components and place them on the Modeler workspace in any order you wish but it is best to have a general idea of what it is you want to accomplish with your script before you build it. In this example, you will select all of the modules first and then configure them to run the script. To begin this exercise, make sure Modeler is running on your system desktop and both the Module Librarian and the Modeler workspace are visible. To add modules for a script: 1. In both the Categories and Subcategory windows of the Module Librarian, make sure ALL is selected. You can now access all available modules in the library through the Modules window. Lesson 6.1 Introduction to Visual Scripting 178 PCI Geomatics 2. In the Modules window use the scroll bar to locate the IMPORT module. Tip You can search for a module in the Module Librarian. In the lower part of the Module Librarian, click in the Search box. At the insertion point, type the name of the module you are looking for. In the lower left of the Module Librarian, click Search. Your module is shown in the Modules list and in the Selected Module window. 3. In the Modules list, click IMPORT. The IMPORT module appears in the Selected Module window, to the right of the Modules list. 4. In the Selected Module window, click once on the IMPORT icon. 5. Move your mouse pointer to the Modeler workspace. Your mouse pointer changes to a cross bounded by a grey rectangle. 6. Click inside the Modeler workspace. A new IMPORT module opens in the Modeler workspace. 7. Repeat steps 4 through 6 to place a second IMPORT module onto the workspace. Adding Modules Using two IMPORT modules allows you to import data into your script from two sources at the same time. In this lesson you will import two different image layers from the same file. Then you will place an IMAGEADD module onto the Modeler workspace. This module adds raster data to your output. To add more modules: 1. If necessary, in both the Categories and Subcategories windows of the Module Librarian, click ALL. 2. In the Modules window, use the scroll bar to locate the IMAGEADD module or use the search feature and search for IMAGEADD. 3. In the Selected Module window, click once on the IMAGEADD icon. 4. Click inside the Modeler workspace. A new IMPORT module opens in the Modeler workspace. Learning PCI Geomatica - Module 6: Visual Scripting with PCI Modeler PCI Geomatics 179 Tip You can quickly add modules to the Modeler workspace through the module shortcut menu. Right-click on a module already in the Modeler workspace. In the module shortcut menu, click Duplicate. A copy of the module is now ready to be added to the workspace. Move your mouse pointer away from the module and click again inside the Modeler workspace. The duplicate module is added. You have added two modules for data input and one module for data processing. You can now go ahead and add two modules for data output. If you are having trouble adding modules, ask your instructor for help. To add the remaining modules: 1. In the Modules window, use the scroll bar to locate the VIEWBW module. 2. In the Modules list, click VIEWBW. 3. In the Selected Module window, click the VIEWBW icon. 4. Click inside the Modeler workspace. A new VIEWBW module opens. 5. Repeat steps 1 through 4 again, this time locating, selecting, and adding the EXPORT module to the workspace. With all five modules now added, you can organize the workspace to improve the arrangement of icons. To move a module in the Modeler workspace: ? Click the module icon and drag it to a new position. Lesson 6.1 Introduction to Visual Scripting 180 PCI Geomatics Figure 6.6 Moving a module in the workspace. Tip Modules do not have to be in exact positions and you can move them at any time. It is best to keep your modules in a tidy arrangement especially in complex scripts. If necessary, rearrange your modules in the workspace. When you are satisfied with the general location of each of the modules, you will move on to configure your script beginning with the two IMPORT modules. To configure an IMPORT Module: 1. In the upper left of the workspace, double-click the IMPORT module icon. The IMPORT Module Control Panel opens. Learning PCI Geomatica - Module 6: Visual Scripting with PCI Modeler PCI Geomatics 181 Figure 6.7 IMPORT module control panel 2. Under the IMPORT Params 1 tab, below the File name caption, click the Select command. A Select File window opens. 3. Locate the demo data folder and click the irvine.pix file. 4. Click Open. The Select File window closes. A list of options is added below the Select box, and the contents of the irvine.pix file is listed in the Data Types window of the control panel. In the Available data types section, the ALL option is selected by default listing all of the available data types in the irvine.pix file. You will select only one layer from the irvine.pix file for this import module. Lesson 6.1 Introduction to Visual Scripting 182 PCI Geomatics To select a layer for import: 1. If necessary, in the IMPORT Module Control Panel, use the scroll box beside the Select Data Layers for Import list and locate the 1[8u]: 0.485um +/- 0.035um TM band 1: blue-green layer. 2. In the layer list, click the 1[8u]: 0.485um +/- 0.035um TM band 1: blue-green layer. The layer appears in the lower window indicating it is selected for import. 3. In the lower right of the IMPORT Module Control Panel click Accept. The IMPORT Module Control Panel closes. A port glyph and a green status bar open on the IMPORT module to indicate the import module is now active. Compare the two import modules shown in Figure 6.8 below. The upper import module shows the new port glyph and green status bar, indicating this module is now active. Figure 6.8 An active import module There are several features in Modeler and the Module Control Panel that can make your work faster and easier. You will use some or these features now when you configure the second IMPORT module. Learning PCI Geomatica - Module 6: Visual Scripting with PCI Modeler PCI Geomatics 183 To configure another IMPORT Module: 1. In the Modeler workspace, double-click the second IMPORT module icon. The IMPORT module control panel opens. 2. Once again, under the Import Params 1 tab, below the Filename caption, click the Select command. A Select File window opens. 3. Locate the demo data folder and click the irvine.pix file. 4. Click Open. The Select File window closes. A list of options is added below the Select box, and the contents of the irvine.pix file is listed in the Data Types window of the control panel. Tip You already know that PIX files can have many layers of information and many different data types together in the same file. The Module Control Panel has several options to group the data in a PIX file. Recall from the first IMPORT module that, in the list of available data types, the ALL option is selected by default. You can use the other options in this part of the Module Control Panel to group the data types that interest you. In this lesson you will use a USGS Land Use/Land Cover raster layer as one of the input data types in your script. 5. In the Input Module Control Panel, under available data types, choose the Raster option. This groups the PIX file contents by type to show only the raster data in the irvine.pix file. 6. If necessary, scroll down the list of raster layers. Click the 6[8u]: USGS Land Use/Land Cover layer. The layer appears in the lower window indicating it is selected for import. 7. In the lower left of the IMPORT Module Control Panel click Accept. The IMPORT Module Control Panel closes. A port glyph and a green status bar open on the second IMPORT module. Lesson 6.1 Introduction to Visual Scripting 184 PCI Geomatics Tip You can also configure a second IMPORT module using a shortcut command. After you configure an IMPORT module, right-click the module icon and choose Duplicate from the shortcut menu. The duplicate command copies the information to a new IMPORT module. Click again in the Modeler workspace. When you configure the new module, you need to change the selected layer only. Figure 6.9 The Module Control Panel Learning PCI Geomatica - Module 6: Visual Scripting with PCI Modeler PCI Geomatics 185 Reading Modeler Pipes Pipes that connect modules together can appear fat or thin. A pipe that appears slightly wider than others contains multiple layers of information. Thin pipes contain only one layer. Pipes also have different colors that help you differentiate the type of data passing form one algorithm to another in your visual script. The table below shows pipe colors and the data types they represent. Connecting Modules Now that both import modules are active you can go ahead and connect them to the IMAGEADD module. To connect modules: 1. On the right side of the IMPORT module, click the port glyph. Note When you pass your mouse over a port glyph, it changes to an arrow indicating the data flow direction. A ToolTip shows the name of the port. Next, you will connect the IMPORT Module to the IMAGEADD module. 2. On the IMAGEADD module click the red-colored Raster port glyph. The Raster port glyph changes to green and a pipe opens connecting the IMPORT module to the IMAGEADD module. Table 1 Pipe Colors and Data Types Pipe Color Data Type Cyan Statistical Array Dark Blue ASCII segment Yellow LUT Segment Red Bitmaps Grey Vectors Green Rasters Black No Data Lesson 6.1 Introduction to Visual Scripting 186 PCI Geomatics Figure 6.10 IMPORT and IMAGEADD modules connected. 3. Repeat steps 1 and 2 to connect the second IMPORT module to the IMAGEADD module. Now that both import modules are connected to the IMAGEADD module, you can move on to connect the EXPORT and VIEWBW modules to your script. First you will connect the EXPORT module to the IMAGEADD module and set the destination folder and file name for the output of this script. To set the EXPORT module: 1. Double-click the EXPORT module icon. The Export Module Control Panel opens. 2. On the Export Module Control Panel, click Select. The Select File panel opens. Note You can save the output of your script to an existing pix file, or to a new file. 3. At the insertion point type simple_example.pix. 4. Click Open. The Select File panel closes and the path for your output appears in the Filename text box on the Export Module Control Panel. 5. In the lower left of the control panel click Accept. Learning PCI Geomatica - Module 6: Visual Scripting with PCI Modeler PCI Geomatics 187 The control panel closes and the export module is ready to use in your script. Next you will connect the IMAGEADD module to the EXPORT module. To connect the EXPORT module: 1. On the IMAGEADD module, click the Raster port glyph. Both IMPORT modules and the ports on the VIEWBW module are unavailable. 2. On the EXPORT module, click the port glyph. A pipe opens in the workspace to connect the IMAGEADD module to the EXPORT module. Next, you will include the VIEWBW module in your script. Rotating Modules The orientation of the VIEWBW module, in the Modeler workspace, is awkward for connecting it to the IMAGEADD module. You will use the workspace toolbar to rotate the module for better orientation. To rotate the VIEWBW module: 1. In the workspace, click the VIEWBW module icon. The VIEWBW module is highlighted in blue. 2. On the workspace toolbar, click the Rotate command. Lesson 6.1 Introduction to Visual Scripting 188 PCI Geomatics Figure 6.11 Rotate command on the workspace toolbar The VIEWBW module is rotated to a new orientation with the glyph ports on top. Now you can connect the VIEWBW module to include it in your script. To connect the VIEWBW module: 1. Click the pipe joining the IMAGEADD module to the EXPORT module. The pipe is highlighted in blue. 2. On the VIEWBW module, click the red colored input port glyph. The input glyph changes to green and a pipe now joins the VIEWBW module to the pipe between the IMAGEADD module and the EXPORT module. Learning PCI Geomatica - Module 6: Visual Scripting with PCI Modeler PCI Geomatics 189 Figure 6.12 VIEWBW module connected You are now ready to run your script. To run a Modeler visual script: 1. On the workspace toolbar, click the Run Model icon. Figure 6.13 The Run Model command Lesson 6.1 Introduction to Visual Scripting 190 PCI Geomatics The progress indicators on the Modules in the workspace show the progress of each operation as it is performed. Another progress indicator in the display bar monitors the progress of the entire script. Figure 6.14 Modeler Progress indicators Saving Modeler Scripts Now that you have created your first Visual script with Modeler you will save the script as a MOD file. To save your Modeler script: 1. In the workspace toolbar, click the Save Model command. The Save Model As dialog box opens. 2. When you have selected a folder for your MOD file, click in the File name box. 3. At the insertion point type First_script.mod. 4. Click Save. The Save Model As dialog box closes and your Modeler visual script is saved as a MOD file. Learning PCI Geomatica - Module 6: Visual Scripting with PCI Modeler PCI Geomatics 191 In this lesson you: ? Explored the Modeler workspace and the Module Librarian ? Added modules to the workspace and connected them to create a simple script ? Setup input and output modules and directed your data to both a viewer and a data file ? Saved your script as a MOD file Now that you are familiar with the Module Librarian and the Modeler workspace, you can move on to use some of the other models available for visual scripts in PCI Modeler. In the next lesson you will see how Modeler can be used to process classified imagery using more than one processing module. Lesson 6.2 Filtering Images and Creating Polygons 192 PCI Geomatics Lesson 6.2 Filtering Images and Creating Polygons In this lesson you will: ? Build and run a Modeler script to enhance classified imagery ? Include a Mode Filter module (FMO) to generalize a classified image ? Configure a Raster-to-Vector (RTV) module and add a polygon layer Extending the power of Geomatica with Modeler Modeler can be used to extend the power of Geomatica to process classified imagery. In the previous lesson you arranged modules into a visual script. You saw how easy it is to create and run a script that can perform several functions at once. In this lesson you will build and run a Modeler script to extend the usefulness of classified image data. There are hundreds of ways to make your imagery more useful and easier to interpret with PCI Modeler. Classified data often contains complex mixes of pixels (mixels) that can make images difficult to interpret. After performing a classification on an image, you can create vector polygons to group adjoining pixels that were assigned to a feature or a class during the classification. Creating polygons for classified imagery requires some pre-processing. Before creating your polygons, you will need to generalize your classification output to remove the extraneous classes and clean up your output map. Your visual script will use the FMO mode filter module to filter the classified image and then a Raster-to-Vector (RTV) module to generate a vector polygon layer. The last stage of your visual script demonstrates how the PCI GeoGateway technology in Modeler lets you save your output in a different file format. You will configure an export module to save your output as an SHP file. In Modeler, you can run both the FMO and RTV algorithms in one script. You also have the options of single-execution or batch mode. This lesson uses the single-execution mode. Learning PCI Geomatica - Module 6: Visual Scripting with PCI Modeler PCI Geomatics 193 To begin this lesson, Modeler should be running on your system desktop. The Modeler script for this lesson uses a total of six modules from the Module Librarian. First, you will add two IMPORT modules to the Modeler workspace. The first IMPORT module imports the classified image data into your model. The second IMPORT module adds the RGB channels from your input data directly to a viewer, providing a background image for your vector polygons. After adding the import modules you will add an FMO and an RTV module. Finally, you will add an EXPORT module and a VIEWRGB module before configuring each module and running your visual script. In addition to the Module Librarian, Modeler provides a shortcut menu in the Modeler workspace for adding the modules you use most often. To add your input modules: 1. Right-click anywhere in the Modeler workspace. A shortcut menu opens. 2. In the Common Modules submenu, click Import. Figure 6.15 Shortcut menu in the Modeler workspace Lesson 6.2 Filtering Images and Creating Polygons 194 PCI Geomatics The submenu closes and a new IMPORT module is ready to be added to the Modeler workspace. 3. Click in the Modeler workspace. A new IMPORT module opens. 4. Repeat steps 1 through 3 to add a second IMPORT module. Next, you will add the FMO and RTV modules to your workspace. To add the FMO and RTV modules: 1. On the Module Librarian, click in the Search box. 2. At the insertion point type FMO. 3. Click Search. The FMO module is shown in the selected modules window. 4. Click the FMO module and add it to your workspace. 5. Repeat steps 1 through 4 to add the RTV module. This time, in step 2, at the insertion point type RTV. Next, you will use the shortcut menu again to add an EXPORT module and a VIEWRGB module. To add the remaining modules: 1. Right-click anywhere in the Modeler workspace. The shortcut menu opens. 2. In the Common Modules submenu, click Export. The submenu closes and a new EXPORT module is ready top be added. 3. Click in the Modeler workspace. A new EXPORT module opens. 4. Repeat steps 1 through 3 to add a VIEWRGB module. This time, in step 2, click VIEWRGB. Learning PCI Geomatica - Module 6: Visual Scripting with PCI Modeler PCI Geomatics 195 Tip Arrange your modules like Figure 6.16 with the two IMPORT modules on the left, the EXPORT and VIEWRGB modules on the right, and the FMO and RTV modules in the middle. If necessary, click and drag a corner of the Modeler workspace to give yourself more room for placing modules. Figure 6.16 Modules ready to configure Configuring Data Input and Output With all six modules open in the Modeler workspace you are now ready to begin configuring your script. You will start with the first IMPORT module to import the classified image data. To import the classified data: 1. Double-click the IMPORT module in the upper left of the Modeler workspace. The IMPORT Module Control Panel opens. 2. Make sure the Import Params 1 tab is showing. 3. In the upper left of the IMPORT Module Control Panel, under the Import Params 1 tab, click Select. 4. In the Select File window, open the demo file folder and select the irvine.pix file. Lesson 6.2 Filtering Images and Creating Polygons 196 PCI Geomatics 5. Click Open. The contents of irvine.pix file are listed in the upper window of the IMPORT Module Control Panel. Figure 6.17 The IMPORT MCP showing irvine.pix 6. In the upper window, click the 7 [8u]: Supervised Classification Results layer. The 7 [8u]: Supervised Classification Results layer is shown in the lower window of the IMPORT Module Control Panel. 7. In the lower left, click Accept. You have now setup your IMPORT module to import the classified image data. Next, you will move on to configure the FMO module. Learning PCI Geomatica - Module 6: Visual Scripting with PCI Modeler PCI Geomatics 197 To configure the FMO module 1. In the Modeler workspace, double-click the FMO module. The FMO module Control Panel opens. Figure 6.18 FMO module Control Panel 2. Make sure the Input Params 1 tab is selected. 3. Open the Filter X size (Pixels) list. 4. Click 7. 5. Repeat steps 3 and 4 for Filter Y size (Pixels). The size of your filter window is now 7 pixels by 7 pixels. 6. Open the Thin Line Preservation list and click OFF. For this lesson, you will not need to exclude any values or change any of the port settings. 7. Click Accept. Your mode filter is now configured. Next, you will configure your Raster-To-Vector (RTV) module. Lesson 6.2 Filtering Images and Creating Polygons 198 PCI Geomatics To configure the RTV Module: 1. Double-click the RTV module. The RTV Module Control Panel opens. Figure 6.19 RTV Module Control Panel 2. Make sure the Input Params 1 tab is selected. 3. Select Lines from the pull-down list beside Polygon Info. This will generate lines bounding each area. 4. Open the Border Vectors list and select On. 5. Enter RTV in the Vector Layer Name text box. You can also enter a description in the Vector Layer Description text box. Now that you have set up your RTV and FMO modules, you will move on to configure the EXPORT module. But first you need to connect the IMPORT, FMO, RTV, and EXPORT modules. To connect your Modules: 1. On the upper right of the first IMPORT Module, click the OutputRaster1 node. The IMPORT module is highlighted in blue. 2. On the left side of the FMO module, click the Unfiltered Layer node. A green pipe is added to join the OutputRaster1 node to the Unfiltered Layer node. 3. On the right side of the FMO module, click the Filtered Layer node. The FMO module is highlighted in blue. 4. On the left side of the RTV Module, click the Raster Layer node. Learning PCI Geomatica - Module 6: Visual Scripting with PCI Modeler PCI Geomatics 199 A green pipe is added to join the Filtered Layer node to the Raster Layer node. 5. On the right side of the RTV layer, click the Vector Layer node. The Vector Layer node is highlighted in blue. 6. On the left side of the Export Module click the InputVector1 node. A Gray pipe opens to join the RTV module to the EXPORT module. Figure 6.20 Connected modules You will now configure the EXPORT module so that you can save your output in a new file format using the EXPORT Module Control Panel. To configure your Modeler output: 1. Double-click the EXPORT module. The EXPORT Module Control Panel opens. 2. Click in the Select command. A Select File window opens. 3. Locate the folder where you want to save your work files. 4. In the lower middle of the File Select window, click in the File name box. You will use the ArcView Shape file name extension .shp when you name your file. 5. At the insertion point type polygons.shp. Lesson 6.2 Filtering Images and Creating Polygons 200 PCI Geomatics 6. Click Open. The Select File window closes and the EXPORT Module Control Panel shows the destination of your output data. Next, you will configure your output file format on the EXPORT Module Control Panel. To configure your output format: 1. On the EXPORT Module Control Panel, click the arrow to the right of the Output Format box. The Output Format list opens. 2. Using the scroll bar, scroll down the list to SHP ArcView Shape file. 3. Click SHP ArcView Shape file. Figure 6.21 Export Module Control Panel showing setup for SHP format output Your output will now be saved as an ArcView Shape file. 4. In the lower left of the EXPORT Module Control Panel, click Accept. Your visual script is now ready to be run on your source data. Your output will be created in the file format you have just specified. Learning PCI Geomatica - Module 6: Visual Scripting with PCI Modeler PCI Geomatics 201 Configuring Visual Input and Output Modeler is very flexible for viewing and saving your results. You could run this model now and view the SHP file output afterwards or you could configure a viewer to see the vector output. In this lesson, you will use the RGB channels from the irvine.pix file to produce a color image layer so that your vector output will be displayed over the irvine.pix image. The result will give you a visual reference for the classified imagery and your vector output. First, you will set up the second IMPORT module to use only the RGB Layers from the irvine.pix file. You will then connect the IMPORT module to the VIEWRGB module. Finally, you will direct the RTV module output also adding it to the VIEWRGB module. When you run your script the viewer shows the vector polygons over the irvine.pix imagery. To set up the IMPORT module for your viewer: 1. Double-click the second IMPORT module. The IMPORT Module Control Panel opens. 2. In the upper left of the IMPORT Module Control Panel, click the Filename Select command. A Select File window opens. 3. In the Select File window open the demo file folder and click the irvine.pix file. 4. Click Open. The Select File window closes and the contents of the irvine.pix file are listed in the upper window of the IMPORT Module Control Panel. 5. In the irvine.pix list, click each of the first three channels. As you click each channel it is copied to a list in the lower window of the IMPORT Module Control Panel. Lesson 6.2 Filtering Images and Creating Polygons 202 PCI Geomatics Figure 6.22 The IMPORT Module Control Panel showing the contents of irvine.pix 6. In the lower-left of the IMPORT Module Control Panel, click Accept. To see the Irvine imagery and the new vectors together in the same viewer, you will need to connect the image data from both the IMPORT and RTV module outputs to the VIEWRGB module. You will do this now. To connect your visual output and run your script: 1. On the right side of the IMPORT module, click the OutputRaster1 node. 2. On the upper right of the VIEWRGB module, click the Input1 node. A green pipe opens to connect the modules. Your second IMPORT module is now set up to show the RGB channels of the irvine.pix file. You will now include the output from the RTV module. 3. Click the pipe connecting the RTV module to the EXPORT module. The pipe is highlighted in blue. 4. On the VIEWRGB module, click the InputVector1 node. Learning PCI Geomatica - Module 6: Visual Scripting with PCI Modeler PCI Geomatics 203 Figure 6.23 The InputVector1 node with selected pipe. A pipe opens connecting the output pipe from the RTV module to the VIEWRGB module. Your visual script is now complete and ready to run. Figure 6.24 shows the completed Modeler script. Figure 6.24 The completed Modeler visual script. 5. On the Modeler workspace, click the Run Model icon. Lesson 6.2 Filtering Images and Creating Polygons 204 PCI Geomatics The progress monitors show the progress of the script as it runs. A Modeler viewer opens with the irvine.pix imagery and the new vector polygons. Figure 6.25 The Irvine imagery and the new vector polygons. After running your visual script, bulges appear in the pipes between each module. The bulge indicates the data has passed through a module. You can view the cached data at each stage in a script for quick comparisons of your data. Next, you will view the irvine.pix data after the FMO filter is applied and before the RTV vectors are added. To view the FMO cached image data: 1. In the Modeler workspace, click the pipe connecting the FMO module to the RTV module to select it. The pipe is highlighted in blue. 2. Right-click the bulge in the pipe. 3. In the shortcut menu click 01112001.pix: [1] Contents Not Specified from the View Pipe Contents submenu. Learning PCI Geomatica - Module 6: Visual Scripting with PCI Modeler PCI Geomatics 205 Figure 6.26 The View Pipe submenu The irvine.pix image opens in a separate viewer with the FMO filter applied to it. Figure 6.27 irvine.pix FMO Filtered Layer Lesson 6.2 Filtering Images and Creating Polygons 206 PCI Geomatics In this lesson you: ? Built and ran a Modeler script to enhance classified imagery ? Set up a Mode filter module (FMO) and generalized a classified image ? Configured a Raster-to-Vector (RTV) Module and added a polygon layer to your output ? Used the GeoGateway technology in Modeler to save your output as an ArcView Shape file ? Viewed the cached data in your script in an image viewer In the next lesson, you will see how complex scripts can be built in Modeler that use multiple inputs and merge data to produce new images. Learning PCI Geomatica - Module 6: Visual Scripting with PCI Modeler PCI Geomatics 207 Lesson 6.3 Scripting Multiple Inputs and Data Merges In this lesson you will: ? Build a visual script that adds shaded relief to an image from a Digital Elevation Model ? Configure a REL module ? Use multiple inputs and merge image data using IMAGEADD and MERGE modules ? Compare processed images using two VIEWRGB modules Creating Complex Scripts In the previous lessons you used the basic features of Modeler to create simple but useful scripts. In this lesson you will build a more complex visual script that uses multiple inputs and outputs. The Shaded Relief from Elevation Data (REL) module uses an artificial light source, that you specify, to change an elevation layer (DEM) into a shaded relief image. The image produced by the REL module shows reflected light, emanating from a single light source like the sun. Shaded relief, applied to a color image, can reveal detail that is otherwise unclear or hidden.You can adjust several aspects of the relief image through the REL Module Control Panel. In this lesson you will compare an unprocessed color image to the same image with shaded relief. You will also see how flexible a Modeler visual script is by adding modules on your own. After building the shaded relief model you will alter the DEM scaling to view alternative renditions of the imagery. Figure 6.28 shows the complete shaded relief script you will build in this lesson. Lesson 6.3 Scripting Multiple Inputs and Data Merges 208 PCI Geomatics Figure 6.28 Completed Shaded Relief Script To begin this lesson close any of the models you have been working on. You should begin your work with an empty Modeler workspace. To close a Modeler script: ? In the File menu, click Close Model or press CTRL + C on your keyboard. Using the shortcut menu in the Modeler workspace and the Module Librarian, add all of the modules to the Modeler workspace and arrange them in the general pattern shown in Figure 6.28. Tip You can add modules to the Modeler workspace quickly with the module shortcut menu. Right-click a module in the Modeler workspace. In the module shortcut menu, click Duplicate. Add a duplicate of the module by moving your mouse pointer away from the module and clicking again. Learning PCI Geomatica - Module 6: Visual Scripting with PCI Modeler PCI Geomatics 209 Try using the module shortcut menu to add some of the IMPORT modules to your script. When you have added all of the modules listed in the table below, you can move on to configure your shaded relief script. Note It is not necessary to add all modules to the workspace before you begin. You can add the IMPORT modules first, and then the other modules as you need them. Like the polygons script in Lesson 6.2, the shaded relief script has two different image data inputs. You will use the first three IMPORT Modules to import RGB channels from a multispectral PCIDSK file in the demo data folder. You will configure the fourth IMPORT module to input a Digital Elevation Model (DEM) into the script. If you are starting with all of your modules in the workspace, make sure they are arranged like the example in Figure 6.28 with the IMPORT Modules on the left, the VIEWRGB modules on the right, and the other modules in between. If you are beginning with only the IMPORT modules, keep them to the right in the workspace. You will start by configuring three IMPORT modules. Table 2 : Modules Required for the Shaded Relief Script Module Name Number of Modules Open From IMAGEADD 3 Algorithm Librarian IMPORT 4 Shortcut Menu MERGE 2 Shortcut Menu REL 1 Algorithm Librarian VIEWRGB 2 Shortcut Menu Lesson 6.3 Scripting Multiple Inputs and Data Merges 210 PCI Geomatics To configure your RGB IMPORT modules: 1. In the upper-left of the workspace, double-click the first IMPORT module. The IMPORT Module Control Panel opens. 2. Make sure the Import Params 1 tab is showing. 3. In the upper left of the IMPORT Module Control Panel, under the Import Params 1 tab, click Select. 4. In the Select File window open the demo file folder and click the l7_ms.pix file. 5. Click Open. The contents of l7_ms.pix are listed in the upper window of the IMPORT Module Control Panel. 6. In the upper window, click the 1 [8u]: TM Band 1 layer. The 1 [8u]: TM Band 1 layer is shown in the lower window. 7. In the lower left of the IMPORT Module Control Panel, click Accept. 8. Repeat steps 1 through 7 for each of the next two modules. ? For the second IMPORT module, at step 6, click the 2 [8u]: TM Band 2 layer. ? For the third IMPORT module, at step 6, click the 3 [8u]: TM Band 3 layer. You should now have three IMPORT modules configured to import one TM Band each from the l7_ms.pix file. You need to provide each of the IMAGEADD modules with a color channel from the l7_ms.pix file and the scaled relief imagery from the DEM file. You will transfer the DEM data later, but first you will connect the three IMPORT modules to the three IMAGEADD Modules. Learning PCI Geomatica - Module 6: Visual Scripting with PCI Modeler PCI Geomatics 211 To connect the IMPORT modules to the IMAGEADD modules: 1. On the right side of the IMPORT Module, click the OutputRaster1 node. 2. On the left side of the IMAGEADD module, click the Input1 node. A green pipe is added to connect the modules together. 3. Repeat steps 1 and 2 for the second and third IMAGEADD modules. Now, set up the fourth IMPORT module to bring the Digital Elevation Model into your script. To import your DEM: 1. In the lower left of the workspace, double-click the last IMPORT module. The IMPORT Module Control Panel opens. 2. Make sure the Import Params 1 tab is showing. 3. In the upper left of the IMPORT Module Control Panel, under the Import Params 1 tab, click Select. 4. In the Select File window open the demo file folder and click the dem.pix file. 5. Click Open. The contents of dem.pix are listed in the upper window of the IMPORT Module Control Panel. 6. In the upper window, click the 1 [16s]: DEM layer. The 1 [16s]: DEM layer is shown in the lower window. 7. In the lower left of the IMPORT Module Control Panel, click Accept. With all of your IMPORT modules set up you can configure the REL module. Lesson 6.3 Scripting Multiple Inputs and Data Merges 212 PCI Geomatics To configure the REL module: 1. Double-click the REL module. The REL Module Control Panel opens. You can leave both of the Pixel and the Step Size Elevation numbers as they appear. For this exercise, change only the Azimuth and Elevation angles. Note Elevation azimuths are measured from 0o and 360o at zenith. 2. Click inside the Azimuth Angle of Light Source box. 3. At the insertion point type 90. You can also click the arrow to the right of the box and choose a number from the list. 4. Click inside the Elevation Angle of Light Source box. 5. At the insertion point type 60. 6. In the lower-left of the REL Module Control Panel, click Accept. The REL module closes. After you configure the REL module, you will direct the single output from the REL module to the second input of each IMAGEADD module. To add the REL output: 1. On the right side of the REL Module, click the Shaded Relief Layer(s) node. 2. On the left side of the IMAGEADD module, click the Input2 node. A green pipe now connects the modules together. 3. Repeat steps 1 and 2 for the second and third IMAGEADD modules, connecting the Input2 node on each IMAGEADD module. Next you will need to merge the combined outputs from each IMAGEADD module before directing your processed data to a viewer. The MERGE module combines/merges multiple pipe layers into a single pipe. Learning PCI Geomatica - Module 6: Visual Scripting with PCI Modeler PCI Geomatics 213 To merge the IMAGEADD outputs: 1. On the right side of an IMAGEADD module, click the Result1 node. 2. On the left side of the MERGE Module, click an Input1 node. A green pipe is added to connect the modules together. 3. Repeat steps 1 and 2 for the second and third IMAGEADD modules. Next, connect the output of the MERGE module to a VIEWRGB module. To connect the merged data to the VIEWRGB module: 1. On the right side of the MERGE module, click the Result1 node. 2. On the left side of the VIEWRGB module, click the Input1 node. A green pipe is added to connect the modules together. Your script should look similar to the example shown in Figure 6.29. Figure 6.29 Shaded Relief Script You could run this visual script now to produce a shaded relief image but you will need to add a second MERGE module and a second VIEWRGB module so that you can compare the shaded relief image with the unprocessed image. With Modeler you can tap into the data flow of a script and produce file output or image output at intermediate stages of the script. Lesson 6.3 Scripting Multiple Inputs and Data Merges 214 PCI Geomatics Next, you will merge the unprocessed channels and direct the output to a second viewer. To merge the unprocessed output: 1. In the upper left of the workspace, click the first pipe connecting the IMPORT Module to the IMAGEADD module. The pipe is highlighted in blue. 2. On the MERGE module, click the Input1 node. A new pipe is added connecting the IMPORT pipe to the MERGE module. 3. Repeat steps 1 and 2 for the second and third pipes that connect the IMPORT modules with the IMAGEADD modules. 4. When all three pipes are connected to the MERGE module, connect the Result1 node of the MERGE module to the Input1 node of the VIEWRGB module. Your script should look similar to the example shown in Figure 6.30. Figure 6.30 Completed Shaded Relief Script You are now ready to run your shaded relief script. Learning PCI Geomatica - Module 6: Visual Scripting with PCI Modeler PCI Geomatics 215 To run your shaded relief script: ? In the Modeler Menu bar, click Run in the Execute Menu or click the Run Model icon on the workspace toolbar. Modeler simultaneously processes the data for both image outputs. You can see the data flow of your script as each module is activated in sequence. The display bar in the Modeler workspace shows the progress of the current process. When a complete series of script modules finishes, a viewer opens to show the result. In this case, the unprocessed l7_ms.pix image is first to open. When the REL process finishes, the l7_ms.pix image opens again in a second viewer with the shaded relief added. Take some time now to view and compare the two images. Note Modeler viewers open with a linear enhancement applied by default. You can change the detail in images by applying different enhancements from the viewer enhancements list. Tip Images zoom to the region shown inside the bounding outline in the center of each Modeler viewer. To move the bounding outline click and drag it to any position on the image inside the view area. Now that you have built and run your script, experiment on your own to test the versatility of Modeler. Here are some suggestions for extending the power of your script: ? Add a VIEWBW module and run your script again to see the shaded relief without the RGB layers. ? Add an EXPORT module and save your output as a TIFF file. ? Disconnect the VIEWRGB module in the upper right of the workspace by removing the pipes that join the three IMPORT modules to the MERGE module. Lesson 6.3 Scripting Multiple Inputs and Data Merges 216 PCI Geomatics In this lesson you: ? Built a visual script that added shaded relief to an image from a Digital Elevation Model ? Configured a REL module ? Used multiple inputs and merged image data with the IMAGEADD and MERGE modules ? Compared processed images using two VIEWRGB modules In the next module you will return to Geomatica Focus and work with the Focus cartographic tools to build a Map project. PCI Geomatics 217 Module 7 Map Publishing with Focus Module 7 has Four Lessons: Lesson 7.1 Introduction to Map Projects Lesson 7.2 Building a Map Structure Lesson 7.3 Representing Map Elements Lesson 7.4 Building a Map Surround Exploring a Focus GPR File In this module you will work with the map publishing tools in Geomatica Focus. You will begin with an introduction to the tools and functions for working with a map project files, and layers. A Geomatica project (.gpr) file will be used in the first lesson to demonstrate the tools and functions available for map publishing in Geomatica Focus. The Geomatica project file will be used to show map structure, priority of layers, representation, and surround elements. After you become familiar with the available map publishing tools in Focus, you will then create your own map project in the following lessons. Lesson 7.1 Introduction to a Map Project 218 PCI Geomatics Lesson 7.1 Introduction to a Map Project In this lesson you will: ? Explore a completed map project file ? Learn the concepts of: ? map planning ? map structure ? priority of layers ? representation ? surround elements You will begin to build your own map project in Lesson 7.2, but first you will review a typical map publishing project file in Focus. Using the completed project you will explore the key concepts in creating a map project in Focus. The concepts of map planning, map structure, priority of layers, representation and surround elements will be discussed. The concepts will be explained first and will then be demonstrated by your instructor using the completed newport.gpr map project. Map Planning In order to create a successful map project, steps must be taken to first plan the project. One must know what type of information will be included and why it will be included. Important questions at the planning stage are: What type of data am I using? Who will be the audience? Is my map project thematic or geographic? What results do I want to communicate? Finding answers to questions such as these will give an idea of where the map project is going and will make the project much easier to create. Map Structure Map structure refers to the layout of the map and how information is portrayed on the page. Is it most useful to have one large map with many themes on it or several smaller maps with a single theme on each map? Map structure also refers to how information is displayed in the project. A map project file structure is the same as in other projects you are able to complete in Geomatica Focus. Raster, vector and bitmap layers can be manipulated in the maps tree in order to organize information as you like it in the view and for final output. You will create your own map structure in Lesson 7.2. Learning PCI Geomatica - Module 7: Map Publishing with Focus PCI Geomatics 219 Priority of Layers Priority of layers is very much linked to map structure. As mentioned above, data layers are shown in the maps tree and reflect what is displayed on the map(s). The priority or order of these layers in the maps tree affects the order in which features are displayed on the map(s). For example if you want roads displayed on top of railways in the map, you would position the road layer above the railway layer in the maps tree. Priority of layers will be covered in greater depth in Lesson 7.2. Representation Representation refers to how particular features are displayed on the map. Do you want major highways to be displayed with a thick red line, and minor roads with a thin black line? Do you want landmarks displayed using a particular symbol? Again it comes back to map planning. Who will be viewing the map and for what purpose? Do you want a simple representation or a more rigorous, repeatable representation style that is the standard for your company or organization? Representation will be covered in more detail in Lesson 7.3. Surround Elements Surround elements are elements that you add to your map project in order to add context. Elements such as scale bars, north arrows and legends are examples of surround elements. There is a wide range of surround elements available in Geomatica Focus. These will be covered in more detail in Lesson 7.4. Focus offers a variety of tools for the creation of maps. You build a map or modify an existing map by adding areas, images, and vectors. Any data loaded in the viewer is map-ready. After that, you define the representation of the map and specify how you want your features to look. Finally, surround elements are added to add context. Lesson 7.1 Introduction to a Map Project 220 PCI Geomatics The California Winery Project File The California winery site suitability project file (SuitabilityStudy.gpr) included in your demo data set is a map project for locating a California winery using multisource data. It contains numerous Areas and Layers for organizing information for presentation. In this lesson we will use the SuitabilityStudy.gpr to explore planning, structure, priority, representation and surround elements. To view the completed Suitability Study map project: 1. Make sure Focus is running on your system desktop. 2. In the File menu, click Open. A File Selection window opens. 3. From the demo folder, click SuitabilityStudy.gpr. 4. Click Open. The Maps tree shows a list of the Areas and Layers in the SuitabilityStudy.gpr file and the Map project is displayed in the Focus viewer. Figure 7.1 California Winery Map Project Learning PCI Geomatica - Module 7: Map Publishing with Focus PCI Geomatics 221 California Winery Map Planning Look at the SuitabilityStudy.gpr file. Does the project look like it was well- planned? What do you think is the purpose of the map? What type of data is used? Is it used effectively? Is the project thematic or geographic? What results does the map communicate? California Winery Map Structure As you can see the California Winery map project is structured in the same way as previous Geomatica Focus projects. To the left of the Focus viewer is the Maps tree which lists Map(s), Area(s) and Layer(s). It first lists the Map, called Suitability Study. This is essentially the paper upon which the Winery project is displayed. Next you can observe that there are numerous Areas listed under the Map in the Maps tree. In the Winery project, each of these areas contain a different theme. Remember that an Area holds the geographic bounds for a layer or set of layers. In a map project these Areas could represent themes or geographic regions. In the California Winery map project, these themes include: vegetation, road networks, county polygons, precipitation, a digital elevation model, chapparal, buffered roads, interior counties, rain, slope and finally the suitability result. Raster and vector layers are the sub-components making up all of these Areas (themes). If you expand one of the Areas in the Maps tree, you can view the layers that make up that Area. Lesson 7.1 Introduction to a Map Project 222 PCI Geomatics Figure 7.2 Suitability Study Maps Tree All of the layers that are displayed in the Maps tree and illustrated in the viewer as a result, stem from the Files tree. The Files tree lists all of the original data files stored on disk. In the Suitability Study GPR, the original files consist of calDEM.jp2, californ.pix, RasCount.pix, RasRain.pix, RasRoad.pix, RasSlope.pix, RasVeg.pix, SuitabilityStudy.pix, and Winery.pix. Note Remember a .pix file is a Geomatica generic database file that is able to contain many different types of spatial data in one file. Learning PCI Geomatica - Module 7: Map Publishing with Focus PCI Geomatics 223 Figure 7.3 Suitability Study Files Tree Lesson 7.1 Introduction to a Map Project 224 PCI Geomatics California Winery Priority of Layers The order in which layers are shown in the Maps tree reflects the order in which data is displayed on the map. In the Maps tree, if you right-click on a layer and select Properties from the shortcut menu, you are able to view the priority of that layer. Remember, the higher the numerical value for a layer, the higher the priority will be. In the viewer, high priority layers will be displayed on top; in the Maps tree, high priority layers will be listed higher in the tree. You will assign priority to layers in your own map project in Lesson 7.2. Figure 7.4 Priority of the Roads Layer Learning PCI Geomatica - Module 7: Map Publishing with Focus PCI Geomatics 225 California Winery Representation Most features in the Suitability Study map project are represented differently than in the original data layers. For example, Road Networks were all simple lines before they were represented with different colors and styles. Most of the map layers in fact need to be represented in a way that communicates information more effectively than the original data. Geomatica Focus does this using the Representation Editor. Figure 7.5 The Representation Editor The Representation Editor is the starting point for creating, assigning, managing and manipulating map representation of features. The Representation Editor can be accessed by right-clicking on a layer in the Maps tree and selecting Representation Editor from the shortcut menu. You will create your own representations for features in Lesson 7.3. Lesson 7.1 Introduction to a Map Project 226 PCI Geomatics California Winery Surround Elements The last map publishing concept explained in this Lesson will be surround elements. As mentioned earlier, surround elements provide context in which to view the map that has been created. Surround elements are stored within individual areas in a map project. Can you pick out the surround elements in the Suitability Study map project? They include items like title, legend, neatline, north arrow, scalebar, etc. Notice that these surround elements are also listed in the Maps tree. In Geomatica Focus you can create and edit surround elements from the Maps tree. You will create surround elements for your own map project in Lesson 7.4. Figure 7.6 Suitability Study Surround Elements In this lesson you: ? Explored a completed map project file ? Learned the concepts of: ? map planning ? map structure ? priority of layers ? representation ? surround elements Learning PCI Geomatica - Module 7: Map Publishing with Focus PCI Geomatics 227 Lesson 7.2 Building a Map Structure In this lesson you will: ? Build a new map project ? Add new areas and layers to the map project ? Assign priority to layers in a map project In this lesson you will begin creating a new map project using the californ.pix file. You will start by setting up the Map and Areas for the project. Then you will add vector layers and prioritize those layers. To create a new Map Project: 1. From the Geomatica toolbar, start a new Focus session. 2. From the demo folder, open the californ.pix file. By default the California state boundary will be loaded because it is the first layer in that file. A Map and an Area level are automatically added to your Maps tree. 3. On the Focus toolbar, click the Map View button. The display in the Focus View Area changes to Map View Mode. Note When you open data files, Focus is in Area View Mode by default. Geomatica Focus must be in Map View Mode in order to work on map projects. Changing Paper Size In the Maps tree of californ.pix, the first item listed is the Map level. In Geomatica, the Map level refers to the blank page or sheet that the project is created on. By default, the Map is named according to the first file opened. Since californ.pix was the first file opened for this project, the Map receives that name. New maps have a paper size of 215.9 x 279.4 millimetres (8 ? x 11 inches) by default. You can change the paper size to several standard sizes in the Maps Properties dialog box or you can set a custom paper size by dragging the map handles in the Focus view area. Lesson 7.2 Building a Map Structure 228 PCI Geomatics To change the paper size: 1. In the Map Properties dialog box, click the Page Setup tab. 2. Select Landscape Orientation. 3. From the Page Size list, select B 11” x 17”. 4. Click Apply. Note Alternatively, select the Map icon in the Focus Maps tree to highlight the map. Drag the Map handles in the Focus View Area to resize your Map sheet. Working with Areas Areas define the file boundaries for image (raster) and vector layers. They can contain several layers for the same geographical region and you can have as many areas in a project as you wish. Each area has a unique georeference system. When you add new layers to an area, they are georeferenced and scaled to the area by default. You can add new areas to a map and then place new layers within the areas. The new layers, in turn, hold vector data such as polygons, points, and segments that you need for your map. Surrounds and indices are held in similar areas but you work with these elements independently. The bounds of an area can be adjusted independently from the Map. When you add a new area, the files are shown below the Map icon in the Maps tree. Vector and raster layers, contained within the area, are shown below the Area icon. In this lesson you will create a new map project with two Areas. The Areas will be of the same geographic region (California), but will display different information. One Area will display the information about the natural environment and will contain a lake layer, a river layer and a vegetation layer. The other Area will display the information about the built environment of California and will include a roads layer, a railroad layer and an urban layer. You will use this information to create a complete map project. Learning PCI Geomatica - Module 7: Map Publishing with Focus PCI Geomatics 229 Next, you will rename your first Area level. To rename your first Area: 1. In the Maps tree, click on the New Area level. The Area level is highlighted in yellow. 2. Click on the New Area level again. You can now enter a name for your Area. 3. At the insertion point, type Natural. You now have one Area associated with your Map named Natural that contains the state boundary layer. You will now create a second Area to contain data associated with the Build environment. To create another Area: 1. In the Maps tree, right-click the Map icon. A shortcut menu opens. 2. In the shortcut menu, select New Area. In the Maps tree, a New Area icon is shown as part of the Map and it appears in the Focus view area as a rectangular frame with eight handles. Term A handle is used to manually re-size the extents of a Map or an Area. To name the second Area levels: 1. In the Maps tree, click on the New Area level. The second Area level is highlighted in yellow. 2. Click on the New Area level again. You can now enter a name for your Area. 3. At the insertion point, type Built. You now have two areas associated with your Map: Natural, and Built. Next you will add the state boundary layer to the Built Area as well. Lesson 7.2 Building a Map Structure 230 PCI Geomatics To add data to the Built Area: 1. In the Maps tree, select the Built area. Your data will be added to the Built area. 2. In the Focus File menu, click Open. A File Selection window opens. 3. In the Geomatica program files, locate and open the demo folder. 4. In the demo folder click californ.pix. 5. Click Open. There should now be two Areas in the Maps tree. One is called Natural and the other is called Built. Each contains the state border vector layer. You will now organize the position and scale of your Areas in your map project. To rescale an Area: 1. In the Maps tree, right-click on the Natural area. A shortcut menu opens. 2. From the shortcut menu, select Properties. The Area Properties window opens. 3. Under the General tab, change the scale of the Area to 1:8000000. 4. Click OK. The scale of the Natural area will change in the viewer. 5. Repeat steps 1 to 4 for the Built area. Both Areas are now displayed at the same scale. Now you will position both Areas in the viewer, remembering to leave room for surround elements. To position an Area: 1. Select the Natural area in the Maps tree. 2. In the Focus display area, position your mouse on the outline of the Area in the viewer, until you see a four-directional arrow. 3. Click and drag the Area to a new position using your own judgement. 4. Do the same for the Built area. Learning PCI Geomatica - Module 7: Map Publishing with Focus PCI Geomatics 231 Note You may also change Area position under the Layout tab in the Area Properties window. Figure 7.7 Setting Up Areas in a Map Project At this point, you have created a new map project, defined the map (blank sheet), and created, scaled and positioned two new areas. The areas have the same geographic coordinates; however, they will display different information. Lesson 7.2 Building a Map Structure 232 PCI Geomatics Vector Layers Once the areas of your project have been set up, Geomatica Focus allows you to add vector files to the project in order to continue adding information to your map. You will work with the surround elements later, but first you will add vector layers to your project. In this lesson you will add three vector layers to each Area. The Natural area will contain vegetation, river and lake layers. The Built area contain urban, railroad and road layers. To add vector layers to your project: 1. In the Maps tree, select the Natural area. 2. In the Focus viewer, click the Files tab. 3. In the Focus Files tree, click the + beside Vectors. The Files tree expands to show the available vectors files. 4. While holding down the shift key, select the Rivers, Lakes and Vegetation vector layers. The three vector layers are highlighted. 5. Right-click on one of the three selected vector layers. A shortcut menu opens. 6. In the shortcut menu, click View. The Rivers, Lakes and Vegetation vector layers open within the Natural area. 7. Repeat steps 1 through 6 to add Roads, Railroads and Urban vector layers to the Built area. Learning PCI Geomatica - Module 7: Map Publishing with Focus PCI Geomatics 233 Figure 7.8 Natural and Built Areas After all of the layers have been added to your project, it may be necessary to assign priority to layers. Assigning priority will determine what order features will be displayed on the map (i.e., what feature will be on top of others). Each layer can be assigned a unique priority level using the Properties panel. To change layer priorities: 1. In the Maps tree, right-click the Vegetation vector layer. A shortcut menu opens. 2. In the shortcut menu, click Properties. The Vector Layer Properties panel opens. Lesson 7.2 Building a Map Structure 234 PCI Geomatics Figure 7.9 Vector Layer Properties Panel Notice that the vegetation layer has a Priority of 3. A high numerical value indicates higher priority which means the layer will be displayed on top of other layers. 3. In the Priority box, type or select 0. 4. Click OK. The priority for the Vegetation layer is now 0, meaning the layer has low priority and is displayed on the bottom. Since the Vegetation layer is a polygon layer, it is often useful to have this layer on the bottom so that its polygons do not obscure other features when filled. Tip You can also change the priority of a layer by dragging it up or down in the tree list. Dragging a layer up the tree list increases its priority. Dragging a layer down the tree list decreases its priority toward 0. In this lesson you: ? Built a new map project ? Added new areas and layers to the map project ? Assigned priority to layers in a map project Learning PCI Geomatica - Module 7: Map Publishing with Focus PCI Geomatics 235 Lesson 7.3 Representing Map Elements In this lesson you will: ? Create a representing using the Representation Editor ? Edit styles using the Style Chooser ? Link Representation to the Attribute Manager ? Label vectors using the Label Tool Representation Editor The Representation Editor organizes your map representation information. Digital data such as symbols, symbolized lines, filled areas and text strings are stored as discrete elements called representations. Each graphic feature on your map has a unique representation that is categorized using an alphanumeric Representation Code (RepCode). RepCodes are defined by one or more descriptive labels and a set of coordinates that tell the system where and how to show the feature on your screen. You can use a RepCode to differentiate between types of information such as rivers and roads. You can also create RepCodes that differentiate between classes of roads. Unique RepCodes for road classes ensure that they are distinct in the system, and that a different graphic is displayed for each. RepCodes are stored and managed in the Representation Style Table (RST) for each feature. The RST allows you to manage the layers and objects in your project with ease. Lesson 7.3 Representing Map Elements 236 PCI Geomatics Components of the Representation Editor The Representation Editor panel can be broken down into several parts. The Representation Style Table (RST) is the most important part of the panel. It shows representation styles that exist for a particular layer. The Representation Style Table is composed of several columns including Style, Value, Description, and Count. These columns contain information on the representation of a particular feature. The Style column defines the graphic style that a particular feature will use when represented. The Values column is derived from a specific attribute. The Description describes the representation style. The count column shows the number of shapes that will use the representation style for each row. The Tree helps to organize the representation. It will show each RST Group within the Representation file. The tree also shows any symbol files linked to the RST. The Toolbar provides shortcuts for common operations in the Representation Editor, such as Cut/Copy/Paste, Add/Remove Groups and Styles, Sort Ascending/Descending, and more. Figure 7.10 The Representation Editor Learning PCI Geomatica - Module 7: Map Publishing with Focus PCI Geomatics 237 The Attribute Manager and Representation The Representation Style Table (RST) represents features on a map by linking to the Attribute Manager of each vector layer that is represented. To view the attributes used for Representation: 1. In the Maps tree, right-click on the Vegetation layer. A shortcut menu opens. 2. In the shortcut menu, select Attribute Manager. The Attribute Manager for the Vegetation layer opens. Figure 7.11 Attribute Table for the Vegetation Layer Take note of the attribute called VecCode. This attribute gives a unique numerical value for each class of vegetation. In the Representation Editor we will create representations that will link to the Vegetation layer using the values from the VecCode attribute. For example, the first record in the attribute table for VecCode is 11. In the Representation Editor, we will create a unique style for this value. As a result, all vegetation features with a value of 11 will inherit this unique style and will be displayed accordingly in the Focus viewer when finished. We will now create representations for the Vegetation layer. Lesson 7.3 Representing Map Elements 238 PCI Geomatics To create a representation using the Representation Editor: 1. In the Maps tree, right-click on the Vegetation layer. A shortcut menu opens. 2. In the shortcut menu, select Representation Editor. The Representation Editor panel opens for the Vegetation Layer. 3. If necessary, click More>>>. This expands the panel to access more options. At this point the Representation Editor is only displaying the default representation for the layer. You will now design and apply a custom representation to the data. Figure 7.12 Representation Editor for the Vegetation Layer 4. In the Attribute list, click VecCode. This will link the representation to the VecCode attribute in the Vegetation layer. 5. Make sure the Generate New Styles option is clicked. 6. In the Based on list, click More. Learning PCI Geomatica - Module 7: Map Publishing with Focus PCI Geomatics 239 The Style Selector window will open. 7. In the Style Selector window, choose the Polygon tab. An assortment of polygon styles are displayed. Figure 7.13 The Style Selector 8. In the gallery of styles, select the solid black polygon style. 9. Click OK. The Style Selector window closes and the Representation Editor is updated with a filled polygon representation. 10. Make sure the Vary color option is clicked. 11. To assign a color scheme, click the arrow beside the color ramp 12. Select the first color ramp. This will apply a random color scheme. 13. Click Update Styles. Each value has been assigned a randomly colored solid polygon in the RST. Lesson 7.3 Representing Map Elements 240 PCI Geomatics Figure 7.14 Completed Representation Editor for Vegetation 14. At the bottom of the Representation Editor, click Apply. A warning message appears asking if you want to clear all of the direct (embedded) representation for this layer. 15. Click Yes. The default representation will be cleared and replaced with a new representation. The new representation is applied to the vegetation layer and is visible in the Focus viewer. Now you will save your representation to a file. To save your representation: 1. In upper-left corner of the Representation Editor, click on the Save icon. A Save As window opens. 2. For the Output RST File name, type caliveg.rst. 3. Click Save. The representation style table for this vegetation layer is saved. Learning PCI Geomatica - Module 7: Map Publishing with Focus PCI Geomatics 241 The RST you just created is now linked to the Vegetation layer. In the Maps tree, the vector layer symbol for the Vegetation layer has changed from black to blue. The result of your vegetation representation will look similar to Figure 7.15. Figure 7.15 The Final Vegetation Layer in the Focus Viewer. You will notice that the Lakes and Rivers layers in the Natural area are not represented very well. They are still displayed using a default representation. By replacing their default representation style with your own style, you can display the lakes and rivers more effectively. Lesson 7.3 Representing Map Elements 242 PCI Geomatics Adding Labels to a Layer A label is a string of characters placed in close proximity to a shape. You use labels to display information about the shapes and clarify the subject of the layer. The Label tool uses an attribute from the layer as a label for the shape. You will now add labels to the Vegetation layer. Note Before you create the labels, you must save your project. To save your map project: 1. On the Focus File menu, click Save Project. A File To Save window opens. 2. In the File name text box, type CaliEnvironments.gpr. 3. Click Save. Your project is now saved. Now that you have saved your project, you can add labels to your data. To add Labels: 1. In the Maps tree, right-click the Vegetation layer. A shortcut menu opens. 2. From the shortcut menu, select Properties. The Vector Layer Properties window opens. 3. Click the Labels tab. An empty list of labels appears. 4. To add a new label, click Add New. The Label Tool panel opens. Learning PCI Geomatica - Module 7: Map Publishing with Focus PCI Geomatics 243 Figure 7.16 The Label Tool 5. Make sure the General tab is selected. 6. From the list of Attributes, select VegType. The vegetation types contained in this attribute will be labelled on the map. 7. For the Label name, type Vegetation Type. 8. In the Representation section, change the Alignment to Center. The labels will be displayed in the center of the feature they describe. 9. Change the label size to 1mm. 10. In the Label Tool window, click OK. The Vector Layer Properties window will reappear showing the labels you have specified. 11. In the Vector Layer Properties window, click OK. The window closes and the labels are displayed in the Focus viewer. In this lesson we have given different vegetation types a unique representation as well as labels to identify each type of vegetation. Lesson 7.3 Representing Map Elements 244 PCI Geomatics In this lesson you: ? Created a representing using the Representation Editor ? Edited styles using the Style Chooser ? Linked Representation to the Attribute Manager ? Labelled vectors using the Label Tool Learning PCI Geomatica - Module 7: Map Publishing with Focus PCI Geomatics 245 Lesson 7.4 Building a Map Surround In this lesson you will: ? Create map elements using the surround panel ? Edit the Title elements in your map project ? Save your map project as a GPR file Surround Elements Surround elements are elements that you add to your map project in order to add context. Elements such as scale bars, north arrows and legends are examples of surround elements. There is a wide range of surround elements available in Geomatica Focus. You add surround elements to your map with the Surround panel. When Focus is in Map View mode you can choose from a list of standard map elements and configure them to suit your needs. In this lesson, you will add nine new surround elements to your project. Focus provides dialog boxes to set scales and to configure all surround elements. To begin, you will add the surround elements to your project by choosing them from the list in the Surround panel. First, open the Surround panel to select the elements that you want for your map. Before you begin you may need to organize and/or resize your two Areas in order to make space for the surround elements that will be added in this lesson. To do this, select the Area in the maps tree, and organize as you wish, following the steps in Lesson 7.2. You will need space for a title, a legend, borders, a north arrow, etc. To select and apply surround elements: 1. In the Maps tree, right-click on the Natural area. A shortcut menu opens. 2. In the shortcut menu, click Surround. The Surround panel opens. Lesson 7.4 Building a Map Surround 246 PCI Geomatics Figure 7.17 The Surround Panel The window on the left of the Surround panel shows a list of icons and available surround elements. 3. In the list of surround elements, click the Border, Legend, Logo, North Arrow, Scalebar, and Title options. A check mark appears beside each of these surround elements. Figure 7.18 Surround Panel with Elements Selected 4. Click OK. The surround elements for the Natural area are added to the Focus viewer and are listed in the Maps tree. Now you will add surround elements to the Built area. Learning PCI Geomatica - Module 7: Map Publishing with Focus PCI Geomatics 247 5. In the Maps tree, right-click on the Built area. A shortcut menu opens. 6. In the shortcut menu, click Surround. The Surround panel opens. 7. In the list of surround elements, click the Border, Legend, Logo, and Title options. A check mark appears beside each of these surround elements. 8. Click OK. The surround elements for the Built area are added to the Focus viewer and are listed in the Maps tree. Arrange the Areas, and Surround Elements on the Map in a way that suits your needs and creative inclination. Figure 7.19 Final Map Project in Focus Lesson 7.4 Building a Map Surround 248 PCI Geomatics All surround element have a properties panel, to customize and format the way information is shown by the element on the map. Properties panels have a series of options, dialog boxes, and drop-down menus for changing the surround element settings. You will now edit your surround elements to add more appropriate titles to the map project. To edit titles in your map project: 1. In the Maps tree, double-click the Title icon within the Built area. The Title properties panel opens. 2. In the General tab, enter California for a title and Built Environment for a subtitle. 3. For Title alignment, select Center. 4. Click OK. Your title changes take effect and are displayed in the Focus viewer. 5. Repeat steps 1 to 4 for the Natural area title. Tip To edit or customize a surround element, double-click the surround element in the Maps tree. In order to save your surround elements you must save your project. To save your map project: ? On the Project toolbar in the Focus viewer, click Save. Your map project and associated surround elements are now saved. In this lesson you: ? Created map elements using the surround panel ? Edited the Title elements in your map project ? Saved your map project as a GPR file PCI Geomatics 249 Module 8 FLY! 3-D Visualization Module 8 has Three Lessons: Lesson 8.1 Starting FLY! and Opening a Terrain Lesson 8.2 Controlling your Flight Lesson 8.3 Creating Flight Paths and Movie Loops 3-D Visual Flight FLY! is a digital imaging tool that can convert your imagery into a three-dimensional (3-D) terrain using digital graphic technology. FLY! drapes your air photo and satellite imagery over a Digital Elevation Model (DEM) then instantly creates a motion 3-D perspective that you can navigate in real time. You can alter your speed, elevation, and view and adjust any of the perspective parameters during flight. To control your flight, just point and click. Create stationary hover perspectives or program a custom flight path with several flight parameters that you select. You can overlay vector data to enhance the simulation. Identify key areas, isolate specific structures, add lines of sight, show electrical power corridors, railways, place names, and much more. You can even simulate adverse weather conditions with the FLY! fogging feature. In this module you will setup and run a three-dimensional terrain, create and view a flight plan, and use all the features and functions of the Geomatica FLY! software. Lesson 8.1 Starting FLY! and Opening a Terrain 250 PCI Geomatics Lesson 8.1 Starting FLY! and Opening a Terrain In this lesson you will: ? Review the FLY! main panel and Rendering window ? Open a Digital Elevation Model (DEM) and a Color channel ? View the resulting 3-D image To open FLY!: ? On the Geomatica toolbar, click the FLY! icon. Figure 8.1 The Geomatica FLY! Icon The Main Panel and the Rendering Window open on your desktop. No files are open so the icons on the Main Panel are unavailable and the Rendering window is empty. Figure 8.2 FLY! Main panel and Rendering Window Learning PCI Geomatica - Module 8: FLY! 3-D Visualization PCI Geomatics 251 Opening the Terrain To generate a motion graphic you must open a DEM file and either a color channel file or a black and white shading file. In this lesson you will use a color channel to render your 3-D terrain in color. Both the DEM and the color channels are opened from the Load Elevation and Color panel. Next, you will open the Load Elevation and Color panel from the File menu on the FLY! main panel. To open the DEM and the color channel: 1. Click the File command on the main panel menu bar. 2. In the File menu, click the Load DEM + RGB command. Figure 8.3 File menu The Load Elevation and Color panel opens. Figure 8.4 Load Elevation and Color panel Lesson 8.1 Starting FLY! and Opening a Terrain 252 PCI Geomatics 3. In the Load Elevation and Color panel, click Select Elevation File. The Database File Selection window opens. Figure 8.5 Database File Selection Window 4. Navigate to the demo folder. 5. Select the file, flydata.pix. 6. Click Open. The Database Channels window opens with a list of elevation and color layers. Figure 8.6 Database Channels Window 7. In the list, click the 5 [16s]: USGS Elevation Data (1 metre interval) layer. 8. Click Select. Learning PCI Geomatica - Module 8: FLY! 3-D Visualization PCI Geomatics 253 The elevation data is now ready to load. Next, you will open color channels from the same file. To select the color channels: 1. On the Load Elevation and Color panel, click Select Color File. The Database Channels Window is now set for selecting color data. Figure 8.7 Database Channels window with one color channel highlighted Tip Color channel data can be selected one file at a time from the list, by highlighting the file and clicking the Select command after each selection. Default values can be selected by clicking on the Default command below the file list. 2. Next, click the Default command. FLY! enters default color values in the color value boxes below the Database Channels list. 3. In the lower right of the Database Channels Window, click Select and Close. The Window closes and all of the elevation and color data you have selected is ready to load. 4. In the lower left of the Load Elevation and Color panel, click Load. The Load Elevation and Color panel closes and a progress monitor indicates the progress of the rendering activity. Lesson 8.1 Starting FLY! and Opening a Terrain 254 PCI Geomatics When the files have finished rendering the 3-D terrain, all of the FLY! menus and commands are available. Figure 8.8 Main Panel The Rendering Window shows a landscape with a horizon that FLY! has generated from the data you have opened. Your Rendering Window should show a 3-D terrain like the one in Figure 8.9. Figure 8.9 Rendering Window In this lesson you: ? Reviewed the FLY! main panel and Rendering window ? Opened a Digital Elevation Model (DEM) and a Color channel ? Viewed the resulting 3-D image In the next lesson, you will control your flight through the 3-D terrain. Learning PCI Geomatica - Module 8: FLY! 3-D Visualization PCI Geomatics 255 Lesson 8.2 Controlling Your Flight In this lesson you will: ? Access the FLY! control panel ? Fly through your 3-D imagery ? Control your flight through the Nadir window You control different features of FLY! with the commands on the Main Panel. When you pass your mouse over a command, its function appears in the text box at the bottom of the panel. You control the flight through your terrain with the Parameters Control panel. To open the Control panel: ? Click the Parameters Control command on the Main panel. Figure 8.10 Parameters Control command The Control Panel opens on your desktop. Figure 8.11 The FLY! Control Panel The four flight controls in the FLY! work together to give you control over all aspects of your flight. A B C D E A. Position Indicator B. Direction Control C. View Control D. Elevation Slide Control E. Speed Slide Control Lesson 8.2 Controlling Your Flight 256 PCI Geomatics Controlling Position The position control shows a scaled representation of the terrain in the preview window. Each corner of the square corresponds to a corner of the terrain displayed in the Render Window. To change the view in the Render Window, click anywhere within the preview window. The Render window view changes relative to where you have clicked in the Position Window. Changing Direction The direction control changes the direction of movement and the direction of view. The direction of movement and the view can be different. The direction of movement is controlled by the long black line, and the view by the shorter red line. To change direction and view simultaneously, click inside the circle indicator. To change only the view only, right-click inside the circle indicator. Adjusting Elevation The Elevation slide control changes the elevation of the view in the Rendering Window. The range of elevation values can be adjusted through the Options menu on the main panel. Setting Speed The slide control changes the file reading rate of the Rendering Window. The range for this control is adjusted through the Options menu. The text information to the right of the Direction control reports the current position, speed, and direction. Flying Through the Terrain You are now ready to fly through the terrain in the rendering window. To start flying: ? Click the User Free Flight icon on the Main panel Figure 8.12 User Free Flight icon The terrain moves in the direction and speed you select from the Control panel. If you have not selected a speed or direction, FLY! will use default settings. Learning PCI Geomatica - Module 8: FLY! 3-D Visualization PCI Geomatics 257 To stop the flight: ? Click the User Free Flight command again. The flight stops at the current position. To resume free flight: ? Click the User Free Flight command again. Flying from the Nadir Window FLY! provides an overhead or nadir view of the terrain to help you fly with added visual accuracy. To open the Nadir Window: ? Click the Nadir View command on the Main panel Figure 8.13 Nadir View command The Nadir window opens showing the terrain from above. Figure 8.14 Nadir Window Lesson 8.2 Controlling Your Flight 258 PCI Geomatics You can also navigate using the Nadir window. To fly using the Nadir window: ? Click anywhere inside the Nadir Window. A position indicator opens, and your current position switches to the position you clicked in the image. To change the position of flight, click anywhere inside the Nadir Window when User Free Flight function is either on or off. To change the direction of flight in the Nadir window, right-click on the terrain in the direction you wish to fly. The flight direction changes in the direction of your mouse pointer. In this lesson you: ? Opened the FLY! control panel ? Flew through your 3-D imagery ? Controlled your flight through the Nadir window Learning PCI Geomatica - Module 8: FLY! 3-D Visualization PCI Geomatics 259 Lesson 8.3 Creating Flight Paths and Movie Loops In this lesson you will: ? Create a flight path ? Generate a movie loop You can record a flight path to move in any direction over the terrain in the Nadir Window using the Flight Path Editing function. You program your flight path for elevation, speed, direction, and view. Next, you will create a flight plan from the terrain in the Nadir and the Rendering windows. Use the default elevation, speed, color, and rendering settings to create a simple flight plan. To create your own flight path: 1. On the Main panel, click the Flight Path Editing icon. Figure 8.15 Flight Path Editing command The Flight Panel opens on your desktop. Figure 8.16 FLY! Flight Panel Lesson 8.3 Creating Flight Paths and Movie Loops 260 PCI Geomatics There are several control commands on the Flight panel, but at the moment only the Add, Close, and Help commands are available. 2. Click anywhere in the Nadir Window. The position indicator is shown where you clicked in the image. 3. Below the text window, on the Flight panel, click the Add command. FLY! automatically generates coordinates to produce the first node in your flight plan and lists them in the Flight panel. The remaining editing commands are now available. You can clear, update, insert and delete coordinate information as you wish. To add more nodes to your flight path: 1. In the Nadir window, click any position where you want to place a new node. 2. After you make your selection, click Add. 3. Repeat steps 1 and 2, above, until you have several nodes linked together to form a path. In the figure below, an illustration of a flight path with 5 nodes following a linear feature in the image is shown. You can place your nodes in a line anywhere on your image. Note Figure 8.17 has been enhanced for graphical clarity. Your nodes will look smaller and your flight path will have thinner lines. Learning PCI Geomatica - Module 8: FLY! 3-D Visualization PCI Geomatics 261 Figure 8.17 Nadir Window showing illustration of flight path Now that you have created a custom flight path, you can view it in the Rendering Window. The video play commands, along the lower part of the Flight panel, control the speed and direction of video replay like conventional VCR controls. Click the Play, Stop, Fast Forward, Reverse, and Fast Reverse buttons to change the video replay. Figure 8.18 VCR controls at the bottom of the FLY! Flight Panel To play a flight path: 1. At the bottom of the Fight Panel, click the Play button >. 2. To stop the playback, click the Stop button []. Lesson 8.3 Creating Flight Paths and Movie Loops 262 PCI Geomatics Generating a Movie Loop After you have added all of the nodes for your flight path, you can generate frames to create a movie loop to automatically fly along your flight path. To generate a movie loop: 1. At the bottom of the Flight Panel, click Generate Movie Loop. Figure 8.19 FLY! Flight Panel The Movie Loop Frame Generation dialog box opens. Figure 8.20 Movie Loop Frame Generation dialog box You can choose from several file formats in the File Format menu but for this lesson leave the file format at Sequential BMP frames. 4. In the Frames Per Second setting, use the default value of 15. 5. Enter a path to store your rendered flight plan in the Directory for Generated Frames text box. Learning PCI Geomatica - Module 8: FLY! 3-D Visualization PCI Geomatics 263 Warning Frames require large amounts of disk space. Be sure you have enough to generate your frames. Because generating frames takes a large amount of time and disk space, you will not generate them here. 6. Click Cancel. Depending on the flight path you create, generating frames may take from several minutes to several hours to generate. During rendering, the commands on the Main panel are not available. An indicator opens at the bottom of the Main panel showing the progress of the frame generation. Figure 8.21 Main Panel showing Progress Monitor When FLY! has finished generating the flight path frames, the Main panel commands are available again. Tip You can add fog to your rendered terrain, adjust and record changes in elevation and texture and even create and view your flight in anagram 3-D. You can make dozens of adjustments using the various controls. In this lesson you: ? Created a flight path ? Generated a movie loop Lesson 8.3 Creating Flight Paths and Movie Loops 264 PCI Geomatics