petern48 commented on code in PR #2267:
URL: https://github.com/apache/sedona/pull/2267#discussion_r2268064903
##########
python/sedona/spark/geopandas/geoseries.py:
##########
@@ -2351,32 +2351,20 @@ def to_crs(
from pyproj import CRS
- old_crs = self.crs
- if old_crs is None:
- raise ValueError(
- "Cannot transform naive geometries. "
- "Please set a crs on the object first."
- )
- assert isinstance(old_crs, CRS)
-
if crs is not None:
crs = CRS.from_user_input(crs)
elif epsg is not None:
crs = CRS.from_epsg(epsg)
else:
raise ValueError("Must pass either crs or epsg.")
- # skip if the input CRS and output CRS are the exact same
- if old_crs.is_exact_same(crs):
- return self
-
spark_expr = stf.ST_Transform(
self.spark.column,
Review Comment:
Sedona supports omitting the source crs, and the actual crs of the geometry
will be used, so this works as intended
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]