From 18560e575d179470c633c43eb0a2a94237734139 Mon Sep 17 00:00:00 2001 From: Anshul Singhvi Date: Thu, 15 Jan 2026 19:10:19 -0500 Subject: [PATCH] Convert static vectors to regular vectors in GI.convert --- ext/GeometryBasicsGeoInterfaceExt.jl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ext/GeometryBasicsGeoInterfaceExt.jl b/ext/GeometryBasicsGeoInterfaceExt.jl index ed5da70b..ff4fd116 100644 --- a/ext/GeometryBasicsGeoInterfaceExt.jl +++ b/ext/GeometryBasicsGeoInterfaceExt.jl @@ -156,7 +156,12 @@ end # without a function barrier you get a lot of allocations from runtime types function _collect_with_type(::Type{PT}, geom) where {PT <: Point{2}} - return [PT(GeoInterface.x(p), GeoInterface.y(p)) for p in getgeom(geom)] + point_iter = getgeom(geom) + if point_iter isa GeometryBasics.StaticArray + return collect((PT(GeoInterface.x(p), GeoInterface.y(p)) for p in getgeom(geom)) + else + return [PT(GeoInterface.x(p), GeoInterface.y(p)) for p in getgeom(geom)] + end end end