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.

Thursday, July 28, 2005

GTViewer – More than a Viewer

Names have a funny way of becoming misleading, especially for software. In the beginning, GTViewer was a “Viewing” product and was aptly named. Now, however, GTViewer has grown and evolved beyond just being a viewer to include a variety of other capabilities, yet its name has not change to describe all of its talents. There are 4 different aspects to GTViewer:



Viewing is the foundation of GTViewer and from this aspect all of the others are possible. Viewing entails the graphical display of geospatially related graphics: Streets, buildings, conductors, mains, transformers, valves, terminals, etc. Viewing is in a seamless map environment that is easy to display what you want to see and easy to go where you need to go. Viewing GIS data is more than simply looking at maps; the database information behind the graphics is just as important and is readily available. Intelligent features are “smart” because of this tabular data and without access to it you are really not viewing GIS data.





Redlining goes hand in hand with Viewing; however, Redlining is a distinct aspect of GTViewer. Redlining allows a non-destructive mechanism for marking on top of your GIS data. Redlining includes more than just the basic drawing tools (lines, circles, shapes, text, etc.); more sophisticated tools are also available like dimensioning, symbols, and hyperlinks. Redlining is not just graphical either; you can add tabular data to your drawings and link them to other files such as photos or documents. Redlines also provide an easy method for GTViewer users to share information in a geospatial manner.




Analysis is a step above Viewing. Instead of just looking at the data as it comes from your GIS, GTViewer can help you analyze the data to see what it means. GTViewer provides two very power tools for analyzing data: Thematic Queries and Feature Counting. Thematic Queries allow you to view all features that match a specified criteria. For example, you can show all cast iron main, all wooden poles, all valves from a particular manufacturer, etc. Combined with GTViewer’s fast display and Emphasize mode, patterns in your GIS data become apparent and provide decision making information. Feature Counting allows point and linear features to be counted within a polygon. A polygon can be an existing feature (such as municipal boundary or tax district boundary) or drawn as a Redline. Feature Counting provides both graphical and tabular results to help you make the most of your data.




Applications is the most powerful aspect of GTViewer. With Applications built on top of GTViewer, you are not limited to what GTViewer provides off-the-shelf. Applications can be used for Inspection, Inventory, or other Data Collection. Even more power from your GIS data is liberated by applications that perform complicated tasks like network tracing, such as outage analysis, value isolation, and load computation. Applications can leverage all of GTViewer’s other aspects, Viewing, Redlining, and Analysis, to implement complete Engineering and Design workflows. GTViewer can be the basis of any application that can use your GIS data.





GTViewer is more than just a viewer. It is a powerful Viewing tool, but is has many other aspects that you can exploit. Redlining and Analysis are just the beginning of what GTViewer can do for you while Applications built on top of GTViewer open the door to opens the door to anything you can imagine with GIS data.

Tuesday, July 26, 2005

Overview Maps

I have seen several Overview Maps created by users lately and all of them have some common problems. I hope this blog entry will help provide information for building better more useful Overview Maps.

The Overview Map is the overall view of the data seen in the Overview Window. GTViewer, Pocket GTViewer, and GTVx all support an Overview Map. See previous blog entry for more info on the Overview functionality.

Here are some key facts about the Overview Window:


  • The Overview Category defines what is in the Overview Window. The Overview Category type is set to 1 in the .GTM file.
  • All contents of the Overview category are shown in the Overview Window. Display Filters will affect the display in the active view, but not in the Overview Window. If you are turning items off with the filter ids in the Overview Category, you probably have these features in the wrong category.
  • The Overview should be simple and have as few elements as possible while still providing “macro” reference information. This goal is sometimes hard to meet depending on the setup of your original data; however, some effort spent here will make your data look better and make the Overview more useful.
  • The Overview Window always uses a Red rectangle to show where the current view is. So, if your Overview Category contains a lot of red, it is hard to find the indicator. Thick styles can also make it difficult to find the indicator. One solution here is to use the [Overview] style definition to make the Overview Window use weight 0, style 0, and gray colors for all elements:

    [Overview]
    Style=0
    Weight=0
    ColorValue=120120120

  • The data range used by the Overview Window is the range provided by the Range or RangeFile entry in the .GTM file. The range defined here should closely bound the data (at least what is in the Overview category) so that there isn’t too much empty space around the data in the Overview window.

Thursday, July 21, 2005

The Roundtrip with GTFormatInfo

Today, there are many different ways to get data collected by GTViewer, GTVx, or Pocket GTViewer back to your GIS. The approach that probably comes to most users’ minds is Safe Software’s FME using the GTViewer Reader. This approach is easy to use and is the most flexible in supporting graphic and tabular information. However, it is not the only solution. GTRead and GTVx can also read collected data and provide a flexible mechanism for processing the information; however, this blog entry is going to be on a tool provided by GTData called GTFormatInfo which requires no programming or additional software.

First, how do you collect data with GTViewer or Pocket GTViewer? This job usually requires an external application like the demo Pole Test/Inspection app delivered with Pocket GTViewer or the Pole and Valve Inspection demos available for GTViewer and GTVx. These data collection apps are easy to implement and are generally just a variation of the templates GTI provides.

The data collections apps generally result in session graphics (redlines) that include embedded tabular data. Let’s say for example, you are using the Pole Inspection app and visit 50 poles. The external app stores the collected data on the redline marks used to indicate that a pole has been visited. These redlines are part of a .GTX extract file or they can be exported as a .GTG file (from a .GTM, GTS, or .GTX file). Either a .GTG or .GTX file is the input file to either FME or GTFormatInfo.

The GTFormatInfo utility is used to extract tabular data embedded on session graphics data in a .GTG file or a .GTX file. The embedded tabular data is applied to user provided templates converting a graphical .GTG or .GTX file into an ASCII file such as an SQL script containing update or insert statements. The GTFormatInfo utility could also be used to create reports or format input for a custom application. The point is, you do not have to be a programmer to access the data contained in the redline elements.

The GTFormatInfo utility is really just a text replacement tool, but it has the ability to select items from the embedded tabular data in the redline graphics to replace tokens with in a template file. You can provide 3 template files: Header File, Entry File, and a Footer File. The Header File is prepended to the output file, and the Footer File is appended to the output file. The Entry File will be written once for each element containing session graphics with embedded data. In the Entry File, you can place special tokens that will be replaced with attributes from data embedded on the session graphics. A token is specified in the following format:

<%ATTR:table.attribute%>

Where table is a table in the embedded data and attribute is an attribute within that table.

If you wanted to create SQL insert statements, an Entry File template might look like the following:

INSERT
INTO COLLECTED_DATA( IPID, DATE, TYPE )
VALUES (<%ATTR:EDIT.IPID%>,'<%ATTR:EDIT.DATE%>',

'<%ATTR:EDIT.TYPE%>');

So if you had 3 session graphics each with embedded data containing a table called Edit with attributes IPID, DATE, and Type, then you would get three records in the output file like this:

INSERT
INTO COLLECTED_DATA( IPID, DATE, TYPE )
VALUES (10023,'7/21/2005',

'PRIVATE');

INSERT
INTO COLLECTED_DATA( IPID, DATE, TYPE )
VALUES (10025,'7/21/2005',

'PUBLIC');

INSERT
INTO COLLECTED_DATA( IPID, DATE, TYPE )
VALUES (10037,'7/21/2005',

'PRIVATE');

The Header and Footer Files are optional but they could be added to make the data more easily work with another application. For example, you might add a Footer File that contains:

commit;
exit;


How you collect and get data back to your GIS will undoubtedly be depended on many different things. There are many tools available to help with this process. GTFormatInfo is a simplistic approach to the problem, but it may be quite usable in many situations.

Wednesday, July 20, 2005

Settings in GTViewer

In GTViewer, the Session Settings Dialog under Options/Settings provides several configurable settings that many users may not be familiar with. In this posting, I will go through each of the settings.




  • CoordinateReadout – This setting has been described in other posting, but its value (none, computed or system) determines how GTViewer will display coordinates (on the status bar and on the Attribute Info dialog’s Element tab) and how the Locate XY dialog will interpret values. The default is Computed and changing it to System or None will only last for the current session. However, you can add an entry in the .GTM file to set the default value (use CoordinateReadout in the [General Info] section). See "Associating a Coordinate System with a Dataset" for related information.
  • Coordinate Readout Precision – This setting determines how many digits will be displayed after the decimal point when coordinates are displayed. You can set it from 0 to 7 digits. The default is one digit; however, if you are displaying coordinates in Latitude and Longitude, you will need more digits displayed. Also, you can set the default precision in the .GTM file with the CoordinateReadoutPrecision entry in the [General Info] section.
  • Locate Single Find – This setting defaults to No, but if it is set to Yes, it will cause a Query to automatically perform a locate if only one record is found. This mode will essentially save you a couple of clicks if you only get one record returned. The Set As Default button is available to permanently change the default and will apply to all session in the future.
  • Logging Level – This setting sets the current logging level. The default is 0 (minimum); however, you can set it up to 5 (maximum) to add more information to the log file. It is sometimes very useful to have additional information in the log file when trying to resolve a problem or optimizing performance. See this previous Blog entry on logging more information. The Set As Default button is available to permanently change the default and will apply to all session in the future.
  • Maximize Initial View – This setting defaults to No, but if set to Yes, it will cause a newly created session to maximize its initial view window. Many users do not use more than one session at a time and the first thing they do is maximize a newly created session’s view. To save this step, you can set the Default to Maximize Initial View. The Set As Default button is available to permanently change the default and will apply to all session in the future.
  • Mouse Wheel Increment – This setting determines how much the mouse wheel will zoom in or out when rolled. The default is 3 times, but it can be set between 1.25 and 4.0. Increasing the value will make the zoom in and zoom out faster when the mouse wheel is rolled as it will go in larger increments; however, you will not have the same degree of control if you only want to change the zoom by a small amount. The Set As Default button is available to permanently change the default and will apply to all session in the future.
  • Move Increment – This setting determines how much a selected session graphics element is moved when using the Ctrl-Arrow Key combinations. This action is normally only used for precision adjustments; however, if you need to change the move increment to a smaller or larger value, this setting can be used. The default is 1000 system units. The Set As Default button is available to permanently change the default and will apply to all session in the future.
  • Open Last File – This setting defaults to No, but when set to Yes, GTViewer will open the last session used automatically when it is started. The Set As Default button is available to permanently change the default and will apply to all session in the future.
  • Repeating Tabular Components – This setting is provided to give users the choice of showing repeating tabular component on a Single Tab (in a grid) or on Separate Tabs in the Attribute Info Dialog box. The Default is Show on Single Tab, but can be changed to Show on Multiple Tabs. GTViewer originally always showed repeating components on multiple tabs. Then, the Grid for similar tabular components was provided and made the default; however, you can still use the old style if needed. The Set As Default button is available to permanently change the default and will apply to all session in the future.

  • Rotation Increment – This setting allows the angle increment selected session graphics elements are rotated (with the Shift-Left Arrow/Shift-Right Arrow or toolbar buttons) to be changed. The default is 5 degrees, but it can be changed to values from 1 to 30 degrees. The Set As Default button is available to permanently change the default and will apply to all session in the future.
  • Scale Increment – This setting allows the scaling factor selected session graphics elements are scaled (with the Shift-Up Arrow/Shift-Down Arrow or toolbar buttons) to be changed. The default is 10% and can be changed to values from 1 to 25%. The Set As Default button is available to permanently change the default and will apply to all session in the future.
  • Show Element Tab – This setting defaults to Yes, but it can be set to No if you want to hide the Element Tab on the Attribute Info dialog. The element tab is not useful to some users and may be confusing. The Set As Default button is available to permanently change the default and will apply to all session in the future.








Thursday, July 14, 2005

Magnify and Overview in GTViewer

GTViewer provides two very useful tools for gaining perspective on your data without constantly zooming in or out. The Magnify and Overview tools are really opposites in what they do, but they can make it very easy to look at your data up close and far away all at the same time without ever modifying your current view.


The Magnify Tool is used to see details around the mouse cursor without having to zoom in or change the view. When the Magnify Tool is activated, a new window is created and the mouse is shown with a box around it. The area in the box is displayed in the Magnify window as a closer zoom level.






The Magnify Window is updated every time the mouse is moved and probably provides a few features that are not commonly known by its users.

  • Double-clicking the mouse will match the zoom level of the current view to the Magnify Window. So, if you see something you like in the Magnify window, double-click the mouse and the current view will be set to match.
  • If your mouse has a wheel, rolling the wheel up or down will increase or decrease the size of the box around the cursor. This action is a very handy way for getting even more detail once you have found an area of interest. If your mouse does not have a wheel, the Page Up and Page Down keys will perform the same tasks.
  • The Magnify Window is movable and resizable. It will also remember the last size and position from one use to the next.



The Overview Tool is somewhat different from the Magnify tools. Instead of providing you with a detailed view of something around the mouse cursor, the Overview Tool creates a new window to show you an overall view of your data with an indicator for the current view location.




The Overview Window is updated every time the view changes and it too probably provides a few features that are not commonly know by its users.

  • Clicking the mouse in the Overview Window will set the current view to that location. You can basically drag the view indicator around the Overview Window to get to the location you want.
  • The Overview Window is movable and resizable. It will also remember the last size and position from one use to the next.
  • The Overview Window’s contents are determined by the Overview Category. All GTViewer datasets must have an Overview category defined and its contents will be used for the Overview Window.
  • A special Style Rule called “Overview” can be defined to override the display of all elements in the Overview Window. Sometimes it is useful to remove the weights, linestyles, and color in the Overview window, but leave the element alone when viewing them in a regular view.

If you have not used the Magnify or Overview tools before, give them a try. If you have used them before, see if any of the features listed here are new to you.

Wednesday, July 13, 2005

Friday, July 08, 2005

GTData Review

GTData currently delivers over 40 utilities for converting, creating, manipulating, and analyzing GTViewer data. Most users may only be familiar with the basic tools to do their conversion, but GTData continues to grow its collection of data utilities. This Blog entry is really just to expose everyone to all that is included with GTData and not to tell how to use them. Documentation on all of the utilities can be found in GTData.doc.

General Utilities

The general utilities are utilities that may be used regardless of the source data type.

  • GTConfig - GUI utility for editing Table Definition files (*.tab) and generating database scripts (for loading data directly out of Oracle). Very useful tool that is probably underused.
  • GTIndex - Creates a spatial index (.gtn) for Graphics files (.gtg).
  • GTAsciiIndex - Creates the Ascii Index (.idx) for a tabular file (data.txt). This index file is automatically created by FV2Ascii and GTConvData, but it is sometimes need when creating your own data.
  • GTSortIdx - Sorts a Tabular Data .idx file.
  • GTRefSort – Sorts a reference index and can create a .fer file from a .ref file.
  • GTQuery - Compiles queries (*.qry) from the Query Definition files.
  • GTTextQuery - Creates a locate query based on the text dump file from GTConv. Used to make text searches from text elements that are not features.
  • GTExtract - Creates an extract file (.gtx) by range from the command line. Identical in functionality to the interactive Extract in GTViewer; however, this one can run in a script.
  • GTPack - Creates an extract file (.gtx) from the command line. Similar to GTExtract except the data is not extracted, it is packed. See previous blog entry for more information on the differences.
  • GTFontEdit – GUI tool for creating and editing Font characters in the GTViewer font format (*.dfn).
  • GTFont - Convert ASCII Font definitions to GTViewer Fonts (*.dfn).
  • GTGetKeys - Creates linkage index for graphics files
  • GTGetOffset - Retrieves coordinate information from dgn files. Can help determine the offset values when preparing for a conversion.
  • GTGetRange - Determines the range of a set of features based on an Attribute value(s).
  • GTGetRange1 - Finds the range of a specific feature in a graphics file.
  • GTDumpMdb - Creates an Ascii dump file (data.txt) from an Access file (.mdb).
  • GTDumpDbf - Dumps the contents of a .dbf file to the Tabular data or a raw pipe delimited format.
  • GTMergeGtg - Merge multiple graphics files (.gtg) files into one .gtg file.
  • GTMergeData - Merge multiple Tabular Data (data.txt) files into one. Also, provides the incremental data support for tabular data.
  • GTUpdateGtg - Integrates an update .gtg file (with adds and deletes) into an existing .gtg file. Part of the Incremental Update tool collection.
  • GTRemap – Remaps the filter ids in a graphics file (.gtg) to another a mapped set of filter ids.
  • GTRemap1 - Remaps element in a graphics file (.gtg) from one (filter id, color, style, weight) to another (filter id, color, style, weight).
  • GTSplitGtg - Split one graphics file (.gtg) file into multiple files based on filter id. A parameter file defines the mapping.
  • GTShiftGtg - Scales and/or Shifts all elements in a graphics file (.gtg).
  • GTRasterIndex - Create raster index shapes for MrSID files.
  • GTCompact - Compacts Group Elements and elements with duplicate element (with same keys and optionally with same filterid).
  • GTTile - Tiles multiple .gtg files into a single .gtg file.

Data Creation Utilities

  • GTGetRecords - Extracts a set of attributes for a specified table from an ASCII data file.
  • GTMakeInter - Creates intersection elements and data files from a delimited text file of values.
  • GTIntersect - Generate intersection nodes from Shapefile street segments. Also, can generate street labels from Shapefiles.
  • GTInterGtg - Creates intersection features from graphics files (.gtg) files (similar to GTIntersect).
  • GTLabelGtg - Create street labels from street line segments in a graphics file (.gtg) (similar to GTIntersect).
  • GTFormatInfo - Extract embedded data from a .gtg file and apply to a template for formatting.


Shapefile Related Utilities

  • GTShapeConv - Data Conversion utility for Shapefile graphics.
  • GTShapeDbfConv - Data Conversion utilty for Shapefile data (*.dbf) files.

DGN based Data Conversion Tools

These utilities are generally used with source data from Framme, Field View, MGE, and Microstation.

  • GTConv - Data conversion utility for FRAMME, FV, MGE, DGN graphics data. This utility may be the used the most if your source data is DGN based. This utility is probably the most complex of the GTData set and has been around the longest.
  • FV2Ascii - Converts a Field View snapshot’s tabular data to the GTViewer tabular format. If you start with Field View data, you would use this tool. If you start with Framme data, you would use GTDataConv.
  • GTFilterUpd - Updates Filter Definition files (*.flt) with FRAMME Feature and component names.
  • GTFRBConv - Creates Field View Rulebase files (*.dta) from FRAMME rulesbase source files (.rdl, .fdl, .cdl, etc.).
  • GTDataConv - Data Conversion utility for database dump files.
  • GTGetUDLSMap - Creates a UDLS map file for GTConv. This file show the user-defined linestyles name map in a DGN file.
  • GTSum - Creates a summary of element information from a set of DGN files including element types used, levels used, colors used, etc.


Thursday, July 07, 2005

The Star Buttons in Pocket GTViewer

There are two buttons on the Pocket GTViewer toolbar that can be customized to do various tasks. These buttons are grayed out if they have not been associated with anything and you may have not given them much though. Generally, these buttons are used to launch external applications, but there are other uses for them as well even if you are not using external applications with Pocket GTViewer.

The Yellow and Blue Star Buttons are on the right side of the toolbar:


The GTVConfig.doc describes in detail how to configure these button. However, it may not be readily apparent even to those who use the Star buttons that they can be assigned to other things besides External Apps.

The DefaultApp1 and DefaultApp2 entries in the [Additional Properties] section of the .GTM file associate the Star Buttons. DefaultApp1 one goes with the Yellow Star and DefaultApp2 goes with the Blue Star. They are usually set to the name of the external app you wish to run; however they can also be set to:

<apps>
<queries>
<gps>

When set to <apps>, the GTV/Applications dialog is activated when the button is pressed. This association is sometimes very useful if you have many external applications (more than two) and it will save you from navigating through the menu to get to the Applications dialog.

When set to <queries>, the GTV/Queries dialog is activated when the button is pressed. If you frequently use queries to navigate the data, this association can be useful.

The <gps> setting will activate the GPS Tracking dialog when its button is pressed. This dialog is normally displayed when you select GTV/Options/GPS Tracking, so it can save several steps if you use a GPS on a regular basis.

Don’t have gray Star buttons any more. Use them to your advantage.

Wednesday, July 06, 2005

GTVx 4.0.x.6 is Available

GTVx 4.0.x.6 is now available.

-----------------------
04.00.00.06 - 7/6/05
-----------------------
  • FIX - Problem with graphic offset and connectivity queries as a result of the large file processing introduced in the previous version.
  • FIX - The Force Black and White print option did not affect colored fonts.
  • FIX - Extraction of Thematic Queries containing more than one prompt would not always produce a complete unique list for the accompanying prompt query.
  • FIX - FitView with Mode 1 was using the threshold for session graphics when it should have only been using the display status.

Tuesday, July 05, 2005

The Log File is your Friend

Most GTI products produce a log file of some kind or another. GTViewer and GTVx produce the most informative ones and these log files can be used to solve various problems. GTWeb Client and GTWeb Server also produce very detailed log files.

When you are setting up GTViewer data for the first time, the log files can be immensely helpful. They always give more details as to what the problem is and the logging level can be increased to a higher level to see exactly what steps led up to the problem. If anyone has called support with a GTViewer problem, I am sure the first question asked was, “What did the log file say?”

In GTViewer, the logfile is very easy to access. There is a command under the Options menu called View Log File. Selecting this command launches the log file in Notepad.

The log file always tells one very important piece of information, the product version. The beginning of each log file created by GTViewer (other products produce similar headers) looks like the following:

1 - Jul 05 12:27:08.625 - (0.000) - <0> - *****************************
2 - Jul 05 12:27:08.625 - (0.000) - <0> - ** GTViewer - Version 4.0.0.20
3 - Jul 05 12:27:08.625 - (0.000) - <0> - *****************************

The log file contains the following information for each entry:
  • Line Number
  • Date/Time
  • Elapsed Time since the application began in seconds “(x.xxx)”
  • Message Level “"
  • Message


The Date/Time and Elapsed Time fields can be used to test performance. This information is especially useful if you are wanting to make the display faster via setting filter or category thresholds. Looking at the log file before and after a change can help identify any performance change and the amount.

The Message Level shows the severity of the message. Message level 0 is either the log file header (as seen above) or an error. If you see a message in the log file other than the header messages, an error has occurred. Message levels range from 0 to 5 and the logging level is set in GTViewer under Options/Settings. Only messages with levels less than or equal to the Logging Level setting will be added to the log file. The default Logging Level is 0 and can be changed to a different value for your current session or it can be set to a new default value. If you are debugging problem, it is usually good to set the logging level to 5 so you will see all of the logging information. Level 5 does produce a significant amount of log file messages, so it is not good to leave logging at this high level unless you are trying to track down a problem or are performing some type of performance analysis.

The GTViewer log file is always called GTViewer.log and is always stored in the operating system’s temp directory for the current user. This path can be in various places depending on your setup. The Environment Variable TEMP will show the location. From a command prompt, you can say:

set temp

to see where the temp path is or you can do something like this:

cd %temp%

And go to the TEMP directory.

GTViewer is not the only GTI product to produce a log file. The other applications also write their log files to the TEMP directory. GTVx’s log file is called GTVx.log; GTConv.exe’s log file is called GTConv.log, etc.

Log files are reset each time an application is run, so if you want to keep the information from a log file between runs of an application, make sure to make a copy of it before running the application again.

Some of the command-line utility in GTData will allow you to specify the location of the log file and the logging level. For example, the –logging flag allows the logging level to be specified and the –logFile flag allows you to specify the location of the log file. These options are common to all utility with logging capabilities.

GTWeb Client places it log file in the operating system's TEMP directory like the other products; however, GTWeb Server makes its logfile available over the internet via the GTWeb Server Administrator web pages (which is very handy when you are not physically at the web server).

Let the log file be your friend if you are having problems. It will usually provide good information as to why you are having a problem when it is not immediate obvious from the application itself. Also, if you are having problem, increase your logging level and keep copies of the files to send to GTI support as this information may speed along the resolution to your problem.

Monday, July 04, 2005

Reading the Linkage off of an Element

A common task when programming with GTViewer or GTVx is to get the Linkage off of an element (for more info on linkages, look here). For example, if an event were fired indicating that an element had been selected, you get the Category Id and the Element Offset of the selected element as parameters in the event. So, how do you get the Linkage stored on the element so that you can lookup database information? It turns out that there are several ways to do this, but I am going to provide a generic approach that should work for most cases.

It turns out that there is a method provided by both GTViewer and GTVx to retrieve the linkage from an element. It is aptly named GetElementLinkage; however, it returns an array of linkage values (since GTViewer data can have 1 to 7 linkage values per element). Most datasets use a 1 or 2 key linkage system and it sometimes, so it sometimes seems cumbersome to deal with an array when you know you will always be getting one or two linkage values. It is pretty easy to write a function in VB to just return you the one key or two keys without having to deal with the array. The example below is for 2 keys, but it should be obvious how to downgrade this code to a 1 key version.

Function GetElementLinkage(ByVal categoryId As Long, _
ByVal offset As Long, _
dataId As Long, _
key1 As Long, key2 As Long) As Boolean

' This function will get the linkage off of the element specified by its
' categoryId and offset. The dataId, key1, and key2 values will be populated.
' If the element contains only a 1 key linkage, key2 will be 0.
' The function returns True if a linkage was found and False otherwise.

GetElementLinkage = False

Dim linkageList As Variant
Dim linkCount As Long

key1 = 0
key2 = 0

If docObj.GetElementLinkage(categoryId, offset, linkageList, linkCount) Then

dataId = docObj.GetDataId(categoryId)

If linkCount > 0 Then

key1 = linkageList(0)

If linkCount > 1 Then

key2 = linkageList(1)

End If

GetElementLinkage = True

End If

End If

End Function


The function above is for GTViewer, but it is very easy to use it with GTVx as well. You can either change the docObj reference to a GTVx1 (or whatever variable name you assigned to the control) or you can add something like the following to your code and use the same code for both GTViewer and GTVX. Write your code for GTViewer making sure to use the correct object when calling the methods (appObj, docObj, or viewObj). For GTVx, just define variables like the ones below in your general section:

Dim appObj As GTVx
Dim docObj As GTVx
Dim viewObj As GTVx

And somewhere in your code, assign the object variables to the GTVx control (Form_Load is a good place to do this):

Private Sub Form_Load()

Set appObj = GTVX1
Set docObj = GTVX1
Set viewObj = GTVX1

.
.
.

End Sub

That is all you have to do. The function is provided in an appendix to the GTVx.doc file. There are other useful code snippets in this document as well.

Friday, July 01, 2005

GTData version 3.0.0.17 is Available

GTData version 3.0.0.17 is now available.

-----------
03.00.00.17 - 07/01/05
-----------
- FIX - FV2Ascii - Problem with the multi-segment feature creating offset RB_PRMRY values in Framme data modes.


- FIX - GTFontEdit - Problem with Move to Front and Move to Back where when selecting empty space after the move. Only affected character with style origins.

- FIX - GTConv - Elements with Tag Element attribute would not respect the UseLevelAsFilterId entry.