(self, tesselation, orig_gdf, unique_id)
Check whether result matches buildings and contains only Polygons.
Check whether result matches buildings and contains only Polygons.
Check whether result matches buildings and contains only Polygons .
def _check_result(self, tesselation, orig_gdf, unique_id):
        """
        Check whether result matches buildings and contains only Polygons.
        """
        # check against input layer
        ids_original = list(orig_gdf[unique_id])
        ids_generated = list(tesselation[unique_id])
        if len(ids_original) != len(ids_generated):

            self.collapsed = set(ids_original).difference(ids_generated)
            warnings.warn(
                f"Tessellation does not fully match buildings. "
                f"{len(self.collapsed)} element(s) collapsed "
                f"during generation - unique_id: {self.collapsed}"
            )

        # check MultiPolygons - usually caused by error in input geometry
        self.multipolygons = tesselation[tesselation.geometry.type == "MultiPolygon"][
            unique_id
        ]
        if len(self.multipolygons) > 0:
            warnings.warn(
                "Tessellation contains MultiPolygon elements. Initial objects should "
                f"be edited. unique_id of affected elements: {list(self.multipolygons)}"
            )
def _check_result ( self , tesselation , orig_gdf , unique_id ) : # check against input layer ids_original = list ( orig_gdf [ unique_id ] ) ids_generated = list ( tesselation [ unique_id ] ) if len ( ids_original ) != len ( ids_generated ) : self . collapsed = set ( ids_original ) . difference ( ids_generated ) warnings . warn ( f"Tessellation does not fully match buildings. " f"{len(self.collapsed)} element(s) collapsed " f"during generation - unique_id: {self.collapsed}" ) # check MultiPolygons - usually caused by error in input geometry self . multipolygons = tesselation [ tesselation . geometry . type == "MultiPolygon" ] [ unique_id ] if len ( self . multipolygons ) > 0 : warnings . warn ( "Tessellation contains MultiPolygon elements. Initial objects should " f"be edited. unique_id of affected elements: {list(self.multipolygons)}" )