Skip to content

landing_geoparquet_data_object

LandingGeoParquetDataObject

Bases: ParquetDataObject

Class that models input geospatial data.

Source code in multimno/core/data_objects/landing/landing_geoparquet_data_object.py
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
class LandingGeoParquetDataObject(ParquetDataObject):
    """
    Class that models input geospatial data.
    """

    ID = "LandingGeoParquetDO"

    def __init__(self, spark: SparkSession, default_path: str, partition_columns: List[str] = None) -> None:

        super().__init__(spark, default_path)
        self.interface: GeoParquetInterface = GeoParquetInterface()
        self.partition_columns = partition_columns

    def read(self):

        self.df = self.interface.read_from_interface(self.spark, self.default_path, self.SCHEMA)

    def write(self, path: str = None, partition_columns: List[str] = None):

        if partition_columns is None:
            partition_columns = self.partition_columns
        if path is None:
            path = self.default_path

        self.interface.write_from_interface(self.df, path, partition_columns)