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.

----------- - 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.

----------- - 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.