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.
Common CSV Format Issues
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 attempt to guess the correct one.
- CSV files created by different programs may use different standards and locale settings. For example, in some regions,
123,45
is used instead of123.45
. - To ensure correct importation of data, use a decimal point as the decimal separator.
- Some programs wrap each field in quote marks, like
"123.45";"45.6";"42"
– this is not supported for import. - Line endings differ by operating system; files from non-Windows machines may cause problems.
File Type Notes
- Many
.csv
files are actually.xyz
files or a variation, typically containing three columns: x, y, and depth. These should be imported using the Import vector file dialog. - The program requires the same number of fields (delimiters) on each line of the file. This does not apply to ESRI ASCII grid files, where row ends are determined using the
ncols
header parameter. - If import fails, try opening the file in Excel or LibreOffice Calc and re-saving it as a CSV file.
- Very large CSVs may exceed spreadsheet limits. In those cases, use text editors like Emacs, Vim, or Notepad++.
CSV Editor Tool
A CSV Editor is included with dBSea, allowing simple editing of CSV data and conversion from shapefile or XYZ formats. For more, see CSV Editor.
Additional Notes on Bathymetry
Null or Missing Values
When importing bathymetry, it's possible for some pixels to be null, unsurveyed, or marked as NO_VALUE
or NaN
(not a number).
Types of Bathymetry Input
There are different types of bathymetry data:
- Depths only: Land areas are left null. Depths are typically (but not always) positive.
- Both depths and heights: Depths are typically (but not always) negative.
A common dataset is GEBCO, which provides global coverage. While convenient, its resolution is sometimes too coarse for detailed work. GEBCO uses negative values for depths.
Heights and Depths Orientation
Some datasets may have heights and depths swapped, showing land where there should be sea, and vice versa. To correct this in dBSea, go to Tools → Swap heights and depths.
From version 3 onwards, dBSea attempts to automatically detect and correct the orientation of bathymetry, especially for known formats like GEBCO.