From 42c9a2301ca5d340d911c38cea0343d27bb3792e Mon Sep 17 00:00:00 2001 From: Anshul Singhvi Date: Tue, 16 Sep 2025 16:18:55 +0200 Subject: [PATCH 1/2] Add coordtype implementation for GeoInterface MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Implements the coordtype function for AbstractGeometry, AbstractFeature, and AbstractFeatureLayer types. ArchGDAL always uses Float64 for coordinates. Implementation is guarded to work with older GeoInterface versions. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- src/geointerface.jl | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/geointerface.jl b/src/geointerface.jl index 33e5d86f..43c9c581 100644 --- a/src/geointerface.jl +++ b/src/geointerface.jl @@ -413,4 +413,21 @@ let pointtypes = (wkbPoint, wkbPoint25D, wkbPointM, wkbPointZM), function GeoInterface.geomtrait(geom::AbstractGeometry{wkbTriangle}) return GeoInterface.TriangleTrait() end + + # coordtype implementations - guarded against old GeoInterface versions + if :coordtype in names(GeoInterface; all = true) + # ArchGDAL always uses Float64 for coordinates + function GeoInterface.coordtype(::GeoInterface.AbstractGeometryTrait, ::AbstractGeometry) + return Float64 + end + + function GeoInterface.coordtype(::GeoInterface.FeatureTrait, ::AbstractFeature) + return Float64 + end + + # AbstractFeatureLayer acts like a FeatureCollection in ArchGDAL + function GeoInterface.coordtype(::GeoInterface.FeatureCollectionTrait, ::AbstractFeatureLayer) + return Float64 + end + end end From d63e1f51389b90cf2de8499728a2ecf4570232c7 Mon Sep 17 00:00:00 2001 From: Anshul Singhvi Date: Sat, 25 Oct 2025 21:16:07 -0400 Subject: [PATCH 2/2] Use `isdefined` instead of checking names --- src/geointerface.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/geointerface.jl b/src/geointerface.jl index 43c9c581..b0f3f671 100644 --- a/src/geointerface.jl +++ b/src/geointerface.jl @@ -415,7 +415,7 @@ let pointtypes = (wkbPoint, wkbPoint25D, wkbPointM, wkbPointZM), end # coordtype implementations - guarded against old GeoInterface versions - if :coordtype in names(GeoInterface; all = true) + if isdefined(GeoInterface, :coordtype) # ArchGDAL always uses Float64 for coordinates function GeoInterface.coordtype(::GeoInterface.AbstractGeometryTrait, ::AbstractGeometry) return Float64