gpf_common_point_cloud.models.gpf_entwine_params module

Model definition for entwine parameters and related sugar.

class gpf_common_point_cloud.models.gpf_entwine_params.GpfEntwineParams

Bases : object

Object definition for entwine parameters.

absolute: bool | None = None
bounds: list | None = None
dataType: EntwineDataType | None = None
deep: bool | None = None
classmethod from_dict(val: dict) Self

Load object from a dict.

Args

val (dict): dict value to load

Return

Self: object with attributes filled from dict.

Exemple

entwine_params = GpfEntWineParams.from_dict(
                        " {"entwine_params": {
          "dataType": "laszip",
          "span": 128,
          "bounds": [
            0,
            0,
            0,
            100,
            100,
            100
          ],
          "noOriginId": false,
          "absolute": true,
          "scale": [
            0.1,
            0.1,
            0.025
          ],
          "maxNodeSize": 30000000,
          "minNodeSize": 20000000,
          "laz_14": false
        }
    )
input: str | None = None
json_ref_path: Path
laz_14: bool | None = False
loaded_from_json: bool
maxNodeSize: int | None = None
minNodeSize: int | None = None
noOriginId: bool | None = False
output: str | None = None
reprojection: dict | None = None
scale: int | list | None = None
span: str | None = None
srs: str | None = None
subset: dict | None = None
threads: int | None = None
tmp: str | None = None
to_dict() dict

Convert dataclass object into dictionary. Supersedes dataclass.asdict to handle enum value.

Renvoie:

object as dictionary

Type renvoyé:

dict

Exemple

entwine_param = GpfEntwineParam(
    "dataType": "laszip",
    ...
)
print(entwine_param.to_dict())
to_json(**kwargs) str

Supersedes json.dumps using the dictionary returned by to_dict().

Renvoie:

object serialized as JSON string

Type renvoyé:

str

Exemple

from pathlib import Path

# create config file
out_file = Path("/tmp/config.json")
out_file.parent.mkdir(parents=True, exist_ok=True)

# write into the file passing extra parameters to json.dumps
with out_file.open("w", encoding="UTF8") as wf:
    wf.write(entwine_param.to_json(sort_keys=True))