py3dtiles.reader.xyz_reader module

Reads points from a .xyz or .csv file

Consider XYZIRGB format following FME documentation(*). We do the following hypothesis and enhancements:

  • A header line defining columns in CSV style may be present, but will be ignored (please open an issue if you have a use case where the header is important)

  • The separator separating the columns is automagically guessed by the reader. This is generally fail safe. It will not harm to use commonly accepted separators like space, tab, colon, semi-colon.

  • The order of columns is fixed. The reader does the following assumptions: - 3 columns mean XYZ - 4 columns mean XYZI - 6 columns mean XYZRGB - 7 columns mean XYZIRGB - 8 columns mean XYZIRGB followed by classification data. Classification data must be integers only. - all columns after the 8th column will be ignored.

NOTE: we assume RGB are 8 bits components.

(*) See: https://docs.safe.com/fme/html/FME_Desktop_Documentation/FME_ReadersWriters/pointcloudxyz/pointcloudxyz.htm

py3dtiles.reader.xyz_reader.get_colors(points: ndarray[Any, dtype[float32]], feature_nb: int, color_scale: float | None, with_rgb: bool) ndarray[Any, dtype[uint8]] | None[source]
py3dtiles.reader.xyz_reader.get_csv_infos(f: TextIOBase) tuple[bool, int, str][source]
py3dtiles.reader.xyz_reader.get_metadata(path: Path, color_scale: float | None = None) MetadataReaderType[source]
py3dtiles.reader.xyz_reader.run(filename: Path, offset_scale: tuple[ndarray[Any, dtype[float64]], ndarray[Any, dtype[float64]], ndarray[Any, dtype[float64]] | None, float | None], portion: tuple[int, ...], transformer: Transformer | None, color_scale: float | None, with_rgb: bool, extra_fields: list[ExtraFieldsDescription]) Iterator[tuple[ndarray[Any, dtype[float32]], ndarray[Any, dtype[uint8]] | None, dict[str, ndarray[Any, dtype[Any]]]]][source]