Skip to content

Commit 3989cab

Browse files
author
Taher Chegini
committed
BUG: Only reproject if the input crs values are not None. [skip ci]
1 parent c0d8021 commit 3989cab

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pygeoutils/geotools.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,8 @@ def geo2polygon(
224224
else:
225225
raise InputTypeError("geometry", "(Multi)Polygon or tuple of length 4")
226226

227-
geom = geometry_reproject(geom, geo_crs, crs)
227+
if geo_crs is not None and crs is not None:
228+
geom = geometry_reproject(geom, geo_crs, crs)
228229
if not geom.is_valid:
229230
geom = geom.buffer(0.0)
230231
geom = cast("Polygon | MultiPolygon", geom)

0 commit comments

Comments
 (0)