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

Better child error when creating geom from array #154

Merged
merged 1 commit into from
Sep 2, 2024

Conversation

tiemvanderdeure
Copy link
Contributor

When creating a geometry from an array that contains elements with the wrong trait, refer to the first element that has the wrong trait, rather than the first element of the array.

MWE:

import GeoInterface as GI
p = GI.Point(0,0)
x = 1
GI.Line([p, x])

Before this PR throws a

ERROR: ArgumentError: GeoInterface.LineTrait must have child objects with trait GeoInterface.PointTrait, got GeoInterface.Wrappers.Point{false, false, Tuple{Int64, Int64}, Nothing} with trait 
GeoInterface.PointTrait()

After this PR throws a:

ERROR: ArgumentError: LineTrait must have child objects with trait PointTrait, got Int64 with trait nothing

@tiemvanderdeure
Copy link
Contributor Author

@rafaqz @asinghvi17 could one of you review/merge this?

@rafaqz rafaqz merged commit 18ee04f into JuliaGeo:main Sep 2, 2024
10 checks passed
@asinghvi17
Copy link
Member

Thanks!

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 this pull request may close these issues.

3 participants