This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import csv | |
""" | |
This script re-orders the values in the x,y and z columns of a text file (e.g. a bathymetry .pts/.xyz file) such that they conform to a true .xyz format readable by GDAL and openable in QGIS. | |
In many cases the data in an "xyz" file falls foul of the GDAL requirement that: | |
“Cells with same Y coordinates must be placed on consecutive lines. For a same Y coordinate value, the lines in the dataset must be organized by increasing X values.” | |
https://gdal.org/en/stable/drivers/raster/xyz.html | |
""" |