File tree Expand file tree Collapse file tree 4 files changed +20
-4
lines changed
geoarrow-pyarrow/src/geoarrow/pyarrow Expand file tree Collapse file tree 4 files changed +20
-4
lines changed Original file line number Diff line number Diff line change @@ -423,8 +423,8 @@ def box_agg(obj):
423423 obj = obj_as_array_or_chunked (obj )
424424
425425 # Spherical edges aren't supported by this algorithm
426- if obj .type .edge_type == EdgeType .SPHERICAL :
427- raise TypeError ("Can't compute box of type with spherical edges" )
426+ if obj .type .edge_type != EdgeType .PLANAR :
427+ raise TypeError ("Can't compute box of type with non-planar edges" )
428428
429429 # Optimization: pyarrow's minmax kernel is fast and we can use it if we have struct
430430 # coords. So far, only a measurable improvement for points.
Original file line number Diff line number Diff line change @@ -243,6 +243,18 @@ class EdgeType(TypeSpecEnum):
243243 SPHERICAL = 2
244244 """Edges are geodesic on a sphere"""
245245
246+ VINCENTY = 3
247+ """Edges are geodesic on a spheroid according to the Vincenty algorithm"""
248+
249+ THOMAS = 4
250+ """Edges are geodesic on a spheroid according to the Thomas algorithm"""
251+
252+ ANDOYER = 5
253+ """Edges are geodesic on a spheroid according to the Andoyer algorithm"""
254+
255+ KARNEY = 6
256+ """Edges are geodesic on a spheroid according to the Karney algorithm"""
257+
246258
247259_VALUE_COMMON_HELPER = {
248260 (Encoding .WKB , Encoding .LARGE_WKB ): Encoding .LARGE_WKB ,
Original file line number Diff line number Diff line change @@ -77,8 +77,8 @@ def extension_metadata(self) -> str:
7777 "edge_type or crs is unspecified"
7878 )
7979
80- if self .edge_type == EdgeType .SPHERICAL :
81- metadata ["edges" ] = "spherical"
80+ if self .edge_type != EdgeType .PLANAR :
81+ metadata ["edges" ] = self . edge_type . name . lower ()
8282
8383 if self .crs is None :
8484 pass
Original file line number Diff line number Diff line change @@ -49,6 +49,10 @@ def test_type_spec_extension_metadata():
4949 TypeSpec (edge_type = EdgeType .SPHERICAL ).with_defaults ().extension_metadata ()
5050 == '{"edges": "spherical"}'
5151 )
52+ assert (
53+ TypeSpec (edge_type = EdgeType .VINCENTY ).with_defaults ().extension_metadata ()
54+ == '{"edges": "vincenty"}'
55+ )
5256 assert (
5357 TypeSpec (crs = gt .OGC_CRS84 )
5458 .with_defaults ()
You can’t perform that action at this time.
0 commit comments