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

GB.meta() errors for MultiLineString( ) #52

Closed
Sov-trotter opened this issue May 28, 2020 · 4 comments
Closed

GB.meta() errors for MultiLineString( ) #52

Sov-trotter opened this issue May 28, 2020 · 4 comments

Comments

@Sov-trotter
Copy link
Contributor

Sov-trotter commented May 28, 2020

julia> GB.meta(GB.MultiLineString([GB.LineString([Point(0.0), Point(1.0)], [1, 2])]), boundingbox = Shapefile.Rect(0.0, 0.0, 100.0, 100.0))
ERROR: Metadata needs to be an array with the same length as data items. Found: Shapefile.Rect

One workaround is passing the metadata as boundingbox = [Rect(0.0, 0.0, 100.0, 100.0)] but I wonder if it's correct.
But this approach doesn't work for more than one items in metadata.

julia> GB.meta(GB.MultiLineString([GB.LineString([Point(0.0), Point(1.0)], [1, 2])]); m=[0.0, 2.0, 4.0, 6.0, 8.0, 10.0, 12.0, 14.0, 16.0, 18.0, 20.0, 22.0, 24.0, 26.0, 28.0], boundingbox = Rect(0.0, 0.0, 100.0, 100.0))
ERROR: Metadata array needs to have same length as data. Found 1 data items, and 15 metadata items
julia> a = GB.meta(GB.MultiLineString([GB.LineString([Point(0.0), Point(1.0)], [1, 2])]); m=[[0.0, 2.0, 4.0, 6.0, 8.0, 10.0, 12.0, 14.0, 16.0, 18.0, 20.0, 22.0, 24.0, 26.0, 28.0]], boundingbox = [[Rect(0.0, 0.0, 100.0, 100.0)]])
julia> meta(a)
ERROR: type NamedTuple has no field meta
@SimonDanisch
Copy link
Member

You want one multilinestring having one boundingbox?
Multilinestring doesn't have a metatype yet:
https://github.com/JuliaGeometry/GeometryBasics.jl/blob/master/src/metadata.jl#L166
So, that doesn't actually work yet.

@Sov-trotter
Copy link
Contributor Author

So how do you think I should progress with creating a polyline for Shapefile while also being able to add extra stuff into metadata?

@SimonDanisch
Copy link
Member

Add a metatypes to GeometryBasics, similar to the MultiPoint!

@Sov-trotter
Copy link
Contributor Author

Hey, I was writing a type for MultiPatch type and realized that Mesh didn't have a metatype. I tried something similar to MultiPoint and it did work. Should I push it to #53 ?

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

No branches or pull requests

2 participants