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.

Wednesday, June 29, 2005

Launching GTViewer from other Applications

I was asked last week how can you launch GTViewer from another application. Specifically, the job was to launch GTViewer via GTViewer’s OLE Automation layer, then locate on a specific coordinate. GTViewer has a significant number of methods available via its OLE automation layer; however, all of these methods were originally intended to support the development of application to extend GTViewer’s functionality and always appear as part of GTViewer itself. It took a minor modification to GTViewer to allow this to be done, but the functionality is currently available in version 4.0.0.19. With the addition of only two methods (OpenFile and Show) it becomes possible for other applications to pretty easily launch GTViewer, open a file, and call any of the available methods.

I will present both VB and VC++ code for launching GTViewer, but I will be more detailed on the VB code since I believe that there are more people using VB with GTViewer than VC++.

For VB

The first thing you should do in VB after you create a new project, is select Project/References and browse for the GTViewer.tlb file. This file is delivered with GTViewer and it tells VB how to communicate with GTViewer. After selecting this reference, the intellisense will work in VB for GTViewer types and its methods will show parameters and return types.

Next, you should define three variables in the declaration section. You may or may not use all three, but it is good to have them available:

Dim app As GTViewer.Application
Dim view As GTViewer.view
Dim doc As GTViewer.Document

To launch GTViewer, you use the CreateObject function like the following:

Set app = CreateObject("GTViewer.application")

If GTViewer is already running, it will attach to the running one (only one instance of GTViewer is ever allowed to run for this very reason).

The next step is to turn on the display of GTViewer. The default is to be hidden, so you must explicitly show the application:

app.Show 1


This is all you need to do to get GTViewer running. Now let’s open a file:

app.OpenFile "c:\temp\demo.gtx"

The file can be a .gtm, a .gtx, a .gtw, or a .gts.

The next part is a little tricky. We want to perform some operation on the view, but it takes some time for GTViewer to get the view open and available. One of the Application methods is GetActiveView. We will call this method to get a pointer to the active view that was just created by the OpenFile method; however, we must check to see if it is valid before we try to use it and then try to get it again if it is not.


Set view = app.GetActiveView

Dim count As Integer
count = 10 ' maximum of 10 tried

While view Is Nothing And count > 0
Sleep 250 ' pause a quarter of a second
Set view = app.GetActiveView
count = count - 1
Wend

There are many ways to get a valid view handle, but this seems like the simplest and most straightforward.

Now that we have access to a view, what do we do? I am going to set the view on a particular point that we provide. This job is easy to do with the SetViewCenter method which can location on both system coordinates (internal to GTViewer) or computed coordinates (used by the original data). However, to make this code segment even more usable, I am going to say that our coordinate is a Latitude/Longitude pair. So, we must convert the lat/long values to appropriate values for our data. This is easy to do as well, but there are a few requirements. The FromLatLong method we are going to use depends on the GPS Component being installed and the Coordinate System properly specified in the data (which may or not be done). The FromLatLong method is also part of the Document methods, so we must get a document object to work with:

Set doc = app.GetActiveDocument

Next, if our doc object and view object are valid, we convert the point and call SetViewCenter:

If Not doc Is Nothing And Not view Is Nothing Then

Dim latitude As Double
Dim longitude As Double
Dim x As Double
Dim y As Double

latitude = 34.653138583526
longitude = -86.4846563804903

If doc.FromLatLong(latitude, longitude, 1, x, y) Then
view.SetViewCenter 1, x, y, 1000
End If

End If


I have just hardcoded a lat/long value into the code so that it will have something to locate on.

That’s it! You can use any of the methods GTViewer provides. These methods are documented in GTVx.doc.

For VC++

For the VC++ programmer, I will quickly run through some of the major steps. You will create a new class using the GTViewer.tlb file as the first step. This class is a wrapper for the GTViewer methods and is used like the following:


IAutoMain *m_gtviewer;
.
.
.

double lat =34.653138583526;
double lon = -86.4846563804903;
double zoom = 1000.0;

if (m_gtviewer)
{
delete m_gtviewer;
}

m_gtviewer=new IAutoMain; // Create an instance of GTViewer

COleException e;
if(!m_gtviewer->CreateDispatch("GTViewer.Application", &e))
{
char buf[80];
sprintf(buf, "Error on CreateDispatch(): %ld (%08lx)",
e.m_sc, e.m_sc);
AfxMessageBox(buf, MB_SETFOREGROUND);
return;
}

m_gtviewer->Show(1); // must show the GTViewer app

m_gtviewer->OpenFile(m_file); // Open specified file

long count=10;

LPDISPATCH v=NULL;

while (v==NULL && count>0) // try until a valid dispatch
{
Sleep(250); // sleep a quarter of a second
v = m_gtviewer->GetActiveView(); // Get Dispatch for active view
count--;
}

LPDISPATCH d=NULL;

d = m_gtviewer->GetActiveDocument(); // Get Dispatch for active doc

IDogView view;
IDog doc;

if (v && d) // if a view dispatch was retrieved
{
view.AttachDispatch(v); // attach dispatches
doc.AttachDispatch(d);

long mode=1; // mode 1 = computed coordinates
double x, y;
doc.FromLatLong( lat, lon, mode, &x, &y );
view.SetViewCenter(mode, x, y, zoom);
}

Tuesday, June 28, 2005

Using FME to create your own GTViewer Data

Some of those who read the previous posting on using GTCreate to convert non-GIS data into the GTViewer format asked how it could be done with Safe Software's FME. This approach was mentioned in the previous posting, but I did not describe how to do it. It turns out to be pretty simple as well. The hardest thing about using FME is describing how you did what you did to accomplish a task. So here goes my attempt.

The sample Lightning Strike data was comma separated data. I renamed the file (to lightning.csv from lightning.txt) and I also placed column headers as the first row. The column headers are not necessary, but FME will use them if they are there:

Time, X, Y
6/27/2005 12:42:27 PM, 457382500, 1515628500
6/27/2005 12:42:30 PM, 456551000, 1515066000
6/27/2005 12:42:47 PM, 457590400, 1514540200


In FME Workbench, I created a new workspace and selected a CSV file as the source and GTI_GTViewer as the destination:




This new workspace looks like the following:



Since the .CSV file is just tabular data, we have to add a few FME transformers to create the geometry like we want it. I want the resulting .gtg file to be equivalent to the one produced by GTCreate in the previous post, so this task is slightly more complicated that just doing a default conversion with a single 2DPointAdder transformer.

I am going to add three transformers: a Counter, a Concatenator, and a 2DPointAdder. The data in the .CSV file did not have any kind of ID, so I am using a Counter to just add a new value that gets incremented for each feature (the GTCreate example had a counter too that was incremented for each line read out of the file). The 2DPointAdder takes the X and Y values from the .CSV file and generates a point geometry. I am going to differ from the GTCreate version here by placing a point feature (Symbol) rather than a Circle, but this is a trivial change if you wanted to do it with a circle. Finally, I am going to use a Concatenator to generate the string of data to embed on the new elements. This embedded data string is the same string used with GTCreate that includes the Id and Time of the strike. A big difference can be seen here between the GTCreate and the FME approaches. FME will automatically create an ASCII Data set (data.txt, data.idx, and data.tab) and link the elements to the rows in the data file. However, I used embedded data in the GTCreate version so that the file would be a single self-contained file that still supports reviewable features. If you were going to add this data as a new Category in GTViewer, leaving the data separate and using the linkages is a better approach (See the Linkages and Embedded Data posting for more info on this).

The end result is the following workspace:




Run the Translation and you will get a complete GTViewer dataset that includes a Lightning.gtg file equivalent to the one produced by the GTCreate example.

Probably the only complicated part of this workspace is creating the embedded data. The GTViewer Writer for FME is geared for creating linked data (since this is what you typically do); nevertheless, it is still very easy to embed data on elements. The Concatenator just builds the string using the ID and Time data values and then on the Destination dataset, the gti_embeddedData is set to the result of the concatenation and gti_embeddedDataType is set to 1 (a constant value).

The FME approach is very different from the GTCreate approach, but the end result is the same. The approach you take will probably depend on which tools you have and what you are more comfortable doing. The GTCreate approach does requires some programming skills; however, they are pretty minimal. The FME approach is relatively easy too, but it does require some familiarity with using FME. So, if you can decide which one to use, try them both and see which one works the best for you.

Monday, June 27, 2005

Using GTCreate to create your own GTViewer Data

There are several ways to convert data into the GTViewer format. GTData provides a handful of tool for DGN and Shapefiles, Safe Software’s FME can convert from most GIS formats plus many others, and GTI also has converters for Smallworld, Geodatabases, and G/Technology. However, what if you have data external to your GIS that you would like to see in GTViewer along with your GIS data? And to further complicate this problem, let say that your data is tabular, but does contains some spatial information (such as a GPS coordinate, other coordinate information, or keys linking it to existing GIS features).

This type of data is not that unusual to have. For an example, let’s say we have an ASCII file of lighting strike information containing records with a time an X and Y coordinate of the strike. It turns out to be fairly simple to get this data into the GTViewer format. One of the benefits of using the GTViewer family of products is that you have a variety of methods for creating data in the GTViewer format. Safe Software’s FME is always an option in cases like this, but if you do not have FME or do not know some of the details of using it with custom formats, it may not be a desirable option. Another option is to use GTViewer’s or GTVx’s OLE Automation (and Visual Basic) to programmatically create any elements you need. And yet another option and the topic for this blog entry is to use GTCreate (one of the tools delivered with the GTViewer SDK).

The approaches for using GTViewer’s and GTVx’s OLE Automation and GTCreate to create data are very similar. In each case, you call a method to generate an element after specifying its symbology characteristics, an optional linkages, and optional embedded data. There are a few guidelines for deciding which tool to use for creating GTViewer data from a custom format. GTViewer and GTVx are good options if you need visual confirmation or any real-time graphical cues as the data is converted. Since both GTViewer and GTVx have display capabilities, they are more appropriate when some form of graphical user interaction or verification is required as part of the data creation. A deciding point here is that GTViewer does not required the GTViewer SDK to develop with whereas GTVx does; however, GTVx has significantly more functionality when it comes to creating data programatically. GTCreate does not have any display capabilities and is usually a better choice when converting large amounts of data where performance is more important. Although GTCreate is a fairly simple tool, it is very powerful and the basis for several of GTI’s conversion tools including the Smallworld, Geodatabase, and G/Technology converters.

To illustrate how to use GTCreate, let’s start with an ASCII data file with the following information on lightning strikes:

6/27/2005 12:42:27 PM, 457382.5, 1515628.5
6/27/2005 12:42:30 PM, 456551.0, 1515066.0
6/27/2005 12:42:47 PM, 457590.4, 1514540.2


Then in Visual Basic, create a form with a Command Button on it and a GTCreate control.





The code for the command button is shown below:

Private Sub Command1_Click()

Dim buffer As String
Dim xValue As Double
Dim yValue As Double
Dim dateValue As String
Dim id As Long
Dim row As Long

' open tabular data file
Open "c:\temp\lightning.txt" For Input As #1

' open GTViewer graphics file
id = GTCreate1.Create("c:\temp\lightning.gtg")

' Loop through each tabular record
row = 0

While Not EOF(1)

Line Input #1, buffer ' read line from file

pos1 = InStr(buffer, ",") ' find first comma
pos2 = InStr(pos1 + 1, buffer, ",") ' find second comma

' parse out data value
dateValue = Left(buffer, pos1 - 1)
xValue = Val(Mid(buffer, pos1 + 1, pos2 - pos1 - 1))
yValue = Val(Mid(buffer, pos2 + 1))

' Draw circle with embedded data at strike
GTCreate1.SetProperties id, 3, 2, 0 ' color, weight, style
GTCreate1.SetFill id, 1 ' fill circle
GTCreate1.SetData id, 1, "\tLightning\aId\v" + Str(row) + _
"\aTime\v" + dateValue
GTCreate1.AddCircle32 id, xValue, yValue, 25000

row = row + 1 ' increment row counter
Wend

' close files
GTCreate1.Close id
Close #1

End Sub


This code is very simple. Most of it deals with reading the tabular file and parsing out the values. When this code is run, it produces a file called lightning.gtg. This is a regular GTViewer graphics file and it can be imported as redlines, used as a Category, or merged into an existing Category.

For simplicity, I will just import the .gtg file into GTViewer with Draw/Import and you will see the 3 circles for the lightning strikes:



Since data was embedded on the lightning strike circles, you can also review them with Attribute Info (with no additional effort):



This example is oversimplified, but I hope that it gives you an idea of the power and flexibility you have with a tool like this GTCreate.

Thursday, June 23, 2005

What the heck is GTVx?

GTVx is an ActiveX control version of GTViewer. You can drop GTViewer’s functionality into anything that supports ActiveX control. Most of the applications written with GTVx are based around Visual Basic 6.0 or Visual Basic .NET; however, GTVx is a standard ActiveX control and there are many applications that can make use of it that are not traditional development platforms. In this posting, I will show how you can use GTVx with Excel to enhance a simple report with Map Display capabilities.

Let’s start with a simple report in Excel showing a list of Poles and various information including an X and a Y coordinate. Incidentally, this report was made with GTViewer’s Feature Counting command and pasted in Excel.



Activate the Visual Basic Editor in Excel by selecting Tools/Macros/Visual Basic Editor. Then add a new user form by selecting Insert/UserForm and call it UserForm1.

On your blank form, you need to place the GTVx control. By default, GTVx does not appear on the toolbox containing all of the controls you can place. Right mouse click on the toolbox and select Additional Controls and select GTVx. Place the GTVx control on the form. Then add the following code to the form to show the pole on the selected row in the Spreadsheet:

Private Sub UserForm_Initialize()

If GTVX1.OpenFile("c:\temp\demo.gtx") Then

r = Application.ActiveCell.Row
x = Application.ActiveSheet.Cells(r, 7) ' x position
y = Application.ActiveSheet.Cells(r, 8) ' y position

GTVX1.SetViewCenter 1, x, y, 350

End If

End Sub


This form is simply getting the X and Y values out of the selected row and then centering on the pole at a predetermined zoom level of 350. This code assumes you have a file called demo.gtx in your temp directory, but you could have used GTVx’s DownloadFile method to retrieve a file from the internet if not present, or accessed the file by a UNC name somewhere else on your network. GTVx currently has over 370 methods and captures over 40 events providing a very powerful development environment. However, with all of these methods available to you, it can be very simple to complete a specific task with only 2 methods as seen in this example.





To activate the Map from the spreadsheet, I placed a button at the top of the Report in the Spreadsheet and associated it with the following macro:

Sub ShowMap()

Load UserForm1
UserForm1.Show

End Sub


This macro just loads and shows the created above.

This may be a trivial use of GTVx, but I hope that it shows the power that GTVx can provide to your applications with minimal effort. GTVx can be placed in an existing application to provide map displays and access to your feature tabular information or an entirely new application can be built around it. For more information on developing with GTViewer and GTVx, see is previous Blog posting.

Wednesday, June 22, 2005

GTViewer version 4.0.x.19 is Available

Version 4.0.x.19 of GTViewer is now available.


Readme.txt:
-----------------------
04.00.00.19 - 06/22/05
-----------------------

  • NEW - Number of query slots has been increased from 50 to 100.
  • NEW - Coordinate Factors values now displayed in Properties dialog.
  • NEW - Locate XY will now accept four values in the X prompt and will do a fit.
  • NEW - Feature Count Detail dialog will now show the X and Y for point features.
  • NEW - New Methods -

Application Object

  • boolean OpenFile(BSTR filename);
  • boolean Show(long value);

Document Object

  • boolean FromLatLong(double latitude, double longitude, long mode, double x, double y);

Tuesday, June 21, 2005

Redline Symbols in GTViewer

GTViewer has a variety of Redlining tools ranging from basic line drawing to dimensioning to hyperlinks. Symbol Placement is one of these redlining tools that is sometimes overlooked by the users because it is not enabled by default. However, it is very easy to configure and it can provide an easy way for users to select and place symbols on their maps.

The Redline Symbols are found on the Redline Toolbar and on the Draw Menu.



Clicking on its toolbar button will display the Select Symbol dialog box shown below which support a variety of views.

Icon View:



Detailed View:



The Select Symbol dialog is non-modal and can be left up while using GTViewer. Double-clicking the mouse on one of the symbols will activate the placement mode and the symbol will be attached to the cursor. While moving the symbol around with a mouse or stylus, it can be scale and rotated in various ways (rotation and scaling buttons are on the toolbar and the Shift Key plus an Arrow Key on the keyboard can be used).

A Symbol can be any character from any font defined in GTViewer’s .GTM file. The font can be a standard GTViewer font (.dfn file) or a TrueType font and can be a text font or a symbol font. The Symbols also support a fixed scale (so that they can automatically match the scale of other symbols already used in the data) ; however, they symbols can be scaled and rotated by the user at any time.

The symbols are defined in the .GTM file in the Symbols Section which defines a set of symbol groups and then the symbols that go into each group.

The Symbol Groups will be listed in the Symbol Selection dialog box in a combo box. Selecting a group in the combo box, will display only the symbols for that group. Grouping is an easy way to separate a large number of symbols so they are easy to find and out of the way if not used by a particular set of users.

A group must have a unique number (they do not have to be sequential) and you must have at least one group. Then for each group you define a set of symbols for it to include along with their placement properties. See the GTVConfig.doc file for details on defining a Symbols section in your .GTM file.

Saturday, June 18, 2005

Platforms supported by Pocket GTViewer

With so many versions of Windows CE out there, it may be difficult to determine which platform Pocket GTViewer runs on. All of the following platforms are supported:
  • Windows CE 3.0
  • Handheld PC 2000
  • Pocket PC
  • Pocket PC 2002
  • Windows Mobile 2003 (sometimes called Pocket PC 2003)
  • Window Mobile 2003 Second Edition
  • Window CE .NET

There are 3 different setups for Pocket GTViewer to support these platforms:

1) The Handheld PC setup will support:

  • Windows 3.0
  • Handheld PC 2000

2 ) The standard Pocket PC setup will support:

  • Pocket PC
  • Pocket PC 2002
  • Windows Mobile 2003 (sometimes called Pocket PC 2003)

3 ) The Windows Mobile setup will support:

  • Window Mobile 2003
  • Window Mobile 2003 Second Edition
  • Window CE .NET

It is possible to install and run the Pocket PC setup version of Pocket GTViewer on a Windows Mobile 2003 Second Edition device; however, it will not take advantage of the two most important features of this version: Landscape mode and the Hi-Res mode. If your device does have a Hi-Res display (full VGA - 640x480), then you definitely want to use the Windows Mobile setup of Pocket GTViewer. The Hi-Res display will make your maps look stunning! Also, if you run the Pocket PC version on your Hi-Res screen, the lower resolution is emulated and will actually run slower. Most new devices sold run either Window Mobile 2003 Second Edition or Window CE.NET. Just having a Window Mobile 2003 Second Edition does not mean you have Hi-Res support, but you will have Landscape mode support which is sometimes useful for viewing map data.

Friday, June 17, 2005

In the News - GTViewer at Consolidated Utility Services

Consolidated Utility Services, Inc. recently signed a lease agreement for GTViewer. The hundreds of locators now using GTViewer to work more efficiently throughout the Great Plains will be joined by hundreds more from the eastern seaboard and central Canada. Full release.

Thursday, June 16, 2005

COGNET GIS Advisor Newsletter - June

Check out the latest COGNET GIS Advisor Newsletter:



June 16, 2005 - Vol 1, Issue 3

Current View Extents Dialog in GTViewer

Another useful tool in GTViewer is the Current View Extents Dialog. This tool is found under the View menu and can provide some useful information. The job this dialog performs is very simple. It provides the coordinate range of the active view.



Most of the controls on this dialog are for formatting the range coordinate values.

You can select between Computed and System coordinates. For those who do not know the difference, Computed coordinates are the same are your data’s original coordinate system (whatever that may be). System coordinates are the values actually stored in the GTViewer format. Computed Coordinates are called “computed” because GTViewer runs the System coordinates through a computation to get the Computed values. You may ask why you would ever need the range in System coordinate values. Some of the parameters in the .gtm file and some of the data conversion utilities require System coordinates rather than Computed coordinates. Most of the methods used in development use either System or Computed, but there are some that do require system coordinates.

The range output is always specified as XLOW, YLOW, XHIGH, YHIGH; however, you can select the delimiter and and the number of digits shown after the decimal point.

The Copy button will take the text in the output box and copy it to the Windows Clipboard.

To see how this can be used, set the view as you like it and activate the Current View Extents dialog. Select System Coordinates and the Pipe Delimiter. Then Copy the result to the clipboard. In your .GTM file, you can paste the copied text in as the value for the Range entry:

[General Info]
Range=459094265.21513024023.3462077975.81514784796.7

When you open the .GTM file again, it will fit the data to these coordinates. This task is often performed when setting up data for the first time.

The GTExtract utility can also take a range as a parameter which can be obtained from the Current View Extents dialog. GTExtract will use either System or Computed coordinates (depending on the flag you use) and the coordinates are separated by a space delimiter.

You can also paste the range into the Locate XY dialog discussed in a previous Blog entry to locate on a particular range.

Wednesday, June 15, 2005

GTViewer at Jackson Energy Authority

Look at the the following article at Utility Automation &amp; Engineering T&D web site for information on how JEA uses GTViewer to improve Service Delivery and Maintenance.

Tuesday, June 14, 2005

Locate XY’s Hidden Features

Many of you have probably used the Locate XY dialog in GTViewer and not given it much though. This simple tool is the default item under the Query menu when no queries or external applications are found and is first Query menu item when other items are present. The function of this tool is obvious from its name, but there are several features to this tool that are not readily obvious.



For this seemingly simple Dialog box, you get quite a few features and options:

  • The Locate XY dialog can locate on either System coordinates are Computed coordinates. The mode is determined by the Coordinate Readout selected in the Options/Settings dialog. It is sometimes useful to be able to locate on system coordinates especially when you are setting up data for the first time or doing development.
  • To save time keying in coordinates to locate on, you can key in both the X and Y in the X’s prompt. You can separate the values by a space, a comma, a semicolon, or a pipe.
  • With version 4.0.x.19, you can key in four coordinates in the X’s prompt and a fit will be performed instead of a Locate. Use this feature in conjunction with View/Current View Extents as its output can be pasted directly into the Locate XY dialog.
  • All changes to the view performed by the Locate XY dialog are recorded in the View History and are accessible with View/Location History.
  • The Default Zoom setting in the dialog is defaulted to the DefaultZoomLevel entry in the [General Info] section of the .gtm file. The default is 500 if it is not set (and may likely be the wrong default zoom level).
  • You can remove the Locate XY dialog from the Query menu by adding a LocateXYMenu=0 entry to the [Additional Properties] section of the .gtm file.

These features are really not hidden at all. They are all documented; however, most users do not take the time to research the non-obvious functionality of a simple feature like Locate XY. I hope this entry helps you get more use out of this simple tool.

Saturday, June 11, 2005

The Style Manager in GTViewer

The Style Manager was added to GTViewer in version 3.0.x.31 and has had many upgrades and changes since the current version. Before the Style Manager can be properly described, it is first necessary to describe what Styles are and why you need to Manage them.

“Style” is a word that is probably used too much when describing aspects of GTViewer. There are linestyles, User-defined linestyles, symbol styles, element styles, and dynamic style. Dynamic styles are the type of styles dealt with by the Style Manager. A dynamic style is a Style Definition that is mapped to a particular Category Id/Filter Id pair for a particular zoom level range. A Style Definition defines all of the stylistic properties that can be used when rendering an element:

Display Flag
Color Id
Color Value
Weight
Linestyle
User-defined Linestyle Id
Symbol Id
Font Id
Scale
Fill
Stroke Angle
Offset X
Offset Y
Origin Offset X
Origin Offset Y
Angle Offset
Height Mult
Length Mult
Priority
Border Color Id
Border Color Value
Fixed Scale Flag
Extended Text Style Mode
Extended Text Style Weight
Extended Text Style Color Id
Extended Text Style Value
Justification

Some of these properties will apply to any type of element, and others will apply to specific elements. For example, Color Value will apply to all elements, while Font Id will only apply to Text and Symbol elements. When a Style Definition is applied to an element, any properties defined will override any of the corresponding properties embedded in the element.

A Style Definition is mapped to an element with a mapping rule that tells the Category and Filter Id of the elements (or feature class) and a zoom level range where the specified Style Definition will be used. Since you specify a zoom level range, you can have multiple Style Definitions mapped to the same feature and when the user zooms in or out, the style can change dynamically (hence the name “dynamic styles”).

In GTViewer, the Style Definition and Style Map files (usually called Style.def and Style.map) has been supported since Version 1.0. These files are simple ASCII files that look like the following:

Style.def:

[Style Definitions]

[Switch - Large]
ColorValue=2550255
Scale=5.0

[Gray]
ColorValue=7070255

[Primary Conductor]
Weight=3
ColorValue=2171080

[Secondary Conductor]
Weight=2

Style.map:

[Style Map]

# FilterMapminThreshmaxThreshcategoryfltIdLowfltIdHighStyle

FilterMap0011499Gray
FilterMap0044040Primary Conductor
FilterMap00355Secondary Conductor
FilterMap2500041313Switch – Large

*** The formats and a detailed scription of these files are found in the GTVConfig.doc delivered with GTViewer.

In the past, much of the data converted to the GTViewer format used Instance Based symbology which defines each element’s symbology directly on the element. The color, linestyle, font, etc. were all embedded into each graphical element. Framme, Field View, and Microstation data were the primary users of instance-based symbology. With Smallworld, Shapefiles , Geodatabases, and G/Technology, a different approach is generally taken by applying a style rule to a class of features. Also, with the recent addition of the GTViewer Reader/Writer plug-in to Safe Software’s FME, automatic conversions use the style based symbology approach by default (preparing the styles to be defined since FME does not actually convert the symbology information). GTViewer supports both instance based and style rule based symbology approaches and can use a combination of the two for maximum flexibility. In fact, if you have an Instance Based symbols dataset (such as a Framme dateset), you can usually get a much more usable display by applying a few Dynamic Styles to declutter the screen when zooming out, make certain feature emphasized, or change the printed output to better suite the medium (printing can use a different style definition and map than the display).

With the Style Rule based symbology approach being adopted more and more, it became apparent that a better way of creating the style definition and style mappings was needed. It is okay to edit a couple of text files when you only have 10 or so style definitions, but when you have 1000 or more (as many G/Technology datasets do), you need a better way to create and maintain the style information.

The Style Manager is a GUI tool built into GTViewer and is found under the Tools menu. This tool will allow you to interactively create, edit, delete, import, and export style definitions and style mappings. It has been evolving since GTViewer 3.0 and now provides a very powerful tool for managing your styles.

Main Dialog:

Style Definition Dialog:

Style Mapping Dialog:


If you are currently editing the Style.def and Style.map files with notepad, stop immediately!!! The Style Manager is available and it is much to create or adjust styles with it than with notepad. Also, the Style Manager will lets you make adjustments to the styles in real time seeing immediately what affect they have on the data (no editing with notepad, closeing the dataset, and reopening it to see what the change was). Also, the Style Manager shows all of the features using a particular definition and which mappings were used to do it.

If you do not use Dynamic Styles with your dataset, the Style Manager is a good way to experiment in a non-destructive was to see if your displays or printed output can benefit from this feature. In general, you can improve the appearance with very little effort.

Take time to get to know the Style Manager if you are already using Dynamic Styles or would like to try them.

Monday, June 06, 2005

Hierarchical Query Menus in GTViewer

The number of available slots on the Query menu in GTViewer has been growing over the years. Originally it was 10, then it was extended to 35, then to 50, and now to 100 slots. The upgrade to 35 came with the addition of external applications which also consume menu slots and also introduced the need for Hidden Queries which use even more menu slots. The addition of Thematic Queries also weigh heavily on the slot usage since they typically use a prompt query which also takes a slot.

If nobody inferred this from what I just said, the number of query slots was increased from 50 to 100, therefore someone out there had a need for more than 50 query slots (and maybe more than one). I have noticed that more and more users are defining more and more queries and these long lists of queries sometime run off the screen. You can still select queries when the menu is bigger than the screen, it is just a pain to scroll the menu up and down to find the one you want. Back in version 4.0.x.9, a feature was introduced into GTViewer that allows you to build hierarchical menus in GTViewer, rather than the single level linear menus that have always been supported in the past. This new feature means that you can group queries and only show the group name on the Query menu. The group menu item will pop up the rest of the grouped items when it is selected. This feature is easier to show than to describe. Looking at the Electric/Gas sample data that is delivered with GTViewer, compare how a single level menu looks along side a hierarchical one:



Single Level Menu:





Hierarchical Menu:

Granted, this is a very small example, but if you have 30, 40, or 50 menu items, you can see pretty easily how the group will help. The best thing about grouping your menu items is how easy it is to do. Look below at the two versions of the [Query Info] section to see how the Electric and Gas groups were defined in the example above:

Single Level Menu:

[Query Info]
Query=query1.qry
Query=query2.qry
Query=query3.qry
Query=query4.qry
Query=query5.qry
Query=query6.qry
Query=query11.qry
Query=query7.qry
Query=query8.qry
Query=query9.qry
Query=query10.qry
Query=query12.qry
Query=query13.qry
Query=query14.qry
Query=query20.qry
Query=query21.qry
Query=query22.qry

Hierarchical Menu:

**** Note: I couldn't get the blog to show the pipe symbol correctly, so I just put "[pipe]" to indicate where the pipe symbol goes. Sorry for the confusion. ***

[Query Info]
Query=query2.qry[pipe]Electric
Query=query3.qry[pipe]Electric
Query=query4.qry[pipe]Electric
Query=query5.qry[pipe]Gas
Query=query6.qry[pipe]Gas
Query=query11.qry
Query=query7.qry
Query=query8.qry
Query=query9.qry
Query=query10.qry
Query=query12.qry
Query=query13.qry
Query=query14.qry
Query=query20.qry
Query=query21.qry
Query=query22.qry


Now with a 100 menu slots available, this feature will be more important than ever; however, even with a handful of queries, you may still find a use for this feature.

Monday, May 30, 2005

FME and GTViewer

The GTViewer Reader/Writer Plug-in for Safe Software's FME will be delivered in FME's next release of the Professional Edition of FME. The GTViewer plug-in is currently available in the beta version (build 1685+):

http://safe.com/download/index.php


If you are curious about using FME to convert data into the GTViewer format or using FME to convert GTViewer redlines (graphics and tabular data) into any format supported by FME, you should download an Evaluation version of FME and give it a try.

Friday, May 27, 2005

Documentation gold mine

Hello World,

I just want to give all of you a quick reminder that the file gtvconfig.doc is a gold mine of information. It shows how to set up links. It describes just about everything you can do in the GTM file. It shows the layout of all the fields in a filter file. And the whole style subsystem!

It's delivered in the GTViewer product directory.

Charlie Marlin

Thursday, May 26, 2005

New Features for the Attribute Info Dialog

The Attribute Info Dialog had a makeover in GTViewer version 4.0.x.17. There are two new features that many can take advantage of immediately.

1) Resizable. The Attribute Info Dialog is now resizable just like the Query Result Dialog. The Attribute Info dialog will also remember the last size so if you adjust the size once, it will always be this size until it is changed again.


2) Detail Preview. The Attribute Info Dialog has supported Detail files as links for some time now. See previous posting on Details. The Link tabs would list all associated files, and when activated, an appropriate application was launched through the operating system shell to view the file. Now, if the detail file is a common raster file (such as a .bmp, .jpg, .gif, etc), a new tab is added to the Attribute Info Dialog containing a preview of the raster file. You can still use the Link tab to launch the detail file in an external viewer, but the quick preview can save you a few steps. The Detail Preview is automatic; if there is a link file of a supported type, it will show up as a preview tab.


.

Friday, May 20, 2005

GTViewer 4.0.x.17 is Available

GTViewer version 4.0.x.17 is currently available. This version has major enhancements to the Attribute Info dialog box. It now is resizable and can preview common raster file formats when they are linked to a feature.

-------------------------
04.00.00.17 - 05/20/05
-------------------------
- FIX - The Style Manager did not reset the extended linestyle flag if a dash pattern were specified and then removed.

- FIX - The Default Symbol setting were not being preserved in extract files.

- NEW - The Attribute Info Dialog box is now resizable.

- NEW - The Attribute Info Dialog will now preview standard raster files without having to launch an external viewing app. This includes formats such as .bmp, .jpg, .gif, etc.

- FIX - The Print dialog would not appear when trying to perform a standard print.

- NEW - New Session dialog will take the contents of the prompt and set the current directory to this path (if valid) when the Browse button is pressed.

Tuesday, May 17, 2005

Associating a Coordinate System with a Dataset

For those of you using a GPS receiver with GTViewer or Pocket GTViewer, you have probably had to set the Coordinate System for your data under the GPS receiver setup. This is not a difficult task; however, if you do not have it set correctly, the GPS coordinate will probably be off in space somewhere instead of showing where you actually are on your maps. Once set, the coordinate system setting will remain until it is changed again.

It has always been possible to associate a coordinate system with a dataset by following a few simple steps. Once this is done, the coordinate system will always be correctly set when the dataset is opened and users never have to worry about configuring the coordinate system. Here are the steps to follow:

1) You must first set the coordinate system to the desired setting in the regular manor. This configuration can be done in GTViewer or Pocket GTViewer. Once done, you will be able to find a file called GpsInfo.ini in the product path. For GTViewer, this will be: c:\Program Files\Graphic Technologies Inc\gtviewer and for Pocket GTViewer it will be \Program Files\Graphic Technologies Inc\PGTViewer on the device.

2) Take the GpsInfo.ini file and copy it to the directory containing your .GTM file for the dataset.

3) Add the following entry to the dataset’s .GTM file in the [General Info] section:

GPSInfoFile=gpsInfo.ini

4) The next time you open the .GTM file, the coordinate system will automatically be set. If you want your Extract files to include this additional information, you will have to recreate the .GTX files from this modified .GTM file.

Thursday, May 05, 2005

Detail File Support

GTViewer, GTVx, and Pocket GTViewer all provide support for Detail Files. Detail files are generally files that are not geospatially related to the geographic view of the data. Detail files are sometime referred to as reference files, internal worlds, and linked files. For example, a manhole may have a detailed schematic, a pole may have a photograph or Word document. Details files generally have a drawing indicator in the geographic view to indicate that a detail file exists. A feature itself can also have a detail file record to indicate that a detail file is available (and do not require a drawing indicator).

Detail files are supported in the GTViewer products through the use of links. Previously, there was a posting on Session Links which allows the user to link any file or web page to a redline symbol. Links were originally implemented, however, to support detail files.

Detail files are supported in three different ways:

  • Internally located detail graphics
  • External Files supported by GTViewer, GTVx, or Pocket GTViewer
  • External Files supported by another application


Internally located detail files are like the old Framme detail files that are located in the same design plane as the geographical data, but placed off in an unused area of the coordinate space. Internally located files must be in a format convertible to the GTViewer format; however, they do not have to be previously (and correctly) located in the unused space (GTData utilities are provides to get detail files tiled into an unused area). Internally located detail file provide the most features:

  • Redlining is permitted and stored in session files.
  • Extract data will automatically extract the appropriated internally linked graphics.
  • Feature can be intelligent and queried upon.

External Files supported by GTViewer, GTVx include .GTX, .GTM, .GTS, and .GTW files; and Pocket GTViewer supports the .GTX format. When a Linked file is activated and it is a supported format, GTViewer will create a new view window and opens the file. GTVx fires appropriate events to indicate that a link was selected and the link information.

External Files that are not supported directly by GTViewer will be sent to the operating system Shell and displayed with an appropriate application (if one is available).

There are pluses and minuses to each approach, but it usually comes down to the way the source data is organized to determine which approach to take.

GTData 3.0.0.16 is Availabe

GTData version 3.0.0.16 is Available.

-------------------------
03.00.00.16 - 05/04/05
-------------------------
  • NEW - GTConv - ReduceArcFlag option can now be set to 0 to prevent arcs from being reduced to smaller elements when possible. The default is 1.
  • FIX - GTShapeConv - the maximum number of parts per shape was increased from 500 to 1500.
  • FIX - GTShapeConv - will now Trim Spaces off the left of attribute values so that filter values will more easily match.
  • FIX - GTAsciiIndex - would stop converting if it unexpectedly found a blank line. Will now continue but will report as an error.
  • NEW - GTQuery - Support for filter id ranges in filter id entry, for example: 1,3,5-10,20-45.
  • FIX - GTExtract - Extraction of Thematic Queries containing more than one prompt would not always produce a complete unique list for the accompanying prompt query.
  • NEW - GTInterGtg, GTLabelGtg, GTSortIdx - new utilities added to GTData.
  • FIX - GTExtract, GTPack - support added for very large files.
  • FIX - GTExtract, GTIndex, GTPack - Ability to handle equal signs in Style Names.

GTViewer Version 4.0.x.16 is Available

GTViewer version 4.0.x.16 is now available.

-------------------------
04.00.00.16 - 05/04/05
-------------------------
  • NEW - Extract Dialog now includes an Open File button to immediately open an extract file that was created.
  • NEW - Session Links have been added to quickly and easily place symbols linked to external files or web pages.
  • NEW - Measure Command will automatically pan when close to the edge of the view.
  • 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.
  • CHG - DashPattern segment maximum size changed from 100 to 1000.
  • NEW - Style Manager Import Definition now allows you to ignore imported items if they do not already exist.
  • FIX - Extraction of Thematic Queries containing more than one prompt would not always produce a complete unique list for the accompanying prompt query.
  • FIX - Style Map file can now contain equal signs "=" in the style names.
  • FIX - Style Manager would not recognize different colors with a collective edit and would overwrite them to a single color value.
  • FIX - Style Manager Definition deletes or replacements during import would leave the mapping items with undefined style definitions. This caused problems when the view updated using a bogus definition.

Hang graphics off the cursor

Sometimes in an application you want an element to track with the cursor for interactive placement. Here is a snippet, taken from one of our demo applications, that does just that.

...start snippet...

' Set new graphics so they are hung off the mouse for placement

Dim newCategoryId As Long
Dim newOffset As Long

newCategoryId = GTVX1.GetLastDrawnCategoryId
newOffset = GTVX1.GetLastDrawnOffset

If GTVX1.SelectElement(newCategoryId, newOffset) Then ' newly placed graphics

GTVX1.ActivateSelectedElementMove ' activate selected element move mode
GTVX1.RefreshView

End If

...end snippet...

In case your app is not with GTVx, but is an external app for GTViewer, just change the "GTVX1" part to "docObj" for the two lines that get the new categoryId and offset, and change "GTVX1" to "viewObj" for the three lines in the "If" paragraph.

Happy app dev!

Monday, May 02, 2005

Session Links

A new feature has been added to GTViewer called a Session Link. A Session Link will “link” a note, an external file, or web page to a redline symbol placed by the user.

This functionality is not new to GTViewer. Links (or hyperlinks) have been supported since version 2.0.x.34 providing the ability to associate external files with features. Links are primary used to associate detail drawings to features in the geographic view. For example, a Manhole feature may have one or more schematic drawings associated with it or a pole may have a photograph associated with it. So when a user reviews the manhole or pole, a tab in the Attribute Info dialog indicates that Link files are available and can be viewed by double-clicking on them. The Link functionality was also able to interpret link information embedded into redline elements, so it was (and still is) possible to create an external application in VB to associate redlines with external files via the existing Link functionality.

The Session Link is now a standard redline drawing command (starting with GTViewer 4.0.x.16+) that captures information for a note, or the location of an external file, or a web page and embeds the appropriate information on a symbol and initiates the symbol placement. This streamlined process provides the common functionality needed to link notes, external files, or web pages to redline elements; however, external application can still be written to provide more complex implementation.

Thursday, April 28, 2005

COGNET GIS Advisor Newsleter - April

Check out the second COGNET GIS Advisor Newsletter for more information on the GTViewer Family of Products:



April 28, 2005 - Vol. 1, Issue 2

Wednesday, April 27, 2005

Category vs. Non-Category Raster

GTViewer and GTVx support a variety of raster configurations. These different configurations are determined by your needs, you raster file type, and your intended uses. This post will try to clarify the differences between the configurations and will hopefully provide enough information to allow you to determine which type of raster is best for you.

GTViewer divides data up in to Categories. The structure of your original data usually determines how Categories are laid out for GTViewer; however, there are no hard-and-fast rules as to how this is done. Categories have their own display controls (display status, min threshold, max threshold). All of the raster formats supported by GTViewer and GTVx can be used in a Category configuration meaning that you can create a Category for one or more raster files. When this Raster category is turned on, the raster files are displayed and the display thresholds defined for the category will automatically turn all of the raster files on or off according to the zoom level. Raster Catgories can support all GTViewer supported raster formats (ECW, MrSID, CIT, RLE).

GTViewer and GTVx also support a Non-Category Raster configuration where a list of raster files (ECW or MrSID) is supplied along with an independent display status and threshold for each file. The Raster Display Filter Dialog allows the user to independently control the display of each Non-Category Raster file.

Pocket GTViewer has limited raster support, but it does support the ECW file format in a Non-Category Raster configuration. The raster requirements on the Pocket PC or Windows Mobile platforms are generally much different than on the Desktop because of the limited resources of the devices. This configuration seems to work best on devices. Originally, the Non-Category configuration was only for Pocket GTViewer, but its usability was so good that the functionality was also integrated into GTViewer and GTVx.


Raster Summary:

GTViewer and GTVx both support the following Raster Configurations:
  • ER Mapper’s ECW raster format in Category and Non-Category configurations
  • Lizard Tech’s MrSID raster format in Category and Non-Category configurations
  • Intergraph CIT Binary raster format in Category configurationsIntergraph RLE Binary raster format in Category Configurations

Pocket GTViewer supports the following Raster Configurations:

  • ER Mapper’s ECW raster format in Non-Category configurations.

Friday, April 15, 2005

GTViewer 4.0.x.15 is Available

GTViewer version 4.0.x.15 is now available. This version contain several changes to the Style Manager to make it easier to use. Printing has also been enhance to allow a user defined note in the border as well as a user defined view for the overview pane. A variety of other additions and fixes are listed below:

-----------------------
04.00.00.15 - 04/15/05
-----------------------

- FIX - Composite Lines and Composite Shapes did not let you select areas where
gaps between component elements were. When composite elements are drawn, the
gaps are filled in.

- FIX - Magnify did not show raster for non-category raster.

- FIX - Deleted Elements in Category Data were being displayed.

- NEW - Print Overview can be defined as a view.

- NEW - Print Overview can be set to Small, Medium, or Large.

- NEW - Border Note Field added to Print Dialog.

- NEW - Style Manager will not allow edits on multiple style definitions at
the same time (same edit will be applied to all common properties).

- FIX - Style Manager will now keep the style definition selected and in the
same spot in the list after an edit to a style definition.

- NEW - A horizontal scroll bar has been added to the Style Definition list box.

- FIX - Style Manager Delete Style Definition did not work correctly.

- NEW - Style Manager Delete can now delete all selected Style Definitions.

- NEW - Style Manager now has Import Map and Import Def commands.

- NEW - Style Manager supports a category filter on the style definition display.

- CHG - Query Processing and Attribute Info lookup have been changed to support
very large files.

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

- NEW - Links can now use URL addresses.

GTVx 4.0.x.5 is Available

GTVx version 4.0.x.5 is now available. An excerpt of the readme.txt is shown below. This version has only minor changes. The most significant item is the addition of the the Double Click event in the Data Monitor.

-----------------------
04.00.00.05 - 04/15/05
-----------------------

- FIX - Deleted Elements in Category Data were being displayed.

- NEW - DMSetProperty and DMGetProperty now support the DoubleClickEvent property
for enabling or disabling the double click event for data monitor items.

- CHG - Query Processing and Attribute Info lookup have been changed to support
very large files.

- NEW - Links can now use URL addresses.

- NEW - New Events:

void DataMonitorItemDoubleClick(long clickType,

double x, double y, long itemId)


Wednesday, April 06, 2005

Using a GPS with GTViewer and Pocket GTViewer

GTViewer and Pocket GTViewer can all use a GPS to update their view position and reflect an actual location in real-time. The GPS functionality allows the use of any GPS receiver supporting the standard NMEA protocol or Trimble’s TSIP protocol. GPS receivers are generally connected to a COM port; however, modern GPS devices also use BlueTooth, PCMCIA slots, CF slots, and can be built into the laptop or handheld computer.

A GPS receiver is a nice addition to map viewing because it will keep the view centered on your location without having to manually pan, zoom, or query to get there. This “view synchronization” runs in the background and doesn’t prevent GTViewer from using any of the other commands (like Attribute Info, redlining, etc.). Even with inexpensive GPS receivers whose accuracy may not be precise enough to capture location points, it is still quite satisfactory for view synchronization.





GTViewer and Pocket GTViewer both provide several modes of operation. The GPS indicator can be set to obey one of the following 4 rules:

  • Keep In View Mode – the indicator will move around the view, but if it leaves the current view area, the view will be updated so that the indicator re-centered. This mode is ideal if you are moving slowly or covering a small area because the view will not continuously update because of the movement.
  • Keep Centered Mode – the indicator is always in the center of the view and the map moves under it. This mode is good for driving as the cursor is fixed and the map moves under it; however, this mode does require many more view updates and make it more difficult to perform other tasks when moving.
  • Free Mode – the indicator will be displayed, but the view will not update to keep it visible. This mode unhinges the GPS indicator from the view turning off the view synchronization, yet still showing the GPS cursor when it is in the view.
  • Centered/No Indicator Mode – identical to Keep Centered, except the indicator is not drawn. This mode is good if you are just interested in keeping the view synchronized with the current location, but do not want the indicator displayed in the view.

The GPS indicator not only shows the position on the map, it also has a small red arrow head showing the current bearing.

GTViewer and Pocket GTViewer also provide two different trail modes. A trail is a line drawn along the path the GPS indicator follows. The Redline Trail mode leave a redline along the path and it can be saved, exported, shared, etc. The Decaying Line mode draws a trail of a user specified length, but the line is temporary and will shrink over time. The line is draw in Red and “cools” to Blue.

GTViewer and Pocket GTViewer both have a GPS Info dialog that shows detailed information about the current GPS readings. One page shows the tabular data like Latitude/Longitude/Altitude, HDOP/PDOP/VDOP, Bearing and Speed, and Satellites in Use/Signal Quality/GPS Time. The second page is a skyplot showing the relative position of each satellite and its signal strength.







The GPS functionality also supports two simulation modes. One simulation will read a file of Latitude/Longitude pairs and “play” them back as if they where actually being received by a GPS receiver. The second simulation mode will read an NMEA stream from a file and “play” it back as if it were being received by a GPS receiver. The difference in the two modes is that mode uses a source file that can be easily manufactured with some known points. The other mode uses a richer set of information and runs all of the GPS Info settings including the Skyplot, the drawback is that the file is usually much larger and needs to be captured from an actual GPS receiver at some point.

Friday, April 01, 2005

GTVx 4.0.x.4 is Available

GTVx version 4.0.x.4 is now available. An excerpt from the readme.txt file is shown below:

-----------------------
04.00.00.04 - 04/01/05
-----------------------

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

- FIX - Elements that use a style rule to control the weight were not highlighted correctly. The element weight was used instead.

- NEW - Four new style added for dimension elements. Start Arrow Outside, Start Arrow Inside, End Arrow Outside, End Arrow Inside.

- FIX - Dimension Dialog did not use a Droplist for style.

- NEW - Default Symbol can now be specified.

- FIX - The InterpolatePointOnElement did not work when the reverse flag was used.

- FIX - The Tab Order on Query Dialog boxes with more than 3 prompts was not correct.

- FIX - InterpolatePointOnElement returned -1 instead of FALSE for invalid Category.

- FIX - Measure values were not computed correctly using coordinate factors.

- FIX - Custom background colors were reset after a print or print preview.

- FIX - Problem with using the control to select or unselect session graphic elements.

- NEW - Dimension and Leader Line modes are now supported.

- FIX - Magnify did not show raster for non-category raster.

- NEW - New Methods:

boolean ActivateDrawDimensionMode();
boolean ActivateDrawLeaderLine(long mode);