Loading Generic Text File

The Open Generic Text File (s) command allows the user to import data from a wide variety of generic ASCII text formats.

Selecting the Open Generic Text File command prompts the user to select the file(s) to load and then displays the Generic Text File Import Options dialog. This dialog allows can be used to specify how the text file(s) are formatted so that they can be imported.

The Generic Text File Import Options dialog has several options that allow you to define how your data is formatted.

Import Type

The Import Type section allows the user to specify how they want the data in the file to be treated. The different import types are defined as follows:


The Coordinate Column Order section allows the user to specify in what order the coordinates are found on coordinate lines in the file. Coordinates can either be x followed by y (i.e. longitude then latitude) or the reverse. Global Mapper supports coordinates in decimal format as well as degree/minute and degree/minute/second coordinates. Files with WKT (well-known-text) coordinate strings, allowing line, polygon, and point feature coordinates all on a single line can also be loaded, in addition to MGRS (military grid reference system) coordinate strings. Elevation values, if present, are always assumed to come after the x and y values.

The Coordinate Format option allows the user to specify how coordinate values are stored. The default option supports several formats, including using the exact decimal representation for the coordinate and automatic recognition of separated latitude/longitude degree values, such as DD MM SS with a large variety of supported separating characters. Support also exists for packed decimal degree values in the formats DDMMSS.S and DDMM.M.  

Coordinate Layout

The Fields to Skip at Start of Linesetting controls what field index (column) the coordinates start in. For Example: If the x and y coordinates are in the 3rd and 4th columns, setting this value to 2 will ensure that the coordinates will be grabbed from the appropriate place.

The Rows to Skip at Start of File setting controls how many lines to skip at the start of the file before trying to extract data. This is useful if  some header lines at the start of the file should be skipped over.

The Coordinate Pair Per Line setting controls how many pairs of coordinates are read per line. How the coordinates are connect is impacted by the import type setting.

Coordinate Line Prefix

The Coordinate Line Prefix section allows the user to specify whether coordinates start at the beginning of the line or if coordinate lines start with some other sequence of characters. For example, some formats may start coordinate lines with the sequence "XY,".

Pressing the Select Coordinate Offset/Scale button displays a dialog that allows the user to select an offset and scale factor to apply to each coordinate. The offset entered will first be added to each coordinate, and then each coordinate will be multiplied by the scale factor.

Coordinate Delimiter

The Coordinate Delimiter section allows the user to specify what character the coordinates are separated by on coordinate lines. If the Auto-Detect option is selected, Global Mapper will attempt to automatically determine the coordinate delimiter.

Feature Classification

The Feature Classification section allows the user to specify what feature type to assign to area, line, and point features imported from the file or the Lidar classification to assign to Lidar features.

If the Include attributes from lines with coordinate data option is selected, any text found after the coordinate values on the line will be included as attributes for that feature.

If a Point Only import is being performed and the Column Headers in First Row of File option is checked, values in the first line from the file will be used as the attributes names for the attributes found in coordinate data lines. This is useful for CSV files and similar.

If the Treat 3rd coordinate value as elevation option is selected and a numeric value is found immediately following the x and y (or lat and lon) coordinate values, that value will be treated as an elevation. Otherwise, the value will be included as an attribute if the Include attributes from lines with coordinate data option is selected. Typically, this option should remain checked unless point data is being imported in which the 3rd column is an attribute that occasionally contains all numeric values (ie; well names).

If line and/or area data do not have non-coordinate lines separating them, but are delimited by a change in a particular field of data, use the Break Line/Area Features on Change in Field option to specify which field (use a 1-based index) indicate a separation of line and/or area data. This will breaking the data into separate line/area features. If the break field consists of 1 and 0 values, where 1 is the start of a new line/area feature, the Break Field is Pen Up/Down (0/1) option can be used.

When generic ASCII text files are imported, Global Mapper will scan the attributes associated with each feature and look for any attribute names that are known to it. The following is an abbreviated list of attribute names that are currently recognized by Global Mapper when generic ASCII text files are read:

Importing a Shape defined as Text

A shape can be defined in a text (.txt) file and then loaded into Global Mapper by using the File -> Open Generic Text File(s).  
Instructions for creating this file are as follows:

Minimum requirements for a shape definition in an ASCII text file is the definition of three vertices, with the initial vertex repeated at the end of the list.

Supported coordinated definitions are:

If Latitude is given before Longitude, the radio button in the ‘Coordinate Column Order’ before ‘Y/Northing/Latitude Coordinate First’ must be selected.

Here is an example of acceptable input and the shape that it produces:

The color of the outline can be modified by appending any of the field titles in Section 7 of the document titled Global Mapper Documentation: Field Options to this file.

Here is an example of acceptable input and the affect on the shape above:

LINE_COLOR=RGB(255, 0, 0)

The width of the outline can be modified by appending any of the field titles in Section 8 of the document titled Global Mapper Documentation: Field Options to this file.

Here is an example of acceptable input and the affect on the shape above:

LINE_WIDTH=6

The style of the outline can be modified by appending any of the field titles in Section 9 of the document titled Global Mapper Documentation: Field Options to this file.

Here is an example of acceptable input and the affect on the shape above:

LINE_STYLE=Dash – Dot

The shape can be filled with color by appending any of the field titles Section 11 of the document titled Global Mapper Documentation: Field Options to this file.

Here is an example of acceptable input and the affect on the shape above:

FILL_COLOR=RGB(0, 0, 255)
CLOSED=TRUE<-this line must be included to fill

 


The shape can have a fill pattern added by appending any of the field titles in Section 10 of the document titled Global Mapper Documentation: Field Options to this file.

Here is an example of acceptable input and the affect on the shape above:

FILL_STYLE=Backwards Diagonal Cross-Hatch
CLOSED=TRUE <-this line must be included to fill


The shape can be named by appending any of the field titles in Section 1 of the document titled Global Mapper Documentation: Field Options to this file.

Here is an example of acceptable input and the affect on the shape above:

NAME=Trapezoid 2

Additional fields may be found in the document titled Global Mapper Documentation: Field Options.  

Here are the entire contents of the file that created the shape above: