GTI GTViewer Reader and Writer Modules

Jump to:

Reader Module

The GTI GTViewer Reader module is intended to read session graphics (or redlines) stored as unextracted graphics files (.GTG) or session graphics embedded in an extract file (.GTX).

The .GTG file format is the default export format for GTViewer products, and is used to exchange session graphics (or redlines) between users.

The .GTG file and the embedded session graphics in an Extract File (.GTX) can contain both geometry and attribute information. Session graphics can embed tabular data in a record-like format which will be interpreted by the Reader module as table records. For example, a Pole Inspection application running on top of GTViewer could collect data from the user and store tabular data on the redline marks that are placed to indicate that a pole was inspected. The Reader module would then read the records and return both the tabular record information and the geometry of the redline graphics. The Reader module will also interpret GT/Field’s embedded data.

The following format attributes are unique to the Reader Module and are available for each GTViewer element that is read:

Parameter

Description

Value Range

gti_categoryId

The category ID associated with the source data. This value may or may not be available.

Unsigned Long value.

gti_categoryName

The textual name of the category associated with the source data. This value may or may not be available depending on the source of the data.

String value.

gti_categoryType

The type of category the source data came from. This value may not be available.

0 – regular

1 – overview

3 – session

gti_filterName

The textual name of the Filter Id used with an element. This value may or may not be available.

String value.

gti_groupId

Each group element is assigned a unique id. All of the sub-elements will also contain this unique ID if group elements are broken apart.

Unsigned Long value.

gti_groupSequence

If group elements are broken apart, each sub-element within a group will have a common gti_groupId value, but they will have a unique gti_groupSequence.

Unsigned Long value.

gti_groupCount

The number of elements in the group. When gti_groupSequence is the count-1, the last element is being processed.

Unsigned Long value

gti_embeddedData

A text string holding the embedded data in its raw format (the \t\a\v format). For more information, see the GTI GTViewer blog post, Creating GTViewer Data with Embedded Data Using FME.

String value.

gti_embeddedDataType

Currently, GTViewer only supports one type of embedded data on its elements which is tabular data of any size in the \t\a\v format.

0 – no embedded data.

1 – tabular data.

gti_offset

The file offset value of the element as it appears in the original data.

Unsigned Long value

The following parameters are used by the Reader Module in the FME Workbench workspace:

Parameter

Description

Value Range

Coordinate Factor X1

Coordinate Factor X2

Coordinate Factor X3

Coordinate Factor Y1

Coordinate Factor Y2

Coordinate Factor Y3

The GTViewer data format is always in an unsigned 32-bit coordinate space. However, the coordinate factors are usually stored in the extract files (.gtx) and graphics files (.gtg) and their conversion back to the original coordinate system is automatic. However, if this information is not available or if you need to manually change the coordinate factors, these parameters can be changed. Generally, these parameters are set to an Asterisk (*) which tells the Reader Module to use the values stored in the data file.

The coordinate factors are used in the following manner by the Reader Module:

DestinationX = (GTViewerX –

CoordinateFactor3X)/

CoordinateFactor2X –

CoordinateFactor1X

 

DestinationY = (GTViewerY –

CoordinateFactor3Y)/

CoordinateFactor2Y –

CoordinateFactor1Y

* - to use the source files settings (if available)

Or any Double precision value.

Expand Group Elements

This parameter determines how groups are handled. If set to text_groups, groups containing only text elements are split apart, allowing text elements to be converted and not lost in an aggregate element that is created by default. If set to all, groups are split into sub-elements. The gti_groupId and gti_groupSequence can be used to identify sub-sub elements.

none,
text_groups,
all

The GTI GTViewer Writer module will produce a GTViewer Dataset including a .GTM file and all of the components necessary to open the dataset in GTViewer. An Extract file (.GTX) can be made from the Unextracted data (.GTM) using GTViewer or GTData utilities (GTPack or GTExtract). Also, .GTG graphics files are created as components referenced by the .GTM file and can be used independently.

The following table shows format properties for the Writer Module that can be used to guide the conversion process. These properties can be used with any element type.

Property

FME Property Name

Description

Value Range

Style Name
Directive

gti_styleName

Identifies the name of a style to assign to an element. This is probably the most important of the directive attributes because it can be used to create a template style map and style definition file for the converted data and will also guide the creation of the filter files based on the style names.

String value

Color Value
Directive

gti_colorValue

Identifies the color value to assign to an element. If this color is not in the current color table, it will be added and a color ID will be associated with the color. This property is different from gti_colorID which is the color ID (0 to 255) in the color table.

<red>,<green>,<blue> component values should be from 0 to 255.

Category ID

gti_categoryId

Unsigned Long value

By default, all features are written to category ID 2 and all overview map features are written to category ID 1 (the data bounding rectangle by default). You can specify the category ID to be any number you want and can have as many as you want (within reason). Valid category ID values are any unsigned long value except 0. A separate .GTG file is created for each unique category Id used.

Filter Group Name

gti_filterGroupName

String value

This attribute is supported by the styleNameMap_byCat and styleNameMap_global Filter Creation modes. It will define which Filter Group the feature will be placed in. It can be used with the gti_filterName attribute.

Filter Name

gti_filterName

String value

This attribute is supported by the styleNameMap_byCat and styleNameMap_global Filter Creation modes. This entry will define the name of the Filter entry (id) used by the feature. It can be used with gti_filterGroupName.

Feature Name

gti_featureName

String value

This attribute can be used to change the Feature name. If it is not specified, the feature name will be the FME Feature Type for the feature.

With the Writer Module, the following rules are observed:

  • A circle is written instead of an ellipse if the primary and secondary axes are the same.
  • If gti_colorId and gti_colorValue are not defined, fme_color is used.
  • The gti_colorId property takes precedence over gti_colorValue.
  • If gti_filterId and gti_styleName are not defined, gti_styleName property is automatically assigned a unique value based on fme_feature_type.
  • The gti_filterId property will take precedence over gti_styleName.
  • The gti_styleName attribute will generate a unique gti_filterId for each unique style name provided.
  • Use the StringConcatenator transformer to create gti_styleName values based on fme_feature_type and any other feature attribute that could be used to drive symbology. An empty style rule will be created for each unique gti_styleName used (and these style rules can be defined later with the GTViewer Style Manager).
  • A maximum of 2500 Filter IDs can be used per category (0 to 2499).

Writer Module

The following Parameters are used in the FME workspace by the Writer module:

Parameter

Description

Value Range

Destination GTI File

The Destination file is a location to a .GTM file that will be created. This file should generally be placed in a new subfolder because all of the component files will be generated in the same folder as the specified .GTM file.

Valid file path.

Coordinate Factor X1,

Coordinate Factor X2,

Coordinate Factor X3,

Coordinate Factor Y1,

Coordinate Factor Y2,

Coordinate Factor Y3,

The GTViewer data format always uses an unsigned 32-bit coordinate space. The coordinate factor parameters must be set so that the incoming data is correctly placed into this space. The following formulas are used to convert incoming data:

GTViewerX = ( SourceX +

CoordinateFactorX1) *

CoordinateFactorX2 +

CoordinateFactorX3

GTViewerY = ( SourceY +

CoordinateFactorY1) *

CoordinateFactorY2 +

CoordinateFactorY3

It is very important to get these values correct or the data in GTViewer will wrap around the coordinate space or lose precision.

GTViewer will preserve the original coordinate information by keeping track of the coordinate factors and applying them in reverse to compute the original coordinate values from the source data.

For Latitude/Longitude values, use the following: X1=200, X2=1000000, X3=0, Y1=200, Y2=1000000, Y3=0

For other projections, make the multiplier (X2 and Y2) large enough to preserve the amount of precision you want to maintain. It is typically 100 or 1000 depending on the units of the source data. The X1, X2 , Y1, and Y2 are used to keep the values positive.

For more information on setting the Coordinate Factor values, see the GTI GTViewer blog post, Coordinate Factors – What are They? How Do You Set Them?

 

Reuse Color File

If set to Yes, the color.txt will be loaded into memory and updated when new data is converted keeping the existing color ID’s static.

If the color.txt file is not found or the parameter is set to No, then a new color file is created each time.

Yes or No

Background Color

The background color in the color file can be set to White or Black with this parameter. Any color can be used if you want to set it in the color.txt file.

White or Black

Filter Creation Mode

 

If set to Enhanced, the filter files will be created with the filter IDs grouped according by the source feature type (all style variations will be under the feature group).

If set to Standard, the original filter file creation will be used. Each filter ID generated will be under a single group called Features.

If set to either StyleNameMap mode, a Style Definition Id is created for each element based on the gti_styleName attribute. The gti_filterName and gti_filterGroupName attributes can be used to set the filter information (which is unbounded from the style rule with these modes). The ByCat mode will create a style name map for each category, and the Global mode will use one style name map for all categories.

For more information on setting the Coordinate Factor values, see the GTI GTViewer blog post, The Style Name Map and Style Definition Id in GTViewer 14.

Enhanced, Standard, StyleNameMap_ByCat, or StyleNameMap_Global

Use Feature Name in Stylename

 

If set to Yes, then the Feature name will be prepended to the gti_styleName field automatically and you do not have to use a Concatenator transformer to prefix the style.

This option is useful if you only use one attribute to drive symbology and you want the feature name prepended. If set to No, the Style name will be the feature name if the gti_styleName field is not set; otherwise, it will be set to the gti_styleName value.

Yes or No