Importing CSV data
Bathymetry data is read into the program from comma separated value (CSV) files. CSV files can be created in Excel or other similar programs. Each 'pixel' is simply a depth in metres, separated by a semicolon or comma. Example files may be found in the program directory.
As CSV is not a standardised format, there are several problems that may occur, depending on the specific file format. Below we list some problems you may encounter.
Upon loading a CSV file, the program will ask whether the values are separated by commas or semicolons. It will also take a guess as to which is the correct one. The CSV files created by different programs use slightly different standards (and can also depend on locale settings, for example MS Excel will use the current locale settings to choose delimiters and decimal separators). For users from countries where numbers are written 123,45
rather than 123.45
this can cause confusion, as a comma is used as a decimal separator rather than a value delimiter.
To ensure correct importation of data, use a decimal point as the decimal separator.
Furthermore, some programs will place quote marks around each field, giving "123.45";"45.6";"42" which is currently not supported for import.
Another problem may be caused by end of line characters - the text characters used to denote the end of a line differ between operating systems. Therefore care should be taken with files created on non-Windows machines (Apple, Linux, FreeBSD etc).
Please note that many files with the .csv
extension are in fact .xyz
files or some variation thereof. CSVEditor expects .csv
files to contain gridded heigh/depth data, representing a raster. A common file format is 3 columns of text data, representing x,y, and depth (sometimes in another order) points. Such files should be opened using the 'Import vector file' dialog.
It is a requirement that there are the exact same number of fields (i.e delimiters) on each line of the file. Note that this is not a requirement for ESRI ascii grid files, in that format the end of a row is found by using the 'ncols' parameter in the ESRI ascii header.
If a particular file is causing problems, this can often be fixed by opening the file in a spreadsheet program such as Excel or LibreOffice Calc and re-saving as a CSV file.
Very large CSV files can easily exceed the maximum size allowable in spreadsheet programs. Large files can be edited with text editors such as Emacs, Vim or Notepad++.
CSV Editor is included, which allows simple editing of CSV data and conversion of shapefile or xyz formats. For more information, see the page CSV Editor.