xyz-format v3.2.3¶
Mercurial revision 5786:5c8b45563631 | 2026-08-04
Description¶
xyz-format is a tool designed to convert XYZ sounding/elevation files or merge multiple files into a single output file with a chosen format. It supports various input and output formats, allowing for flexible data processing and transformation.
Usage¶
xyz-format [OPTIONS] file1 [file2 ...]
Options¶
General Options¶
Option |
Description |
|---|---|
|
Show this help and exit. |
Input/Output Options¶
Option |
Description |
|---|---|
|
File containing a list of all files to process. |
|
Input format. One of: |
|
Output format. One of: |
|
Root name for the output file. Default: |
|
Variable name in the output. |
Data Processing Options¶
Option |
Description |
|---|---|
|
Column index in the input files where the variable to convert is located. |
|
Name of the variable in the input files to convert. |
|
Header of the input file. |
|
Polygon file to limit the processing area. |
|
Process data as a quadtree to speed up processing and limit storage. |
|
Flip data north-south. |
Data Transformation Options¶
Option |
Description |
|---|---|
|
Minimum value to constrain the output. |
|
Maximum value to constrain the output. |
|
Apply a scale factor to the field data. |
|
Invert the data (equivalent to |
|
File to convert hydrographic level to mean level by adding its values. |
|
File to convert hydrographic level to mean level by subtracting its values. |
|
Deprecated. Identical to |
Masking and Compression Options¶
Option |
Description |
|---|---|
|
Mask value to override the input mask. Required when input format is |
|
Number of pixels for value expansion to unmasked areas. Default: |
|
NetCDF compression level. Default: none. Only useful for |
Deprecated Options¶
Option |
Description |
|---|---|
|
Deprecated. Bathymetry file to merge with. Use |
Examples¶
Basic Conversion¶
Convert a single XYZ file to NetCDF format:
xyz-format -iF XYZ -oF netcdf -o output.nc input.xyz
Merge Multiple Files¶
Merge multiple XYZ files into a single output file:
xyz-format -l file_list.txt -oF grd -o merged_output.grd
Convert with Custom Variable Name¶
Convert a file and specify the output variable name:
xyz-format -iF XYZ -oF netcdf -v elevation -o elevation.nc input.xyz
Apply Scaling¶
Apply a scaling factor of 2.0 to the data:
xyz-format -iF XYZ -oF xyz -scale 2.0 -o scaled_output.xyz input.xyz
Invert Data¶
Invert the data values (equivalent to scaling by -1):
xyz-format -iF XYZ -oF xyz -inv -o inverted_output.xyz input.xyz
Add Hydrographic Correction¶
Convert hydrographic levels to mean levels by adding a correction file:
xyz-format -iF XYZ -oF netcdf -add correction_file.xyz -o corrected_output.nc input.xyz
Subtract Hydrographic Correction¶
Convert hydrographic levels to mean levels by subtracting a correction file:
xyz-format -iF XYZ -oF netcdf -substract correction_file.xyz -o corrected_output.nc input.xyz
Limit Processing Area with Polygon¶
Process only the data within a specified polygon:
xyz-format -iF XYZ -oF xyz -p polygon.txt -o clipped_output.xyz input.xyz
Use Quadtree Processing¶
Process data as a quadtree for efficient storage and faster processing:
xyz-format -iF XYZ -oF netcdf --quadtree -o quadtree_output.nc input.xyz
Set Custom Mask Value¶
Override the input mask with a custom value (e.g., for GEOTIFF input):
xyz-format -iF GIS -oF grd -mask -9999 -o masked_output.grd input.tif
Apply NetCDF Compression¶
Compress the output NetCDF file:
xyz-format -iF XYZ -oF netcdf -deflate 4 -o compressed_output.nc input.xyz
Use Parameter Name for Conversion¶
Specify the name of the variable in the input file to convert:
xyz-format -iF XYZ -oF netcdf --parameter-name "depth" -o output.nc input.xyz
Environment Variables¶
xyz-format does not rely on specific environment variables for its core functionality. However, if used in conjunction with other tools or scripts, ensure that:
File paths are correctly set.
Permissions are properly configured for input/output directories.
Notes¶
Input Formats:
Supported input formats:
XYZ,GIS.If
-iFis not specified, the tool attempts to infer the format automatically.
Output Formats:
Supported output formats:
grd,grd-float,netcdf,xyz,gis.Use
-oFto specify the desired output format.
Data Constraints:
Use
-zminand-zmaxto constrain the output values to a specific range.
Masking:
The
-maskoption is required when the input format isGEOTIFF.The default mask value is
-999999.
Quadtree Processing:
The
--quadtreeoption is useful for large datasets to optimize storage and processing speed.
Deprecated Options:
The
-boption is deprecated. Usemapxyz-unstructuredfor merging sounding files with bathymetry.
See Also¶
mapxyz-unstructured: An alternative tool for merging sounding files with a given bathymetry.