py3dtiles.convert module#

class py3dtiles.convert.Converter(tilers: list[Tiler[Any, Any]], overwrite: bool = False, jobs: int = 8, cache_size: int = 3210, crs_out: CRS | None = None, crs_in: CRS | None = None, force_crs_in: bool = False, pyproj_always_xy: bool = False, benchmark: str | None = None, use_process_pool: bool = True, verbose: int = False)[source]#

Bases: object

The Converter class allows for fine-grained conversion process and custom Tilers. It is built with a list of tilers instead of files. Each tiler is responsible to generate a hierarchy of tiles. The process will then build a tileset that will regroup all the tilesets generated by individual tilers.

Parameters:
  • jobs – The number of parallel jobs to start. Default to the number of cpu.

  • cache_size – Cache size in MB. Default to available memory / 10.

  • crs_out – CRS to convert the output with

  • crs_in – Set a default input CRS

  • force_crs_in – Force every input CRS to be crs_in, even if not null

  • pyproj_always_xy – When converting from a CRS to another, pass the always_xy flag to pyproj. This is useful if your data is in a CRS whose definition specifies an axis order other than easting/northing, but your data still have the easting component in the first field (often named X or longitude). See https://pyproj4.github.io/pyproj/stable/gotchas.html#axis-order-changes-in-proj-6 for more information.

  • benchmark – Print summary at the end of the process

convert(files: Path | list[Path], out_folder: Path, overwrite: bool = False) None[source]#

Convert some files.

Parameters:
  • files – Filenames to process. The file must use the .las, .laz, .xyz or .ply format.

  • outfolder – The folder where the resulting tileset will be written.

  • overwrite – Overwrite the ouput folder if it already exists.

Raises:
py3dtiles.convert.convert(files: list[str | Path] | str | Path, outfolder: str | Path = './3dtiles', overwrite: bool = False, jobs: int = 8, cache_size: int = 3210, crs_out: CRS | None = None, crs_in: CRS | None = None, force_crs_in: bool = False, pyproj_always_xy: bool = False, benchmark: str | None = None, rgb: bool = True, extra_fields: list[str] | None = None, color_scale: float | None = None, use_process_pool: bool = True, verbose: int = False) None[source]#

Convert the input files into 3dtiles.

Parameters:
  • files – Filenames to process. The file must use the .las, .laz, .xyz or .ply format.

  • outfolder – The folder where the resulting tileset will be written.

  • overwrite – Overwrite the ouput folder if it already exists.

  • jobs – The number of parallel jobs to start. Default to the number of cpu.

  • cache_size – Cache size in MB. Default to available memory / 10.

  • crs_out – CRS to convert the output with

  • crs_in – Set a default input CRS

  • force_crs_in – Force every input CRS to be crs_in, even if not null

  • pyproj_always_xy – When converting from a CRS to another, pass the always_xy flag to pyproj. This is useful if your data is in a CRS whose definition specifies an axis order other than easting/northing, but your data still have the easting component in the first field (often named X or longitude). See https://pyproj4.github.io/pyproj/stable/gotchas.html#axis-order-changes-in-proj-6 for more information.

  • benchmark – Print summary at the end of the process

  • rgb – Export rgb attributes.

  • extra_fields – Extra fields names to include in this conversion. These field names should be present in each input files. Currently vlrs and evlrs are not supported for las files.

  • color_scale – Scale the color with the specified amount. Useful to lighten or darken black pointclouds with only intensity.

Raises: