You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a Dask GeoDataFrame, from which I extracted the geometry and performed infill using Shapely. I used geometry.interiors to set an area threshold and fill the holes. After that, I created a new geometry DataFrame. However, I don’t understand why it takes so long when I try to convert the Dask GeoSeries into a GeoSeries. Whenever I use the .compute() command, it takes ages—more than 12 hours. I thought something might be wrong with my approach.
The text was updated successfully, but these errors were encountered:
deffill_holes(geometry, min_hole_size):
""" Fill holes in a geometry (Polygon or MultiPolygon) if they are smaller than min_hole_size. """ifgeometry.geom_type=='Polygon':
ifgeometry.interiors:
new_interiors= [interiorforinterioringeometry.interiorsifPolygon(interior).area>=min_hole_size]
returnPolygon(geometry.exterior, new_interiors)
else:
returngeometryelifgeometry.geom_type=='MultiPolygon':
returnunary_union([fill_holes(poly, min_hole_size) forpolyingeometry])
else:
returngeometry# Apply fill_holes function in parallelfilled=ddf.map_partitions(lambdaddf: ddf.geometry.apply(lambdageom: fill_holes(geom, min_hole_size)))
filled_ser=filled.compute()
I have a Dask GeoDataFrame, from which I extracted the geometry and performed infill using Shapely. I used geometry.interiors to set an area threshold and fill the holes. After that, I created a new geometry DataFrame. However, I don’t understand why it takes so long when I try to convert the Dask GeoSeries into a GeoSeries. Whenever I use the .compute() command, it takes ages—more than 12 hours. I thought something might be wrong with my approach.
The text was updated successfully, but these errors were encountered: