Import Geosoft XYZ

When importing a Geosoft XYZ data file, you have the option of importing selected data, specifying your own template name or changing channel names or types.

Use the Database > Import > Geosoft XYZ menu option (geogxnet.dll(Geosoft.GX.Database.ImportFile;RunForXYZ)*) to import Geosoft format XYZ files into a database.
The Import Geosoft XYZ dialog opens with the current database selected by default. If you do not have a database loaded, you can use the drop-down control to select a database from your current project or click the [Create Database] button to create a new database to import your data.
The topics listed below describe the procedures for importing an XYZ file, display it in a database, and how to use the default template settings.

Import Geosoft XYZ dialog options

Database

The current database is selected by default. Use the drop-down to select another database from your current project or click the [Create Database] button to create a new database. You can also type in a database name, and if the file does not exist in your current project folder, a new database will be created with that name and the default database creation settings.

  • When no databases are present in Project Explorer, the drop-down is not available.
  • [Create Database]

    Select this button to create a new database to import the file(s) into.

    File(s) to import

    Select the XYZ file(s) to import. You can import multiple files by clicking on the Browse button and holding the control key down while selecting the files. All files must be supplied in the same format. See the Application Notes below for more details on XYZ files imports.

    Script Parameter: IMPORT.FILE

    Template

    Select the import template file (.i0 assumed) or click the [Create Template] button to create a template interactively. The system creates channels based on the data contained in the import file. The template file format is described in the Application Notes section below.

    You can also leave this field blank. If the first input file has a channel name header line, they will take effect. If you leave this field blank, the default channel names in order will be X, Y, Z, and if you have more than 3 channels, the assigned default channel names will be X, Y, Z1, Z2, Z3, etc. Later, you can change the channel names to more appropriate names by clicking on the default channel name in the Spreadsheet window and editing the channel name.

    See the Application Notes below for more details on the XYZ import template.

    Script Parameter: IMPORT.TEMPLATE

    [Create Template]

    Select this button to display the Import <XYZ File> template editing tool, which enables you to specify your import parameters and create an import template file (*.i0).

    Import mode

    This controls what will happen when the target data already exists in the database. You can select any of the following options:

    Replace: replaces existing data with incoming data; if a line number already exists in the database, and the same line number is encountered upon import, the existing line/channels in the database are replaced with the imported data. This is the default mode.

    Append: creates a new line; if a line number already exists in the database, and the same line number is encountered upon import, the version of the imported line is incremented by 1, and the existing line remains untouched.

    • For example, if you are importing line "100", and this line already exists, a new line "100.1" will be created.

    Merge Append: if a line number already exists in the database, and the same line number is encountered upon import, the imported line is appended to the end of the existing line. You can then sort the data by the desired channel to ensure that the newly added rows end up in their rightful place.

    Merge: combines incoming and existing data channels on a fiducial basis. If a line number already exists in the database, and the same line number is encountered upon import, and there is a clearly identified FIDUCIAL channel, the imported line is merged and sorted by fiducials. Merging may involve re-sampling of the data to the smallest common fiducial increment. If a fiducial channel is not identified, this option will behave similarly to the Replaceoption.

    Script Parameter: IMPORT.MODE

    Application Notes

    If you do not have an import template, you can create one by clicking on the Create Template button. The template is a text file and can be edited.

    The template builder can extract the channel names from the XYZ file. To this end, channel names must be specified in a comma separated record preceded by a slash. To be recognized, this record must be entered just above or below the first Line number record. See example below:

    //Flight 1

    //Date 2016/06/15

    /Easting,, Northing,, Elevation, Line, Series, Stations, Mag

    Line 15700

    3547079.38 1455006.38 466.88 15700 N 6800.0 58859.49

    3 547088.75 1455014.75 466.75 15700 N 6825.0 58878.37

    See Geosoft ASCII (*.XYZ) Data for more details on the XYZ data format.

    This import acknowledges the line labels. If you are importing flat ASCII files without line labels, refer to the ASCII import. If the import file does not contain line labels, the data will be placed in a single random line (type 'D').

    If the import data is an Archive style file in which the line number is contained in a data column rather than as a line break, the data should be imported with the line number placed in a separate channel. The BRKLINE GX can then be used to break the imported data into separate lines.

    If the "Specify coordinate system on import" setting is set to "Yes" in the General Settings, and if no coordinate system is defined in the current X and Y channels, the "Georeference Database Channels" dialog is called so that the projection can be set on the X and Y.

    XYZ Import Template (*.i*)

    A template file is an ASCII file (with extension .i0), which describes the data format and specifies the Oasis montaj channels in which to place the data.

    The XYZ import uses this file to determine which columns, from the XYZ file, to import and the names and characteristics of the database channels in which to place the data. The import process looks for the line that contains [IMPORT XYZ] then reads the IMPORT instruction lines that follow to determine what data to import.

    IMPORT

    The attributes of the IMPORT instructions are in order:

    column, format, channel, type, width, decimals, dummy

    column

    The XYZ column number.

    By default X and Y are columns 1 and 2. To enter channels into an array channel, enter the start column followed by a colon and the number of elements in the array. The array elements are then assumed to be defined consecutively starting at the start column. For example, 5:16 will read 16 elements into an array starting at column 5.

    format

    The input data format. The supported formats are:

     

    NORMAL
    Any number

    DATE

    date YY/MM/DD or YYYY/MM/DD

    DATE1

    date DD/MM/YY

    DATE2

    date MM/DD/YY

    TIME

    time hh:mm:ss.ss

    TIME2

    time hh.mmss

    GGRAPH

    Geographic dd.mm.ss.ss

    channel

    Database channel name. The special name FIDUCIAL means use this channel as a fiducial base for the data, in which case will be imported at the smallest data increment. If a set of columns have been defined (see 'column'), a VA channel will be created to hold the data.

    type

    Channel data type, one of UBYTE, BYTE, USHORT, SHORT, LONG, FLOAT, DOUBLE or USER## (where ## is the width of an ASCII field).

  • If the STRING type is used for the first column, the line headers will not be automatically split upon import.
  • width

    Display width of the field (string length for strings) on output.

    decimals

    Number of displayed decimal places for FLOAT and DOUBLE on output.

    dummy

    Value used to indicate a dummy. The default is ‘*’. This value is treated as a string and must match the dummy value exactly.

    Following is a sample from an import template:

    [IMPORT XYZ]

    .........................

    IMPORT 5,NORMAL,in,DOUBLE,10,2,9999.99
    IMPORT 6,NORMAL,out,DOUBLE,10,2,9999.99

    Using Default Template Settings

    If you do not make changes to the import template, the system will import data as follows:

    • If you have a comment line in your XYZ file that has the same number of identifiers as there are columns of data, the system uses these names. Use this method for instance with a file that has a comment line with Lat, Long, Mag, and Alt labels plus four columns of data.

    • When you use this method, make sure that the comment line with your labels is the last comment line before the start of data. If there is another line with the same number of channels as data, for instance, that defines units, the system uses these names instead.

    • If you do not have a suitable comment line, the channels are typically named "X", "Y", "Z1", "Z2", etc. Later, you can change the channel names to more appropriate names by clicking on the default channel name in the Spreadsheet window and editing the channel name.

    *The GX.NET tools are embedded in the geogxnet.dll file located in the "...\Geosoft\Desktop Applications \bin" folder. If running this GX interactively, bypassing the menu, first change the folder to point to the "bin" directory, then supply the GX.NET tool in the specified format. See the topic Run GX for more details on running a GX.NET interactively.