You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This can actually cause some conversions to fail because the create$(geom) function may not have a dispatch for what GI.coordinates outputs, if it's e.g. a StaticArray.
It seems entirely doable to do this manually or in a loop for each type of geometry.
Here's an example for PolygonTrait:
function GeoInterface.convert(
::Type{T},
type::GeoInterface.PolygonTrait,
geom,
) where {T<:IGeometry}
f =get(lookup_method, typeof(type), nothing)
isnothing(f) &&error(
"Cannot convert an object of $(typeof(geom)) with the $(typeof(type)) trait (yet). Please report an issue.",
)
poly =createpolygon()
foreach(GeoInterface.getring(geom)) do ring
xs = GeoInterface.x.(GeoInterface.getpoint(ring))
ys = GeoInterface.y.(GeoInterface.getpoint(ring))
subgeom =unsafe_createlinearring(xs, ys)
result = GDAL.ogr_g_addgeometrydirectly(poly, subgeom)
@ogrerr result "Failed to add linearring."endreturn poly
end
The text was updated successfully, but these errors were encountered:
This can actually cause some conversions to fail because the
create$(geom)
function may not have a dispatch for what GI.coordinates outputs, if it's e.g. a StaticArray.It seems entirely doable to do this manually or in a loop for each type of geometry.
Here's an example for PolygonTrait:
The text was updated successfully, but these errors were encountered: