rlt_migration.reader.kml_reader module#
- rlt_migration.reader.kml_reader.check_dataset_leaf_kml(leaf_kml_path: Path) [<class 'pathlib.Path'>] #
Check dataset leaf kml and returns list of associated leaf kml
- Paramètres:
leaf_kml_path (Path) – leaf kml file path
- Lève:
InvalidLeafKml – Input leaf kml file is invalid. Check message for more information.
- Renvoie:
list of leaf kml indicated in this leaf kml
- Type renvoyé:
[Path]
- rlt_migration.reader.kml_reader.check_extended_data(data: Element, input_file: Path) None #
Check extented data tag for a placemark in lead kml file
- Paramètres:
data (xml.dom.minidom.Element) – data element
input_file (Path) – input file for element
- Lève:
InvalidPlacemarkElement – Multiple display name or value available for element
- rlt_migration.reader.kml_reader.get_images_list_from_leaf_kml(leaf_kml_path: Path, old_format: bool = False) [rlt_migration.models.image.Image | rlt_migration.models.image.OldImage] #
Get list of image defined in leaf kml
- Paramètres:
leaf_kml_path (Path) – leaf kml file path
- Lève:
InvalidLeafKml – Input leaf kml file is invalid. Check message for more information.
- Renvoie:
list of image available in leaf kml file
- Type renvoyé:
[Image]
- rlt_migration.reader.kml_reader.get_reference_leaf_kml_from_root_kml(root_kml_path: Path) Path #
Get reference leaf kml from root kml.
- Paramètres:
root_kml_path (Path) – root kml file path
- Lève:
InvalidRootKml – Input root kml file is invalid. Check message for more information.
- Renvoie:
Leaf reference kml path
- Type renvoyé:
Path
- rlt_migration.reader.kml_reader.get_support_from_value(value: str) SupportEnum #
Define support from value
- Paramètres:
value (str) – support as string
- Lève:
ValueError – Invalid string value, must be “Ag” or “Nu”
- Renvoie:
converted support
- Type renvoyé:
- rlt_migration.reader.kml_reader.read_image_from_extended_data(extended_data: Element, input_file: Path) Image #
Read image from extended data tag of placemark
- Paramètres:
extended_data (xml.dom.minidom.Element) – extended data element
input_file (Path) – input file for element
- Lève:
InvalidPlacemarkElement – Mandatory value not defined
InvalidPlacemarkElement – Error for value conversion
- Renvoie:
image defined in extended data
- Type renvoyé:
- rlt_migration.reader.kml_reader.read_image_from_placemark(placemark: Element, input_file: Path, old_format: bool = False) Image | OldImage #
Read image from placemark tag
- Paramètres:
placemark (xml.dom.minidom.Element) – placemark element
input_file (Path) – input file for element
- Lève:
InvalidPlacemarkElement – Placemark element is invalid. Check message for more information
- Renvoie:
image defined in placemark
- Type renvoyé:
- rlt_migration.reader.kml_reader.read_old_image_from_extended_data(extended_data: Element, input_file: Path) OldImage #
Read old image from extended data tag of placemark
- Paramètres:
extended_data (xml.dom.minidom.Element) – extended data element
input_file (Path) – input file for element
- Lève:
InvalidPlacemarkElement – Mandatory value not defined
InvalidPlacemarkElement – Error for value conversion
- Renvoie:
image defined in extended data
- Type renvoyé:
- rlt_migration.reader.kml_reader.update_dataset_from_root_kml(root_kml_path: Path, dataset: Dataset) Dataset #
Update dataset with information from root kml and leaf kml files.
- Paramètres:
root_kml_path (Path) – root kml file path
dataset (Dataset) – dataset to be updated
- Lève:
InvalidRootKml – Input root kml file is invalid. Check message for more information.
InvalidLeafKml – Input leaf kml file is invalid. Check message for more information.
- rlt_migration.reader.kml_reader.update_image_geom_from_placemark(placemark: Element, input_file: Path, image: BaseImage) None #
Update image geom_wkt from placemark element
- Paramètres:
placemark (xml.dom.minidom.Element) – placemark element
input_file (Path) – kml input file
image (Image) – image to update
- rlt_migration.reader.kml_reader.update_old_dataset_from_root_kml(root_kml_path: Path, dataset: OldDataset) OldDataset #
Update old dataset with information from root kml and leaf kml files.
- Paramètres:
root_kml_path (Path) – root kml file path
dataset (OldDataset) – dataset to be updated
- Lève:
InvalidRootKml – Input root kml file is invalid. Check message for more information.
InvalidLeafKml – Input leaf kml file is invalid. Check message for more information.