File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change 57
57
"openeo_processes==0.0.4" , # 0.0.4 is special build/release, also see https://github.com/Open-EO/openeo-python-driver/issues/152
58
58
"gunicorn>=20.0.1" ,
59
59
"numpy>=1.22.0" ,
60
- "shapely<2.0.0" , # https://github.com/Open-EO/openeo-python-driver/issues/158
60
+ "shapely<2.0.0; python_version<='3.9'" ,
61
+ "shapely>=2.0.0; python_version>'3.9'" ,
61
62
"pandas>=1.4.0" ,
62
63
"geopandas>=0.11.0" , # 0.11.0 fixes https://github.com/geopandas/geopandas/pull/2243
63
64
"xarray>=0.16.2" ,
Original file line number Diff line number Diff line change 9
9
from pyproj .exceptions import CRSError
10
10
from shapely .geometry import Point , Polygon
11
11
from shapely .geometry .base import BaseGeometry
12
- from shapely . geos import WKTWriter
12
+
13
13
14
14
from openeo_driver .util .geometry import (
15
15
BoundingBox ,
@@ -249,8 +249,13 @@ def test_spatial_extent_union_mixed_crs():
249
249
250
250
251
251
def to_wkt (geometry : BaseGeometry , rounding_precision = 2 ):
252
- wkt_writer = WKTWriter (shapely .geos .lgeos , rounding_precision = rounding_precision )
253
- return wkt_writer .write (geometry )
252
+ try :
253
+ from shapely import to_wkt
254
+ to_wkt (geometry ,rounding_precision = rounding_precision )
255
+ except ImportError :
256
+ from shapely .geos import WKTWriter
257
+ wkt_writer = WKTWriter (shapely .geos .lgeos , rounding_precision = rounding_precision )
258
+ return wkt_writer .write (geometry )
254
259
255
260
256
261
class TestGeometryBufferer :
You can’t perform that action at this time.
0 commit comments