GeoInterface.jl
GeoInterface.jl copied to clipboard
Type that's both a Feature as a Geometry
Over at https://github.com/JuliaGeo/GeoInterface.jl/blob/main/src/utils.jl#L64, we assert that if somethings a Feature, it can't be a Geometry as well, but is there a reason why we forbid this?
I've got a struct thing with x, y, z, other, props and I want it to be both at the same time. A Feature and a Point.
One reason would be to prevent an stackoverflow due to :
function coordinates(t::AbstractFeatureTrait, feature)
geom = geometry(feature)
isnothing(geom) ? [] : coordinates(geom)
end
Hmm nothing was designed for that possibility but I guess it could work?
Often it's feature properties will win because isfeature is checked first. I guess that's an issue: packages might also check isgeomtry first and never even treat it as a feature. The order doesn't matter if they're mutually exclusive.