Skip to content

Vector import

CSV Editor is able to import vector data from .shp (ESRI shapefile) and .xyz formats. Raster data is generated from the imported vectors via a Delaunay triangulation.

Importing vector data

Open the vector import form with the Import vector file button. On this form, a desired output file size can be chosen by setting the Target x or y length field. The input data will be triangulated to a grid with a maximum side length of the given value. The file to open is chosen, either a .shp (ESRI shapefile) or a .xyz (text XYZ points) file.

Data import and triangulation may take some time, depending on the desired output file size and the number of input points. The current limit for the total number of rows is approximately 2 million, although the exact limit may vary depending on the details of the triangulation.

Shapefile Import

The shapefile format specifies many files that can be part of a 'shapefile'. CSV requires two of these: a .SHP file containing the shapes/contours themselves, and a .DBF database file containing information about the shapes. The z height/depth data for each shape/contour is read from one of the fields in the database file, and all the points in that shape are given that height. A dialog will show upon selecting an import file, asking which field contains the height/depth data. The .SHP and .DBF must have the same name (excluding the extension) and be located in the same directory.

XYZ Import

XYZ is a commonly used format, despite not being well defined. CSVEditor allows some variations on the basic format. When opening an XYZ file, a form is shown with the following information:

  • Data is arranged in 3 columns, giving X location, Y location, and depth/height. Alternatively, columns may be ordered Z, X, Y.
  • Header rows at the start of the file may be ignored. Click in the Ignore column to choose rows to ignore.
  • All data is in metres.

An example file viewed in a spreadsheet program is shown below:

XYZ Import Spreadsheet

Image 1: This image shows an example of an XYZ file viewed in a spreadsheet program.

Here is the same file in a text editor:

XYZ Import Text

Image 2: This image shows the same XYZ file viewed in a text editor.

Fields may be delimited by comma or tab characters (ASCII code 09). Line endings should be Windows-style (ASCII 13, ASCII 10).