XYZ2DEM Importer - Notes on Input Text File Formats

XYZ2DEM Importer accepts several delimiters and notations of comments. An example shows common possibilities.

  1. Download and install XYZ2DEM Importer.
  2. Download input data: five_points_without_comments.txt and five_points_with_comments.txt.
Examples: This ImageJ plugin imports X,Y,Z coordinates of (usually irregularly distributed) points from the first 3 columns of a plain text file. Usually the text file looks someway like the example five_points_without_comments.txt:

    9.600   29.600 4000.000
   17.600 2.96e+01 2100.000
   17.600 0037.600 1600.000
    9.600   37.600 8600.000
   13.300   33.300 9999.999

The text parser also accepts different separation characters like colons or commas. Several single-line comments are supported; find out more by studying the example five_points_with_comments.txt below, which leads to the same DEM image as the example above:

// This is a single line comment
#  This is a single line comment

#  Empty lines will be ignored!

#  The following line will be accepted:
    9.600  /* this is a comment */  29.600 4000.000

#  Scientific notation will be accepted:
   17.600 2.96e+01 2100.000

#  More than three numbers in one line will be ignored:
   17.600 0037.600 1600.000  22.2  3.5

#  The following line will be accepted:
9.6;37.6  ,        8600.000

#  The following line will be ignored because
#  the third coordinate is missing:
   12.600   47.600

#  ONE of the following lines will be ignored
#  because X and Y of both points are equal;
#  please check the displayed numbers of
#  accepted and eliminated points:
   13.300   33.300 9111.111
   13.300   33.300 9999.999

It is not recommended to use Java-style multi-line comments, though simple Java-style multi-line comments are supported; nesting single line comments within multi-line comments might yield to unexpected results, please be careful.
Import: Import five_points_without_comments.txt:
Plugins > XYZ2DEM Importer: five_points_without_comments.txt
using the following set of input parameters:
Length of one pixel:  0.1
Maximum edge length:  0.0
Background value:     1600.0

This leads to the resulting DEM image:


Import five_points_with_comments.txt:
Plugins > XYZ2DEM Importer: five_points_with_comments.txt
using the same set of input parameters as above.
Now the parameter window indicates that one points was eliminated:


The resulting DEM image should be the same as the one above.