zhangfengcdt commented on code in PR #2014:
URL: https://github.com/apache/sedona/pull/2014#discussion_r2175672198
##########
python/sedona/geopandas/geoseries.py:
##########
@@ -155,6 +162,176 @@ def __init__(
fastpath=fastpath,
)
+ if crs:
+ self.set_crs(crs, inplace=True)
+
+ @property
+ def crs(self) -> Union[CRS, None]:
+ """The Coordinate Reference System (CRS) as a ``pyproj.CRS`` object.
+
+ Returns None if the CRS is not set, and to set the value it
+ :getter: Returns a ``pyproj.CRS`` or None. When setting, the value
+ can be anything accepted by
+ :meth:`pyproj.CRS.from_user_input() <pyproj.crs.CRS.from_user_input>`,
+ such as an authority string (eg "EPSG:4326") or a WKT string.
+
+ Examples
+ --------
+ >>> s.crs # doctest: +SKIP
+ <Geographic 2D CRS: EPSG:4326>
+ Name: WGS 84
+ Axis Info [ellipsoidal]:
+ - Lat[north]: Geodetic latitude (degree)
+ - Lon[east]: Geodetic longitude (degree)
+ Area of Use:
+ - name: World
+ - bounds: (-180.0, -90.0, 180.0, 90.0)
+ Datum: World Geodetic System 1984
+ - Ellipsoid: WGS 84
+ - Prime Meridian: Greenwich
+
+ See Also
+ --------
+ GeoSeries.set_crs : assign CRS
+ GeoSeries.to_crs : re-project to another CRS
+ """
+ tmp_df = self._process_geometry_column("ST_SRID", rename="crs")
+ srid = tmp_df.to_pandas().iloc[0]
Review Comment:
You can also do tmp_df._to_spark_pandas_df() that returns the pspd.DataFrame
(pyspark).
--
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]