sentinel-hub/eo-learn

[BUG] >= shapely 1.8.0 .to_wkt() methods on the geometry objects have been removed.

j-desloires opened this issue · 2 comments

Hi,

I have been updated eo-learn to version 0.10.1 and I have an error relative to the shapely release 1.8.0, where .to_wkt() methods on the geometry objects have been removed.

Describe the bug

I have been using the function eolearn.geometry.VectorToRaster function with a geopandas.GeoDataFrame as input format for vector_data parameter.
However, since shapely release 1.8.0 have been removed to_wkt() function, it is not working anymore as we should downgrade to <1.8.0 version in the requirements.

To Reproduce

Steps to reproduce the behavior:

from eolearn.geometry import VectorToRaster

rasterization_task = VectorToRaster(vector_input = shapefile,
raster_feature = (FeatureType.DATA_TIMELESS, "FIELD_ID"),
values_column="FIELD_ID", raster_shape=(FeatureType.MASK, 'IS_DATA'),
raster_dtype=np.uint16)
eopatch = rasterization_task.execute(eopatch)

Environment

python 3.7 with eo-learn 0.10.1

Hi,
the method is only used for 3D geometries. We are looking into fixing it soon, but in the meantime if you transform your geometries to 2D it should still work. You can find some options here

Fixed in version 1.0.0