zhangfengcdt commented on code in PR #2014:
URL: https://github.com/apache/sedona/pull/2014#discussion_r2175731561


##########
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:
   I think we should overwrite the two functions `to_pandas()` and 
`to_geopandas` in GeoSeries to disable end users from performing these 
operations directly. We can still keep internal versions of them _to_pandas and 
_to_geopandas if needed by the implementation itself. 
   
   In PySpark, it keeps the to_pandas() that warn users that 
   
   ```
           log_advice(
               "`to_pandas` loads all data into the driver's memory. "
               "It should only be used if the resulting pandas Series is 
expected to be small."
           )
   ```
   
   And we should at least do this in to_geopandas() as well if we don't like 
the idea of disabling it. 
   
   
   



-- 
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]

Reply via email to