File tree Expand file tree Collapse file tree 2 files changed +8
-11
lines changed
Expand file tree Collapse file tree 2 files changed +8
-11
lines changed Original file line number Diff line number Diff line change 3030 has_pygeos = False
3131
3232try :
33- import shapely
33+ import shapely . geometry
3434 import shapely .wkt
3535 has_shapely = True
3636except ImportError :
@@ -171,9 +171,9 @@ def b64decode_converter(
171171
172172
173173if has_shapely :
174- shapely_Point = shapely .Point
175- shapely_Polygon = shapely .Polygon
176- shapely_LineString = shapely .LineString
174+ shapely_Point = shapely .geometry . Point
175+ shapely_Polygon = shapely .geometry . Polygon
176+ shapely_LineString = shapely .geometry . LineString
177177
178178if has_numpy :
179179 np_ndarray = np .ndarray
Original file line number Diff line number Diff line change 1313 has_numpy = False
1414
1515try :
16- import shapely
16+ import shapely . geometry
1717 import shapely .wkt
1818 has_shapely = True
1919except ImportError :
@@ -209,12 +209,9 @@ def escape_shapely(value, mapping=None):
209209 """Convert shapely geo objects."""
210210 return escape_str (shapely .wkt .dumps (value ), mapping = mapping )
211211
212- if hasattr (shapely , 'Polygon' ):
213- encoders [shapely .Polygon ] = escape_shapely
214- if hasattr (shapely , 'Point' ):
215- encoders [shapely .Point ] = escape_shapely
216- if hasattr (shapely , 'LineString' ):
217- encoders [shapely .LineString ] = escape_shapely
212+ encoders [shapely .geometry .Polygon ] = escape_shapely
213+ encoders [shapely .geometry .Point ] = escape_shapely
214+ encoders [shapely .geometry .LineString ] = escape_shapely
218215
219216if has_pygeos :
220217
You can’t perform that action at this time.
0 commit comments