Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linear rings have a GeoInterface.trait of LineStringTrait #420

Open
asinghvi17 opened this issue Apr 4, 2024 · 1 comment · May be fixed by #421
Open

Linear rings have a GeoInterface.trait of LineStringTrait #420

asinghvi17 opened this issue Apr 4, 2024 · 1 comment · May be fixed by #421

Comments

@asinghvi17
Copy link
Contributor

When looking into a polygon, the constituent geometries print as linear rings but possess LineStringTraits. This is a problem "upstream" in GeometryOps when reconstructing geometries from ArchGDAL inputs.

Consider the following MWE:

import GeoInterface as GI, ArchGDAL as AG
polygon = GI.Polygon([GI.LinearRing([(cos(t), sin(t)) for t in LinRange(0, 2pi, 100)])])
GI.geomtrait(GI.getgeom(polygon, 1)) # LinearRingTrait
ag_polygon = GI.convert(AG, polygon)
GI.geomtrait(GI.getgeom(ag_polygon, 1)) # LineStringTrait

@which GI.geomtrait(GI.getgeom(ag_polygon, 1)) reveals:

function GeoInterface.geomtrait(
geom::Union{map(T -> AbstractGeometry{T}, linetypes)...},
)
return GeoInterface.LineStringTrait()
end

which seems incorrect...

@yeesian
Copy link
Owner

yeesian commented Apr 6, 2024

Thank you! I appreciate making it correct before making it fast

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants