pointcloudset.io.pointcloud.delimited module
- pointcloudset.io.pointcloud.delimited.ensure_coordinate_columns(df: DataFrame, file_path: Path, format_name: str) DataFrame
Ensure lowercase coordinate columns exist, inferring for headerless data.
If
x,y,zare missing but at least three columns exist, the first three columns are renamed tox,y,zand remaining columns are namedproperty_1,property_2, and so on.- Parameters:
df – Parsed tabular data.
file_path – Source file path used in warning/error messages.
format_name – Human-readable format name (for example,
CSVorXYZ).
- Returns:
A dataframe containing lowercase coordinate columns.
- Raises:
ValueError – If fewer than three columns are available.
- pointcloudset.io.pointcloud.delimited.read_delimited_coordinates(file_path: Path | str, *, format_name: str, default_sep: str | None, fallback_sep: str | None = None, normalize_xyz: bool = False, **kwargs) DataFrame
Read delimited coordinate files with consistent coordinate handling.
The function first attempts to parse with normal header inference, then falls back to headerless parsing when needed. Coordinate handling is unified via
_normalize_xyz_columns.- Parameters:
file_path – Path to the input file.
format_name – Human-readable format name.
default_sep – Default delimiter passed to
pandas.read_csv.fallback_sep – Optional fallback delimiter used when default parsing fails.
normalize_xyz – Whether to convert uppercase
X/Y/Zheaders to lowercasex/y/z.**kwargs – Additional keyword arguments forwarded to
pandas.read_csv.
- Returns:
Parsed dataframe with valid coordinate columns.
- Raises:
ValueError – If parsing fails, coordinates are invalid, or uppercase coordinates are provided without enabling normalization.
- pointcloudset.io.pointcloud.delimited.write_delimited_coordinates(pointcloud: PointCloud, file_path: Path, *, header: bool, sep: str, columns: list[str] | None = None) None
Write pointcloud tabular data to a delimited text file.
- Parameters:
pointcloud – PointCloud instance to serialize.
file_path – Destination file path.
header – Whether to write a header row.
sep – Column separator.
columns – Optional column subset to write; writes all columns when omitted.