vyperdatum.drivers.xyz

Attributes

logger

Classes

XYZ

Handle loading and parsing of a generic .xyz.

Module Contents

vyperdatum.drivers.xyz.logger
class vyperdatum.drivers.xyz.XYZ(input_file: str, invalid_error: bool = True, skiprows: int | None = None, col_names: List[str] | None = None, negate_z: bool = False, unit_conversion: float = 1.0)

Bases: vyperdatum.drivers.base.Driver

Handle loading and parsing of a generic .xyz.

input_file

Full path to the xyz file.

Type:

str

invalid_error

If True, throws an error when the input file has an unexpected format.

Type:

bool = True

skiprows

The number of rows at the beginning of the file to ignore.

Type:

Optional[int] = None

col_names

The names of the columns in the file. If None, defaults to [‘x’, ‘y’, ‘z’].

Type:

Optional[List[str]] = None

negate_z

If True, negates the z values in the file.

Type:

bool = False

unit_conversion

A factor to convert the z values to the desired unit.

Type:

float = 1.0

Pseudo Example
--------
>>> xyz = XYZZ('PATH_TO_NPZ_FILE')
>>> df = xyz.transform(crs_from=crs_from, crs_to=crs_to, steps=steps)
>>> print(df.head())
>>> xyz.to_gpkg(crs=crs_to, output_file=output_file)
input_file
abstract wkt() str

Return wkt stored in the xyz file. Will raise NotImplementedError as xyz files do not have a dedicated attribute for WKT.

transform(transformer_instance, output_file: str, pre_post_checks: bool, vdatum_check: bool) bool

Apply point transformation on npz data according to the transformer_instance.

Parameters:
  • transformer_instance (vyperdatum.transformer.Transform) – Instance of the transformer class.

  • output_file (str) – The output file path where the transformed data will be saved.

  • vdatum_check (bool) – If True, performs vertical datum checks after transformation.

Returns:

True if successful, otherwise False.

Return type:

bool

to_npy(output_file: str) None
to_gpkg(crs: str, output_file: str) None
property is_valid