Thursday, October 06, 2005

GTViewer's Highlight By Phase Application

The next several posting will cover various applications that use GTViewer as an application development platform. The last application discussed was the Upstream/Downstream Trace and it showed how a sophisticated GIS application can be implemented. This posting will cover another application that is much simpler in its design, but is still very useful. The Highlight By Phase app really does not do anything different from what you can already do with GTViewer and its built-in Thematic Queries; however, this app streamlines the use of several Thematic queries at once and minimizes the user’s input to get a standardized set of results.



The Highlight By Phase app allows the users to highlight electrical features that have a particular phase attribute. The standard app allows the user to select A, B, C, or Multiple. If A is selected, all features with the phase attribute set to A will be highlighted in Red. If B is selected, all features with the phase attribute set to B will be highlighted in Blue; and if C is selected, they will be highlighted in Green. A forth option allows features with more than one phase to be highlighted in Orange. By pressing the Highlight button, the Emphasize Session Graphics mode is engaged (to gray out all of the features), and the selected Phases are highlighted in the appropriate colors. The Highlight By Phase app only applies to features that are in the current view; however, there is no limit as to how many features you can include in the view, other than the more features, the longer it will take to process. Fortunately, GTViewer can process highlighting very fast and a very large number of features can be processed in this manner.

Sample Output using Emphasize Session Graphics Mode:



Sample Output with a Raster Backdrop:



To fully appreciate how valuable this simple little app can be, let us compare it to what would be done with Thematic Queries. A Thematic Query in GTViewer highlights a set of features with common attribute values, such as all wooden poles, all conductors with a particular circuit id, or all electrical features with a specific phase attribute. The Thematic Query is generic; the users fill in the prompts like a standard query to select the features to highlight, then the user selects how the highlighted items will appear (color, weight, etc.). The Highlight By Phase app is really just performing 4 Thematic Queries at once (A, B, C, Multiple) with a preset color scheme.

Just like with the Upstream/Downstream Trace, once results are obtained, the user can do various things with them. The results can be Printed as shown below:



The results can be converted to Redlines with the Tools/Highlighted Elements to Session command. Once converted to Redlines, the results can be shared with other users, manipulated, or exported as a DGN file or XML.

The Highlight By Phase app’s logic can be applied to many tasks other than phase highlighting. It can contain a list of predefined Thematic queries for any discipline, it can contain more preset Thematic Queries to choose from, and it can base its feature select on much more complicated criteria than a single attribute.

Tuesday, October 04, 2005

GTViewer's Upstream/Downstream Trace Application - Part 2

Part 2. See Part 1 for the beginning of this post.

Everything presented so far about the Upstream/Downstream Trace is pretty standard as for as Tracing applications go. The next part discussed is what sets GTViewer apart from other development platforms. The Modify Status button at the bottom of the dialog allows the user to change the Open/Close status of any switchable device. Changing the status will affect how the trace operates (since a trace will not go through an open device). By default, all switchable features use the status from the GIS data. If you press the Modify Status button, you can then select a switchable device in the view and change it open/close status. When a switchable feature is selected, you will get the following dialog:




This dialog tells you the type of feature you selected and shows the current status. If you change the status and press Save, the new status will be used the next time the data is traced. A modified feature will be shown in Red to indicate that it has been changed.

The next several screenshot will show how switching devices will change the trace results. The first screenshot show the Trace with no modifications made. The Magenta conductor is the starting feature and some of the Blue downstream features are shown.




If we zoom in to the center of the previous screenshot, there are 3 fuses:



I will open each switch one at a time and show the different trace results after each opening. In the screenshot below, the middle fuse is opened:




In the screenshot below, the middle and left fuses are opened:



In the screenshot below, all three fuses are opened:


The above example is just a simple demonstration of what can be done by modifying the feature status.

There are many things that can be done with Trace results that are just part of GTViewer’s standard functionality. Trace results can be printed:



The Feature Counting mechanism works on Trace results just like it does on any other feature. For example, the below screenshots show the Count summary and a Count Details report for Conductors. The Count in this instance only applied to the trace results and not all of the other features in the data.


Trace results can also be converted to Session Graphics (or Redlines) with the Tools/Highlighted Elements to Session command in GTViewer. Once converted to Redlines, the Trace results can be shared with others, converted to other formats (such as .DGN files or anything FME can generate). Also, once converted to redlines, the Trace Results can be manipulated like any other redline.

The Upstream/Downstream Trace application is a simple app, but it shows how sophisticated an application built on top of GTViewer can be. The Next few posts will cover other applications built on top of GTViewer to show in even more detail what can be done.

GTViewer's Upstream/Downstream Trace Application - Part 1

The Upstream/Downstream Trace began as a demo app to show off the Tracing capabilities of GTViewer, but it has evolved into a very sophisticated analysis application. The Upstream/Downstream Trace’s original goal was to show the user all of the upstream features (along the path back to the breaker at the substation) and all of the downstream features (along the opposite path to the breaker). Now, the application allows the user to change the status of any switchable device (fuse, switch, etc.) and immediately see how it affects the flow of electricity in the network. This Blog posting will cover all of the features of the Upstream/Downstream Trace application to show one example of how GTViewer can be used as a platform for developing GIS applications as well as being an excellent viewer.

GTViewer’s Tracing capability works for many different kinds of data. For Intergraph data (Framme or G/Technology), the database table storing connectivity information is used. For Smallworld and ESRI data where connectivity is stored as coincident graphics, GTViewer’s spatial indexing mechanism blazes through the graphics to find connected features. GTViewer’s tracing capabilities are augmented by GT/Trace which is a development tool that encapsulates all of the commonalities found in network tracing. GT/Trace accelerates the development of network tracing application and maintains a solid and well tested framework for network Tracing applications.

Running the Upstream/Downstream Trace is as simple as picking it from the menu in GTViewer. You will immediately see the dialog shown below:



When the Trace app is activated, it will wait for the user to select a starting feature. This feature can be limited to conductors, primary features, or any feature that carries electricity. This example limits the user to selecting primary conductor as the starting feature. By simply clicking on a primary conductor, the trace is started.

The Upstream/Downstream Trace’s dialog has several buttons and options at the top. The Reset button will clear any previous trace information and put GTViewer back into select starting feature mode. The Cancel button will stop a trace if it has already begun; this button is disabled if a trace is not actually running. The Locate Start button is provided to find the trace’s starting feature. Since the trace results are fit when the trace is completed, it is sometimes useful to easily and quickly go back to the starting feature. The Fit Trace button is provided to fit the trace results at any time. If you zoomed into look at features in the trace results more closely, or used the Locate Start button, the Fit Trace button will immediately fit the entire trace’s results into the current view.

Several options are also available to govern how the trace is run. The Search For group of options allows the search to run in three different modes: Upstream, Downstream, or Both. While this is an Upstream/Downstream Trace, the user may only be interested in the Upstream features or the Downstream features. If this is the case, the time needed to trace in both directions is sometimes not necessary. If the network does not support some form of directionality in its connectivity data, the trace will have to search to find the breaker at the substation to know which direction is upstream, so if the direction traced first is not the desired direction (when only upstream or downstream is selected), the trace will have to search in the other direction as well. Fortunately, the GTViewer’s tracing process is very fast and the selection of just Upstream or just Downstream is more for configuring the Trace results than increasing performance.

Three more trace options are also provided as checkboxes:

  • Highlight While Tracing is usually turned on so that the tracing can be seen while it is being performed. While this option does slow down the tracing process, GTViewer is very fast displaying graphics and it is unlike most traces you have seen before. Since the trace results are constantly being fit to the view, the view zooms out as the trace progresses resulting in a “mesmerizing” effect (possibly something you have to see to fully understand this description). It is far from the ka-chunk-ka-chunk one feature at a time highlighting I have seen with other GIS systems (not viewers). How much this option actually slows down the tracing process is dependent on many variables but usually in the area of 30% to 50%. Again, GTViewer’s tracing is very fast and most users prefer to watch the highlighting as it progresses.
  • Include Secondary is an option to trace secondary features such as Secondary Conductors and Secondary Meters. Some GIS data does not include secondary features in their connectivity model, so this is not always an option. The secondary information may or may not be of interest to the user and turning it off will declutter the results and increase performance (since there will be fewer features to trace).

  • Automatically Clear Highlight is an option that is usually turned on. It will reset any previous trace results in the view when a new trace is begun. If you want to see multiple trace results together, then you will need to turn this option off. You can also clear the trace results at any time with the Refresh button on GTViewer’s toolbar.
The following screenshots show a sample trace. The first screenshot has the raster backdrop turned on and the second one is shown against the overview graphics. In both screenshots, the following rules apply:
  • Magenta is the Starting Feature
  • Blue is Downstream
  • Red is Upstream
  • Yellow Circle is the location of the Breaker

Raster Backdrop:


Overview Map as Backdrop:


The Emphasize Session Graphics mode is automatically turned on when a trace is completed so that the Trace results are clearly visible against the rest of the data. If we zoom in to the area around the breaker (Yellow Circle), you can still see the trace results very clearly against the grayed out features.




The Upstream/Downstream Trace Dialog also shows a status window to indicate what is going on with the trace. When the trace is successful, it shows how many features are in each path, the path where the breaker was found, and the time it took to perform the trace. If there were errors or if the trace were canceled, the status window would also show this information. The Feature and Node labels at the top of the status window give you an indication of how the trace is progressing. The Feature count is the number of features traced. The Node count is the number of unprocessed nodes; this number will go up and down as the tracing progresses. As the trace nears completion, the Node count will go to zero and the trace will stop (as there are no more nodes to trace).

The Output list at the bottom of the Upstream/Downstream Trace Dialog shows a list of all features traced. This information includes the order of the features as they are traced, the trace path they belong to (upstream or downstream), the name of the feature, and the feature’s keys. The results can also be copied to the Windows clipboard with the Copy button; these result can be pasted into Excel to make a report.. Also, if you click on one of the items in the list,
it will be located immediately in the view. See the following screenshots for an example.

Select URD Transformer:



Locates Transformer in View:



To be continued in Part 2.

GTViewer as an Application Development Platform

I have been saying for some time now that GTViewer is more than just the viewer it started out as; it is now a platform for developing GIS applications. It may be unclear exactly what I mean when I say this, so the next few Blog postings are going to be examples of applications built on top of GTViewer to make the most of your GIS data. GTViewer is still a powerful viewer and redlining tool, but viewing can be the basis of many different applications that extend far beyond this standard functionality. Traditionally, a GIS viewer has been used for the specific task of replacing map books in the field and making GIS data accessible to a much larger number of users in the office. Now, however, the idea of viewing data has almost become assumed, and what users want now is to not only view their data, but to use their data in some way that leverages the GIS information they have available to them. GTViewer is a platform to develop other applications. By leveraging its viewing capability, redlining, view and data management and adding in an extensive set of development tools specifically geared to the development of GIS applications, GTViewer provides a solid platform for application development, and is a shortcut to getting the most use out of the data you already have.

Friday, September 30, 2005

Update to the FME GTViewer Reader/Writer



The latest FME Beta (build 2125) from Safe Software includes an update to the GTViewer FME Reader/Writer Modules. This update includes several fixes that have accumulated since the modules were introduced, and more importantly it includes a significant amount of new functionality for making the GTViewer modules more powerful and easier to use.

The original Writer Module was only able to produce one GTViewer category per Destination Dataset in FME. While this limitation did not prevent multiple categories from being created, it now only requires the setting of gti_categoryId format attribute. The value the gti_categoryId attribute is set to now determines the GTViewer category the feature will be written to.

This update also allows the users to create an Overview category. In the previous version, the Overview category was automatically generated with a single data bounding rectangle. Now, any feature written with gti_categoryId equal to 1 will be written to the Overview category.

A new directive file called catNameMapInfo.txt has also been added to allow a simple text file to map category names and category display settings (display on/on, min/max thresholds) to be statically defined in the GTViewer output directory. If the directive file is present, it will be used to fill in names and settings in the .GTM file produced. The GTM Directive files (genInfo.txt, addInfo.txt, catInfo.txt, and catNameMap.txt) can all be optionally used to provide information that is not necessary part of the conversion process, but is part of the polished results. By using these directive files, you should not have to modify the .GTM file after the conversion process.

GTI will continue to improve the GTViewer Reader/Writer modules for FME as they have proven to be a very powerful means of getting data into and out of the GTViewer format. Through the use of FME, GTViewer, Pocket GTViewer, GTVx, and GTWeb can be used with any of the data formats FME Supports.

Monday, September 26, 2005

GTData 5.0.0.1 is Available



Version 5.0 of GTData has been released. This version contains updates of the utilities to support the new functionality found in GTViewer 5.0 as well as some new features and fixes.

-----------
05.00.00.01 - 09/26/05
-----------

- NEW - GTShapeConv - A RangeFile entry has been added to produce a valid range file usable in a .GTM file to define the data range. The RangeFile entry, is defined in a Category section of the parameterfile and defines a path to the file to create.

- NEW - GTShapeConv, GTIntersect, GTShapeDbfConv - Now supports environment variables as tokens.

- NEW - GTFormatInfo - No includes a filterId entry in the parameter file to restrict processing to a specified set of filter ids. Entry can be a single values or a comma delimited list with ranges.

- NEW - GTExtract - Supports the ExtractAllDetailRanges flag in the .GTM file.

- NEW - GTExtract, GTQuery, GTPack - Support for Type 40 Address Queries.

- NEW - GTGetRecords - The -oh flag was added to omit the header line in the output file.

- NEW - GTConv - Tiling feature for files that all overlap.

- FIX - GTConv - Cell with all internal elements filtered out with the level filter would generate an index record even though there was no element.

Thursday, September 22, 2005

New Coordinate Readout Modes in GTViewer 5.0

GTViewer has always provided two modes for Coordinate Readouts: system mode and computed mode. With GTViewer 5.0, two more modes are provided to display coordinates at latitude and longitude values.

The Coordinate Readout defaults to Computed mode and most users probably never change it. Computed mode displays the coordinate values as they are in their source GIS which is what most users want to see. Computed is probably a misleading label, but the values are “computed” from GTViewer’s internal system coordinates. The System mode will display the coordinate values using the internal coordinate system used by GTViewer and is probably only useful to advanced users working directly with the data.

With GTViewer 5.0, there are two new modes for displaying the coordinates as latitude and longitude regardless of the coordinate system used by the data. One mode displays the coordinates as Decimal Degrees and the other as Degrees/Minutes/Seconds.

The Coordinate Readout setting affects the display and use of all coordinate values in GTViewer:

  • The current position on the cursor is shown on the status bar
  • The Attribute Info Dialog’s Element tab show element coordinates
  • The coordinate labels used on Print borders
  • The interpretation of coordinate values in the Locate XY dialog

There are two requirements before the Latitude/Longitude modes can be used:

  • The GPS Components must be installed for GTViewer
  • The data must have a coordinate system defined using the GPSInfoFile entry in the .GTM file

The Coordinate Readout mode is set either in the .GTM file with the CoordinateReadout entry or with the Options/Settings dialog in GTViewer. The Settings dialog in GTViewer 5.0 now allows the user to set a coordinate system as their personal default, so if the user wants to always use one of the Latitude/Longitude modes, they can set this as their default.

When using either of the Latitude/Longitude modes, the Locate XY command found under the Query menu becomes a Locate Latitude/Longitude command and it will accept either Decimal Degrees or Degrees/Minutes/Seconds as inputs. To use Degrees/Minutes/Seconds, separate the three components with a delimiter (space, comma, colon, or semicolon); there must be three delimited values for both the Lat and Long prompts.


Remember that in the Western Hemisphere, the Longitude value is negative to indicate West. Use a negative value for Latitude to indicate South.

When using the Latitude/Longitude Coordinate readout with Decimal Degrees, you will usually need to increase the Coordinate Readout Precison to 6 or more numbers after the decimal place to get a useful readout. The precision is also set with Options/Settings.

For more information on the Locate XY dialog see the previous Blog posting: Locate XY's Hidden Features

Wednesday, September 21, 2005

GTViewer 5.0 has been released



GTViewer 5.0 has been released.

See previous posting for details on new features.

Monday, September 19, 2005

Masking a shape for plotting

I'd like to share a user control I wrote for a client. He wanted to select a shape element and plot only what was inside the shape. The user control makes a mask around the shape. Then the user can adjust the view as he likes and then plot it.

For those of you who have written user controls for GTViewer, this will be old hat. For those who have not yet attempted one, this could be an easy start. It illustrates how to capture a feature that the user selects and do something based on that feature.

As with all user controls, make an entry in the .gtm file in the [External Applications] section, as documented in gtvconfig.doc in the 5.0 release. Then register the .ocx file, and GTViewer will automatically place it on the Query menu. When you open the .gtm file.

Sample code can be downloaded from http://www.gti-us.com/Blog/PlotShape.zip

Monday, September 12, 2005

The Data Monitor comes to GTViewer 5.0

GTViewer 5.0 includes the Data Monitor functionality provided in GTVx. For more information on the Data Monitor see the previous Blog posting: The Data Monitor in GTVx.

The Data Monitor provides a powerful set of tools for displaying geographically oriented data that is of a temporary nature. One might compare the Data Monitor items to Redlines (or session graphics), but the Data Monitor items are more for conveying information to the user at the moment rather that providing a mechanism for sharing and storing data. Lighting Strikes, Vehicle Tracking, and Outage Management are the example I provided in the previous posting.

The Data Monitor has been withheld from GTViewer in the past because it usually requires more coding than typical External Apps, and if you are going to be doing that much customization, GTVx is usually a better solution. However, the Data Monitor turns out to be very useful in very simple applications just as a means of presenting information to the user. For example, an application might read a file of ticket information and show the tickets at their geographical locations with all of their corresponding data as tooltips. Currently, the Data Monitor in GTViewer and GTVx are identical providing the same set of methods and events. The Data Monitor consists of around 50 methods to create, modify, and delete items. Five events are provided to know when items are clicked, double-clicked, and when tooltips are displayed and hidden.

The Data Monitor has been a very powerful too in GTVx for several years. Now, this power is part of GTViewer as well.

Friday, September 09, 2005

Applications Interacting with GTViewer

We get questions about how an application written in, say Visual Basic, can interact with GTViewer. This capability has been in GTViewer for a long time. We have recently updated the documentation in gtvconfig.doc for the 5.0 release, and it includes a descrioption of just how to do it. I'm going to paste a preview of that section of gtvconfig.doc below. It will be most useful when used on conjunction with gtvx.doc, which has a decription near the front about the differences between using GTVx and the methods exposed by GTViewer, as well as a list of methods and which ones are currently exposed in GTViewer.

So here is a section you put in the .gtm file in order to let your VB app interact with GTViewer. It will appear on the Query menu with a name you specify:

External Applications Section

The External Applications Section is used to specify parameters for ActiveX user controls. This mechanism allows sophisticated applications to be developed in Visual Basic that call methods exposed by GTViewer and interact with the graphics and tabular data.

· The ActiveX entry defines an external application for GTViewer with the following format:

ActiveX|<name>|<menu Position>|<objectPath>|<mode>
|<flags>|<height>|<width>|<x>|<y>|


  • Name is the name that will appear on the Query menu in GTViewer at the bottom of the list after the names of locate and thematic highlight queries. The Name must be unique.
  • Menu Position is for future use. Currently, it should be set to the numeral “1”.
  • ObjectPath is the path to the ActiveX user control that the system will recognize. In Visual Basic projects, the objectPath will typically be the name of the Project as found in Project > Properties followed by a dot, followed by the name of the user control, typically “UserControl1”.
  • Mode is set to 0 for modal dialog and 1 for non-modal. Modal dialogs must complete before they return control to GTViewer; Non-modal dialogs can run simultaneously with GTViewer.
  • Flags is for future use. Currently, it should be set to 0.
  • Height is the height in pixels of the area that will be reserved in GTViewer for the display of the user control.
  • Width is the width in pixels of the area that will be reserved in GTViewer for the display of the user control.
  • X is horizontal position in the GTViewer map window at which the upper left hand corner of the user control will be displayed.
  • Y is vertical position in the GTViewer map window at which the upper left hand corner of the user control will be displayed.
Example:

[External Applications]

ActiveX|<name>|<menu Position>|<objectPath>|<mode>|<flags>|

<height>|<width>|<x>|<y>|

ActiveX=Valve Isolation Trace|1|GTV_ElectGasDemos.ValveIsolation|

1|0|250|450|0|0

ActiveX=Highlight By Phase|1|GTV_HiliteByPhase.UserControl1|

1|0|270|220|0|0

ActiveX=Pole Inspection/New Pole|1|GTV_PoleInspection.UserControl1|

1|0|480|340|0|0|



Wednesday, September 07, 2005

Getting the most out of GTConfig

GTData contains over 40 utilities for performing a variety of Data related tasks. Many of these utilities are for the conversion to or creation of data in the GTViewer format; however, one of these utilities is provided to make configuration easier. The topic of this posting is GTConfig. GTConfig is actually a multipurpose tool that can be used for several different tasks (including data conversion), but this posting is only going to cover using GTConfig for configuration.

The simplest way to describe GTConfig is to say that it is simply a GUI for editing and manipulating GTViewer Table Definition Files (.TAB). A .TAB file is used by every GTViewer dataset that contains tabular data and it defines the Tables, Columns, and other metadata properties including:

  • Tables that are to be displayed
  • Table Display Order
  • Alternate Table Names
  • Attributes that are to be displayed
  • Attribute Display Order
  • Alternate Attribute Names
  • Table and Attributes that are omitted from Extracts

As you can see, these setting are things that you would most likely want to modify to make your data more friendly for your users. While the table structure is generally fixed and should not be changed, the display characteristics can be very important in making data more usable.

The .TAB file and its format are comprehensively described in the GTVConfig.doc (not to be confused with GTConfig.exe) and anything you can do with GTConfig to configure this file can also be done manually. The benefits of using GTConfig lie in its GUI to edit the file and not using Notepad or some other text editor. GTConfig also provides some Macro-like functionality for performing the same operation to all tables and all attributes. It also provides some template based functionality to modify all table and attributes to a commonly used configuration. So, while GTConfig cannot do anything that is not already achievable by manually editing the .TAB file, it does provide an easier way to perform the same task with much greater efficiency and is less prone to mistakes.

GTConfig is a simple tool to use. You can run it from the command-line without or without a .tab file specified:

GTConfig

Or

GTConfig data.tab

If you do not specify the .TAB file on the Command-line, you can use the Open button to select any .TAB file you like. Once GTConfig is running with an open .TAB file, you get something that looks like this:

You will see a list of Tables defines in the .TAB file along with their current settings. Selecting a table from the list will populate the Table Properties section showing which values can be modified:



Generally, for Tables, you will only modify the Display Name, Display Flag, and Display Priority. The Name, Number, and Reference Table setting can be modify if you uncheck the Lock Standard Properties checkbox, but these changes are not recommended.

The Display Name is the name used for the Table on the Attribute Info dialog’s Tab for the particular table. The Display Flag can be set to Show, Hide, or Omit. When set to Hide, the table will not display on the Attribute Info dialog, but the data will still be present for applications to use. If set to Omit, the Table will be omitted from any extraction of the data (either by GTViewer or GTExtract). If set to Omit, the data will not only be hidden, it will be removed from the extract making it unavailable for applications to use. The Display Priority determines the order of the Tabs in the Attribute Info dialog. Lower values are displayed first. In the following Attribute Info dialog, Pole was set to 500, Work Order was set to 800, and Elect Connectivity was set to 900. The Element tab is always last.

If Display Priorities are not set, the tables will displayed in the order they are found which usually appears somewhat random. In practice, it is usually good to set tables that are part of every feature (like a Common table or Connectivity table) to a high value, so they will always appear after the feature’s main table. From the Attribute Info Dialog box above, you can also see that the Display Names were also set: POLE = Pole, WORK_ORDER = Work Order, and ELECT_CONNECTIVITY = Elect Connectivity.

Once your Tables have been configured, you can configure the columns for each table. Double-clicking on a table in the list will take you to the Table Attribute page:




This dialog is very similar to the initial dialog only it pertains only to the selected table. It shows all of the columns define for the selected table along with the display settings.

The settings for Attributes are very similar to those of tables. You can set the Display Name, Display Flag, and Display Priority. Name, Type, Size, Decimals, and Key are locked by default and should not be modified.

The Display Name will be the name seen in the Attribute Info dialog. Display Flag can be set to Show, Hide, or Omit (same actions as the Display Flag for Tables). The lower Display Priority values are displayed first. Unlike the tables, if a Display Priority is not specified (or they are all the same), the attributes will be displayed in the order they appear in the .TAB file (instead of a random order).

The Table Attribute page also provides 3 buttons for setting the Display Flags of all attributes in the table with one click of a button: Show All, Hide All, Omit All. If you need to only show a few attributes, it may be quicker to Hide All then set the ones you want to see to Show.

GTConfig also provides some commands to affect the configuration on a grander scale than one table or attribute at a time. Back on the Main Page, the Global Operations section can be used to perform a variety of tasks.



These Global Operations deal with all of the attributes of each table. You can specify a list of attributes in the Attributes prompt (more than one can be specified if you separate them by a space), then the Show, Hide, Omit, and Priority Set button can be used. If the Show button is pressed, each table will be searched for the Attributes specified and their Display Flag will be set to Show. The Hide and Omit buttons can be used in the same way. The Priority value can be set and the Set button can be used to apply this priority to all attributes that are specified (regardless of the table they are in). The Optional Framme button is a quick way to list Framme attributes that are generally optional (RB_LOCK, RB_VERSION, RB_COMPONENT, RB_STATE, MSLINK, RB_OCCURRENCE). These attribute generally have little meaning for GTViewer data, so you can press the Optional Framme button, then Hide or Omit and get rid of all them at once. The Required Framme button populates the Attributes prompt with the required Framme attributes (RB_PRMRY, RB_SCNDRY, RB_FSC). In general, you must keep these attributes, but it is common to Hide them since they are generally of little use to users.

The last 4 buttons in the Global Operations section are: Pretty 0, Pretty 1, Pretty 2, and Clear. These button will apply a template to all of the tables and attributes to “Pretty” up the display using a standard method:

  • Pretty 0 – sets all of the Display Names for tables and attributes to be the same as the actual name.
  • Pretty 1 – sets all of the Display Names for the tables and attributes to be the same as the actual name. All underscore characters ( _ ) are converted to spaces.
  • Pretty 2- sets all of the Display Names for the tables and attributes to be the same as the actual name. All underscore characters ( _ ) are converted to spaces, the first letter of each word is capitalized, and the remainder of the character in the word are set to lower case.
  • Clear – sets all of the Display names for the tables and attributes to blank (meaning that no alternate value is provided).

Once your are finished configuring your data display, you can press the Save button to store the new configuration information. GTConfig provides two of feature that are worthy of mentioning. The Report button will generate a .csv file that contains all of the information in the .TAB file in a easier to use format. You can open the .CSV file up in Excel and view the information in a report format. The Import button is a powerful feature for importing Display settings from other .TAB file. If you import a .TAB it will apply any Display Name, Display Flag, or Display Priority setting for both tables and attribute for any tables and attributes that are found in both the current .TAB file and the one being imported.

One thing that many users forget is that you can have multiple .GTM files define pointing to the same data but can view the data differently with different .TAB files. It is usually a good idea to target the data for its users so that they can get the most out of it.

GTConfig is a powerful tool. It can save a great deal of time and can help improve the usability of the data.




Thursday, September 01, 2005

GTViewer 5.0 to be released in September



GTViewer 5.0 will be released later this month. Beta versions are available today.

GTViewer 5.0 is the 6th major version of GTViewer since its creation in 2000. If you are wondering how there are 6 versions when the version is only 5.0, there was a Version 1.1.

New versions of GTVx and Pocket GTViewer will follow.

A short list of the new functionality found in GTViewer 5.0 is listed below:

Usability Enhancements
  • Attribute Info Dialog: Resizable and Preview Tab for Linked Raster Files
  • Auto-Scroll while Measuring
  • Stop View Refresh with Right-Mouse click
  • Right-Mouse Menu: Integrates feature selection for Attribute Info and speeds display of associated files, like details, internal worlds, and scanned images
  • Fit command adds Fit Highlighted Elements and Fit Selected Elements
    Accelerator keys provide an alternative way to perform common tasks (especially useful for laptop)
  • One-Click retrieval of Linked files in Attribute Info mode
    Query enhancements: Number of allowed queries increased from 50 to 100 per dataset and Query Menu Grouping simplifies query access
  • Two new coordinate readout modes for display location in latitude and longitude

Security Enhancements

  • Optional Disclaimer Dialog requires the user to accept the disclaimer before opening data
  • Optional Auto-Timeout automatically ends application after a specified amount of time

Printing Enhancements

  • Print dialog has interactive support for border information
    Border field tokens for date, time, x, y, user, and data set description
  • Customizable Overview window allowing user-specified size, shape, and content.

New User Settings

  • Maximize Initial View
  • Open Last File
  • Hide Locate XY query
  • Reverse Mouse Wheel Zoom direction

Style Manager

  • Interactive tool for changing the way GTViewer displays elements; define, Edit, or delete Style Rules and Mapping
  • Change up to 28 symbology parameters including color, weight, line style, symbol, font, fill, scale, priority, etc.
  • Navigate existing mappings easily with cross-reference info.
  • Import and Export Style information.
  • Facilitates the Symbology definition for data converted with FME.

Redline Enhancements

  • Interactively place hyperlinks as redlines
  • Hyperlink can jump to an area in the data, external files, and now URLs
  • Four new Dimension Element styles

Geocoding

  • Find a specific address from street segments with address range information
  • Address location is interpolated from available information

Display Enhancements

  • Layered Symbol Support
  • Priority Display support for Highlighted Elements
  • Default Symbology can now be default for data with no defined symbology

Customizability Enhancements

  • 60+ new methods
  • Data Monitor support (similar to that found in GTVx)
  • Support for Launching and running GTViewer from stand-alone apps (opposed to running as external apps inside GTViewer)

Miscellaneous

  • GPS Interface enhancements
  • Feature Counting enhancements

Monday, August 29, 2005

Attribute Info and Zoom (and a peak at GTViewer 5.0)

GTViewer provides the Attribute Info and Zoom commands for reviewing feature attributes and navigating the view. These two commands have a great deal of overlap in their overall functionality and with the upcoming GTViewer 5.0, the difference between these two commands will blur even further. The Attribute Info and Zoom commands will be discussed in detail by this blog posting so that they can be fully utilized by the users; also, the new functionality they will offer in GTViewer 5.0 will be introduced.


Traditionally, the Attribute Info command has been used to select a feature and retrieve tabular information and linked files. However, the command also provides the ability to zoom in, zoom out, and go back to the previous view.


The Zoom command has traditionally been solely for navigation by providing the ability to center the view on a mouse click and providing the ability to zoom in, zoom out, and go back to the previous view.

The only difference between the Attribute Info and Zoom commands is that the click will retrieve feature attribute in one and center the view in the other. Both command can Zoom In, Zoom Out, and go to the Previous view.

Use either of the command is very simple. Once in the selected mode, a single click of the left mouse button (or pressing the stylus to the screen) with no dragging of the cursor will result in the action specific to the active command:

  • The Zoom command will center the view on the point clicked on.
  • The Attribute Info command will retrieve tabular information and linked files for the feature under the click. If more than one feature is present at the click location, a popup list will allow the user to select the specific feature to review.

The different navigation actions are interpreting from the movement of the cursor (by a mouse or stylus). The diagram below shows the action that will be taken by the cursor action in both Attribute Info command and Zoom command.

To perform a navigation action, click the left mouse button (or press the stylus on the screen) and drag the cursor in a direction. Releasing the mouse button (or lifting the stylus) will initiate the navigation action. If the Center mark is the click-down location, the quadrant the cursor is dragged into determines the navigation action:

  • Zoom In - Drag Down and Right – The area inside the box you draw with the cursor (between the click-down location and the current location) will be fit to the current view size. The smaller the box you draw, the more zooming will be performed. The cursor will change to a Plus sign “+” when in Zoom In mode.
  • Zoom Out - Drag Up and Right - the farther you drag, the more you zoom out). The cursor will change to a minus sign “-“ when in Zoom Out mode and the farther you drag the cursor in this mode, the larger the minus sign cursor appears and the more you will zoom out.
  • Previous View - Drag Up and Left – The View/Location History command can be used to see what path the user has taken to get to the current view. Each previous view command executed, will step back through this list until it is at the first view when the dataset was opened. The cursor will change to a left facing arrow when in Previous View mode.
  • Cancel - Drag Down and Left – In case you start a zoom out, zoom in, or previous view, you can change your mind and stop the action before the view is manipulated. You can also press the Esc button to cancel an action that has begun. The cursor will revert back to the default Northwest arrow when the Cancel is mode is active.

While this concept of dragging the cursor into the different quadrants to perform a specific action may at first seem unnecessarily complicated and may be somewhat different from other applications you have used, it has proven to be much more efficient than other techniques and is very easy to get used to. It may not be readily obvious that the benefit of the modes combined into a single command is that you do not have to continuously change your mode to perform a range of navigation functions. For example, if you had a different commands for Zoom In, Zoom Out, Previous View, and Window Center (4 buttons on the toolbar), imagine how many times you would have to change modes to navigate to a specific feature. Each time you change modes, you must travel back to the toolbar, find the button to press, then go back to the view where you want to perform the action, then go back to change the mode again, and again. With the navigation modes all combined into one command, the user never has to go back to the toolbar to change modes and is immediately able to perform the navigation operation without any additional interaction with the software.

The Zoom mode is a nice all-in-one tool for navigating the view. If you use the Attribute Info mode, you trade the Window Center for a Feature Review while still maintaining the ability to Zoom In, Zoom Out, and go to the previous view. For me, this mode has always been the ultimate multi-function mode since you never have to change mode to review attributes and navigate. In fact, the Zoom mode could be done away with completely with minimal loss to the application’s functionality. However, GTViewer 5.0 will provide some new functionality to breathe a little life into the Zoom mode and it may be the ultimate mode for the future.

GTViewer 5.0 provides a subtle yet dramatic change to way you can perform basic tasks in GTViewer. The right-mouse menu has always been available to provide a quick popup menu of commonly used commands right at the mouse cursor.

Now, the right-mouse menu will search for any features present at the click and will pre-pend any features found to the beginning of the right-mouse menu. Also, if any feature has a linked file associated with it, the linked file will also be displayed under the feature in the right-mouse menu. By select a feature in the menu, the Attribute Info dialog will be displayed. By selecting a linked file, the associated file will be launched immediately (without going through the Attribute Info dialog, selecting the Link tab, and activating the link).

With the enhanced right-mouse menu, it no longer matters what mode you are in if you want to review a feature or see a linked file. So, you can stay in Zoom mode and perform all of the navigating and reviewing you want with more navigation actions than the Attribute Info mode can provide and still maintain the ability to review a feature without changing modes.

The Attribute Info command has also been enhanced for GTViewer 5.0. It now provides the ability to jump directly to a linked file without going through the Attribute Info dialog. If a feature has a linked file associated with it, you can launch the linked file by holding in the Ctrl key when the left-mouse button is clicked on the feature. If more than one detail is available, a pick list will be provided.

Both of these enhancements in GTViewer 5.0 provide even more flexibility to the way you operate in GTViewer. By making information easier to get to and optimizing the user workflow to perform common tasks, GTViewer again caters to the user’s need for a more productive environment.

Tuesday, August 23, 2005

Dimension Elements in GTViewer and GTVx

GTViewer and GTVx both support the drawing of Dimension Elements. These elements are exactly what you might imagine; they show a length and a reference line to help clarify dimensionality. The example below shows two dimension elements:

The Dimension Elements can automatically compute the length as they are drawn or you can enter any text you want to display for the dimension value. The Dimension Element tool is found under Draw/Dimension in GTViewer and is also on the toolbar:


Activating the Dimension Element mode will display the following dialog box:

Font and Size both deal with the Dimension Text characteristics. Color applies both to the reference line and the text. Weight applies only to the reference line. The Dimension Text can be manually entered or the Automatic Text option can be used to compute the displayed length based on the length of the reference line drawn.

Text Orientation and Terminator Orientation both relate to the appearance of the Dimension Element. Text Orientation specifies how the Dimension Text will appear relative to the Reference line. There are currently 4 different options:

The Terminator Orientation specifies how the arrow heads on the end of the reference line will appear. There are currently 6 different options:

The Dimension Element properties can be changed after placement by selecting the element and pressing the Properties button on the Redline Toolbar. Several Keys can also be used to adjust the appearance of a Dimension element if it is selected:

  • The Enter key will iterate through the Terminator orientation.
  • The Space Bar will iterate through the Text Orientations.
  • The Plus and Minus keys will scale the Text and the Terminator Arrows without affecting the length of the line.
  • The standard redline scaling, rotating, moving can be done with the Shift-Arrow Keys and the Ctrl-Arrow Keys.

If using the Automatic Text mode, the Text will be fixed after the placement, so that you can adjust the reference line without changing the text. If you do want to recomputed the text, just select the Properties and check the Automatic Text button and say OK. This action will update the text to the new computed length.

The Automatic Text mode’s Unit comes from the Master unit defined for the data and the Format droplist on the Dimension Element Dialog box can be used to specify how many numbers appear after the decimal point.

Friday, August 19, 2005

Pocket GTViewer version 4.0.x.6 is Available


Pocket GTViewer version 4.0.x.6 is now available. This version contains significant enhancements to the External Application Interface (especially for supporting Visual Studio .NET Smart Device Applications), performance enhancements for large "Shape with Holes" elements, and additional GPS support.

-----------
04.00.00.06 - 08/19/05
-----------

- CHG - Shape with Hole drawing has been optimized to provide significantly better
performance when viewing large shapes up close.

- NEW - Info Exhange interface adds new Instruction: ChangeColor

- NEW - TrimbleSupport flag added to Additional Properties section. When set to 0,
the NMEA receiver modes with Lat/Long coordinate projections will work without
the GPS Components installed.

-----------
04.00.00.05 - 07/06/05
-----------

- CHG - NMEA Receiver Setup will now go up to COM16 (instead of COM8).

- FIX - Links on features with repeating components would double the entries on the
Link Tab.

- NEW - Links can now use URL addresses.

- FIX - Reference elements could miss some of the tabular records associated with the feature.

- FIX - Launch with Point mode did not scale the reference point for HiRes screens.

- CHG - Evaluation Timeout extended

- NEW - External App modes can now store a bitmap of the current view before launching.

- FIX - External App Launch Immediately Mode did not handle the SetAppMode instruction from external applications.

- FIX - All mouse button events are absorbed after External Apps are run. Sometimes
a mouse up event was getting carried back after an external app was started in
modes 1 or 2 then the NextMode was set to Attribute Info (causing an unexpected
feature review).

- NEW - Info Exhange interface adds new Instruction: HighlightAdd, HighlightColor, HighlightClear, PB (Add to Point Buffer), ClearPB, DrawPBLineStr32, DrawPBShape32, ExportByFilterId, ClearAll

- NEW - Info Exchange interface adds new exchange values: ~BMP_FILE, ~RNG

Thursday, August 18, 2005

COGNET GIS Advisor - August

Check out the latest COGNET GIS Advisor Newsletter:



August 18, 2005 - Vol. 1, Issue 4

Feature Article: Can Pocket GTViewer Be a Usable Viewing Platform by Joey Rogers of GTI

Sunday, August 14, 2005

Creating Extract Files (.GTX)

An Extract File, or .GTX file, is a single, self-contained file that can be used with GTViewer, Pocket GTViewer, GTVx, and GTWeb Server. For more information on what Extracted Data is, see the Unextracted versus Extracted Data posting.

There are many different ways to create extract files (.GTX), so many that users may not be aware of them all. This posting will cover each different approach and provide general information on the Extract options.

GTViewer provides two methods for creating extracts. The first method I will describe is probably the most commonly used of all the methods. The Extract Data command found on the toolbar and the menu item under Tools/Extract Data actives the Extract Data mode which allows the user to drag a fence in the current view. This fence is always a rectangle and once placed, the user will see the familiar Extract Data dialog:


This interactive method or performing an extract allows the user to define several settings. The most important item here is the Output File which will specify the file to store the extracted information into. This file is the .GTX file.

The Description field is the name that is associated with the extract. By default, the name is the same as the parent dataset with the “(Extract)” text appended to the end. You can change this description to anything you want and it always appears in the File/Properties information as shown below:




The Filter Preset Support options determine what information will be extracted. If you have Preset Filters defined in your data and you support them in your extract, then all graphics necessary to support the Presets will be extracted. This method will probably include data that is not currently displayed and you may wish to add Presets to make sure that you include all of the data you want in your extract if some features normally default to not be displayed. If you select to extract only Displayed Graphics, then only the graphics currently displayed will be extracted (this does include features that are not currently displayed because of minimum and maximum threshold, but it does not include any features that are explicitly turned off). Extracting only displayed items is a very easy way to reduce the size of the extract, but make sure that you are not going to need a query or tabular information on one of the features that is not displayed since it will not get extracted.

The Data Support options allow the extract to include or not include Attribute Info data and/or Queries. If you choose not to support Attribute Info, you will not be able to review attributes on any feature. If you do not support Queries, then no queries will be available. If you do support Attribute Info and/or Queries, only the records that are associated with the extract area are stored in the extract file.

The Passcode Protection options allow a degree of security to be place on the .GTX file.
A Passcode (up to 10 digits) can be assigned to the .GTX file and every time the file is opened, the user must enter the Passcode to gain access to the file. Two more options are available to provide more control over how the .GTX file is used. The Days before Active setting allows a number of days to be specified. No password will be required until the number of days from the creation date of the extract is greater than the Days before Active value has been reached. This parameter allows .GTX files to have an expiration date, just set the Days before Active to 30, and don’t give out the passcode with the .GTX file. After 30 days, the file becomes useless without the Passcode. The Inactivity Timeout setting allows a time in hours to be specified of allowable inactivity. If the application is inactive for at least this period of time, the Passcode must be re-entered to gain access to the .GTX file again. This setting is designed to prevent unauthorized access for Pocket GTViewer in case the device is lost or stolen. Since the Window CE devices do not close the application when powered off, the file does not get reopened when started up again, so the Inactivity Timeout can provide an extra layer of security.

GTViewer provides a second approach to creating extract files. If you need extracts to have a different shape than a rectangle, you can draw a session graphic (redline) shape around the area you wish to extract. If this shape is selected, the Tools/Extract Data By Shape menu option is enabled and when selected, the standard Extract Data dialog is displayed. This method of extraction can be very useful if you are wanting to create extracts of Circuits whose bounding rectangle is significantly larger than a carefully placed shape around the data. For example, if the circuit is “L” shaped, a rectangular extract will include a significant about of data that does not relate to the circuit; however, a shape around the circuit’s path can considerably reduce the size of the extract.

GTVx supports the same two extract techniques as GTViewer. The ExtractData and ExtractByShape methods are provided to perform these tasks. ExtractData provides the standard rectangular fence extraction and ExtractByShape will use a selected Shape. The same Extract Dialog found in GTViewer is also used by GTVx.

GTWeb provides a command in the Client’s Right Mouse menu to extract the current view. When activated by a client, the GTWeb Server will create a .GTX file for the client’s current view and send it down to the client.

The GTViewer SDK provides an ActiveX control called GTExtractX that is very similar to the GTVx interface, except there is no GUI required and the user has parametric control over all of the settings instead of the Extract Dialog.

Last, but not least, GTData provides the GTPack and GTExtract utility for creating .GTX files. These utilities provide command-line utilities for the creating of extract file. See the previous blog posting for more information on these utilities and their differences.

A few other points about Extract files:
  • You can make extracts from and extract.
  • Currently, an extract file can be up to 2G in size.
  • Extracts always contains a session, but you can create sessions from Extract files.
  • Extract files can be used directly by GTViewer, Pocket GTViewer, GTVx, GTWeb Server, GTRead, GTExtractX, GTPack, GTExtract, Pocket GTReport.
  • Extract files are completely self-contained with the exception of the optionally used TrueType Fonts, Raster files, and external detail files.

Friday, August 05, 2005

Printing with Custom Overview Maps in GTViewer

GTViewer has for some time had the ability to show an Overview Map in the upper left corner of a print. Traditionally, this Overview Map has been the same as the Overview category which is also used by the Overview Window (see previous blog posting for more detail on the Overview Window). The print below show the default Overview Map in the upper corner of the plot with the Red box indicating the printed view:


A recent feature added to GTViewer allows the user to create his or her own Overview Map for printing. While the generic Overview Map is often adequate for providing a quick reference to the printed data’s location in relationship to the entire data set, the ability to define the Overview Map adds a whole new level of sophistication to your prints. Look at the print below and see how useful the Overview Map can be when the area it displays is explicitly specified:


It is very easy to define your Overview Map for Prints. Under the File menu in GTViewer, the Set View As Print Overview option will mark the active View as the Overview Map. The active view’s window shape, data extents, and display filters are all used in the creation of the printed Overview Map. Once the Overview Map view is set, create a second view of your data with Window/New Window and navigate to the area you want to print. When you print the second view, GTViewer will use the first view (the one set as the Print Overview) as the printed Overview Map. Make sure you select the Overview option when printing and select the Overview Map size (Small, Medium, or Large).

A not so obvious use of this custom Overview Map is to combine drawings of different items. For example, if you have a detail file, you can set its view as the Overview Map and then print another view showing a Geographic view. The resulting print shows the detail file as the Overview map:

Thursday, August 04, 2005

The Data Monitor in GTVx

The Data Monitor is a very powerful part of GTVx that has been somewhat under publicized since its introduction almost two years ago. The Data Monitor is not an application or a command; it is, instead, a very flexible toolkit providing a set of methods and events for creating an application that can track and/or monitor a few to a large number of items. You may say that you can do this already with session graphics (redlines) in GTVx today, and you probably can to some extent. The Data Monitor was designed to take you past some of the limitations redlines pose in a dynamic environment and provide a richer feature set specifically for items that are not permanent or are constantly changing. Redlines were meant to be stored while Data Monitor items are not stored since they are derived for some existing set of information; thus, Data Monitor performance in regard to adding, deleted, and manipulating is somewhat greater than that of redlines and better support an environment of many constantly changing items for a large number of items.

What can the Data Monitor be used for? Ideally, the Data Monitor can be used with information that has many items with geographical positions, data that changes frequently (either moved, added, or deleted), and data that is temporary (session based versus long term). There are a few applications that should immediately spring to mind:

  • Lightning Strike Monitor – lightning strikes are many, constantly accumulating, and have little meaning after time. The strikes can be represented as Data Monitor Items that can be numerous and while they don’t move, their importance decays with time and can be reflected by their symbology.
  • Outage Management – show calls or trouble facilities in relationship to the GIS data. Calls are session oriented as they are constantly added and eventually deleted. Data Monitor Items can show both call locations, suspected facilities, and duration of outage (by symbology), and other information as tooltips.
  • Vehicle Tracking - show trucks or crews in relationship to the GIS data. The trucks can be moving so their position can change frequently. Trucks can be represented as Data Monitor Items and can carry information such as the crew information, next destination, and status in the form of a tooltip.

These are just a few examples of what the Data Monitor can be used for. Many of the Data Monitor features directly support these types of application:

  • A Data Monitor Item can be a bitmap image, a line, or a shape.
  • A Data Monitor Item can have a user-defined tooltip that displays just by hovering the cursor over the item. Tooltips can be modified when necessary to provide up to date information about the item.
  • Tooltips can be processed by the Data Monitor or Tooltip events can be fired letting the developer show or use the tooltip information.
  • A Data Monitor Item’s display characteristics are zoom level dependent. This feature is ideal for providing overall views of all data items with one set of display characteristics while providing a completely different display when viewing the items up close.
    Data Monitor Items fire events when the cursor hovers over them and when they are selected.
  • Data Monitor Items can be part of select sets and method are provided to select, unselect, and fence them for selection.


There are many useful application of the Data Monitor. Several examples are shown below:









Monday, August 01, 2005

Capturing Feature Events in your Code with GTVx

GTVx has a simple yet power mechanism for allowing features selected in the view to be processed by your code. It may not be clear how to use this functionality at first glance, so this blog entry will attempt to clarify this process.

The process of capturing a feature in your code involves two things: activating the feature capture mode and catching an event that is fired by GTVx when a feature is captured.

The method to activate the feature capture mode is (not too surprisingly) called: ActivateFeatureCaptureMode It takes two parameters: ID and FitlerString.

The ID parameter is the sometimes confusing to developers, but it simply provides a developer-defined id that will appear in any feature captured event fired while in this mode (the uses for this id should become clearer when we look at the Event).

The FilterString parameter is a comma-delimited string of <category Id>:<filter id> pairs used to restrict which features can be selected. The filter id can be an asterisk “*” to indicate that all filter ids in the specified category are allowed. This parameter can be very important for custom applications; for example, if you have a pole inspection application, you only want the user to be able to select poles, so you only give it the pole’s category id/filter id pair. If you did not restrict select to just poles, your code will have to determine if the feature can be processed or not and tell the user that he or she can’t selected that features. The FitlerString can be an empty string which means the user can select anything in the view. This unrestricted access is usually not desired, but is available (and is unfortunately used too much in applications). Two other options are the <SessionPriority> token that will look to see if a session graphic has the same linkage as a regular feature that was selected; if so, the session graphics is always returned. The Session Priority feature is very useful if your application places session graphics on top of regular graphics to indicate something; with the session priority, you will always know you are getting the session graphic if one exists. Here are some examples on how the feature capture mode can be activated:

GTVX1.ActivateFeatureCaptureMode 1, ""

Any feature can be selected in the view.

GTVX1.ActivateFeatureCaptureMode 1, "2:7"

Only features in Category 2 with FilterId 7 can be selected.

GTVX1.ActivateFeatureCaptureMode 1, _
"2:7, 2:10, 2:20, 3:10"

Only features in Category 2 with Filter Id 2, 10, or 20 or in Category 3 with Filter Id 10 can be selected.

GTVX1.ActivateFeatureCaptureMode 1, "2:*, 3:*"

All features in Categories 2 and 3 can be selected.

GTVX1.ActivateFeatureCaptureMode 1, _
"2:7, 3:10, <SessionPriority>"

Features in Category 2 with Filter Id 7 or in Category 3 with Filter Id 10 can be selected. However, if a session graphic has the same linkage as one of these features, it will be returned instead.

The second part of capturing features is an Event that is fired by GTVx when a feature is selected in the view while the feature capture mode is active. The FeatureCaptured event looks like the following:

Private Sub GTVX1_FeatureCaptured(ByVal id As Long, _
ByVal categoryId As Long, _
ByVal offset As Long)

.
.
.

End Sub

The FeatureCaptured event has 3 parameters: Id, CategoryId, and Offset. The Id is the same value specified in the ActivateFeatureCaptureMode. There is only one FeatureCaptured event in your code, so you must use this Id value to tell how the feature is to be handled. It may be that you only have one ActivateFeatureCaptureMode in your code and there is only one thing for this event to do; however, it is usually the case that you capture different features for different reasons and need some way to see how the capture mode was started. For example, if you had an inspection application that has a Pole Inspection mode and a Valve inspection mode. You might have something like this:

Private Sub PoleInspectionCommand_Click()

GTVX1.ActivateCaptureFeatureMode 1, "2:3"

End Sub

Private Sub ValveInspectionCommand_Click()

GTVX1.ActivateCaptureFeatureMode 2, "7:7"

End Sub


Private Sub GTVX1_FeatureCaptured(ByVal id As Long, _
ByVal categoryId As Long, _
ByVal offset As Long)

If mode = 1 Then ' Pole Mode
.
.
.
ElseIf mode = 2 Then ' Valve Mode
.
.
.
End If

End Sub


Note that the PoleInspection activated the capture mode with the id set to 1 and the Valve Inspection activated the capture mode with the id set to 2. Then in the FeatureCaptured event, the id is checked to see if it is 1 or 2. If 1, the PoleInspection code is executed and if 2, the Valve Inspection code is executed. In this example, it would be possible to tell how to handle the captured feature by the feature’s characteristics (since you can get filter id from Category and Offset). However, if your two modes were Edit Pole and Delete Pole, you can tell so easily.

The CategoryId and Offset values are the standard keys to looking up an element in the GTViewer data. Most element related function take these values as inputs. You can also refer to a previous blog entry on determining a feature’s keys from Category Id and Offset.

It should also be pointed out that Capturing Features in GTViewer is very similar to this process. Events are handled slightly differently in GTViewer, so there are some minor coding differences, but the process is the same.