Repository: geopandas/geopandas

Issue:
REF: remove heuristics in __repr__ guessing if CRS if projected
In `GeometryArray.__repr__` we have a heuristic which tries to guess if a geometry is projected or not based on coords of first ten geometries. The reason is that we set rounding of geographic CRS to 5 while for projected to 3.

https://github.com/geopandas/geopandas/blob/59d3b2b7260b485e95e06a38f1c3e218b0a40a46/geopandas/array.py#L1005-L1023

We can remove this and use `crs.is_projected` or `crs.is_geographic` instead. Something along

```py
if precision is None:
    if self.crs and self.crs.is_projected:
        precision = 3
    else:
        precision = 5
```


Discussion:
We should certainly start using the `crs.is_projected` logic when a CRS is set, but could also still keep the current code as fall back?
can i work on this
@kenkirito Yes! If you can keep the fall back to existing logic as @jorisvandenbossche suggested above, that'd be ideal. Thanks a lot!

Resolving patch:
diff --git a/geopandas/array.py b/geopandas/array.py
--- a/geopandas/array.py
+++ b/geopandas/array.py
@@ -1224,23 +1224,30 @@ def _formatter(self, boxed=False):
 
             precision = geopandas.options.display_precision
             if precision is None:
-                # dummy heuristic based on 10 first geometries that should
-                # work in most cases
-                with warnings.catch_warnings():
-                    warnings.simplefilter("ignore", category=RuntimeWarning)
-                    xmin, ymin, xmax, ymax = self[~self.isna()][:10].total_bounds
-                if (
-                    (-180 <= xmin <= 180)
-                    and (-180 <= xmax <= 180)
-                    and (-90 <= ymin <= 90)
-                    and (-90 <= ymax <= 90)
-                ):
-                    # geographic coordinates
-                    precision = 5
+                if self.crs:
+                    if self.crs.is_projected:
+                        precision = 3
+                    else:
+                        precision = 5
                 else:
-                    # typically projected coordinates
-                    # (in case of unit meter: mm precision)
-                    precision = 3
+                    # fallback
+                    # dummy heuristic based on 10 first geometries that should
+                    # work in most cases
+                    with warnings.catch_warnings():
+                        warnings.simplefilter("ignore", category=RuntimeWarning)
+                        xmin, ymin, xmax, ymax = self[~self.isna()][:10].total_bounds
+                    if (
+                        (-180 <= xmin <= 180)
+                        and (-180 <= xmax <= 180)
+                        and (-90 <= ymin <= 90)
+                        and (-90 <= ymax <= 90)
+                    ):
+                        # geographic coordinates
+                        precision = 5
+                    else:
+                        # typically projected coordinates
+                        # (in case of unit meter: mm precision)
+                        precision = 3
             return lambda geom: shapely.wkt.dumps(geom, rounding_precision=precision)
         return repr
 


Test patch:
diff --git a/geopandas/tests/test_pandas_methods.py b/geopandas/tests/test_pandas_methods.py
--- a/geopandas/tests/test_pandas_methods.py
+++ b/geopandas/tests/test_pandas_methods.py
@@ -46,12 +46,20 @@ def test_repr_boxed_display_precision():
     s1 = GeoSeries([p1, p2, None])
     assert "POINT (10.12346 50.12346)" in repr(s1)
 
+    # geographic coordinates 4326
+    s3 = GeoSeries([p1, p2], crs=4326)
+    assert "POINT (10.12346 50.12346)" in repr(s3)
+
     # projected coordinates
     p1 = Point(3000.123456789, 3000.123456789)
     p2 = Point(4000.123456789, 4000.123456789)
     s2 = GeoSeries([p1, p2, None])
     assert "POINT (3000.123 3000.123)" in repr(s2)
 
+    # projected geographic coordinate
+    s4 = GeoSeries([p1, p2], crs=3857)
+    assert "POINT (3000.123 3000.123)" in repr(s4)
+
     geopandas.options.display_precision = 1
     assert "POINT (10.1 50.1)" in repr(s1)