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
For Geometries like MultiPoint, MultiPolygon the following error occurs,
julia> using GeometryBasicsjulia> p1 = Point(3, 1)
2-element Point{2,Int64} with indices SOneTo(2):
3
1
julia> poi = meta(p1, city="Abuja", rainfall=1221.2)
2-element PointMeta{2,Int64,Point{2,Int64},(:city, :rainfall),Tuple{String,Float64}} with indices SOneTo(2):
3
1
julia> MultiPoint([p1])
1-element MultiPoint{2,Int64,Point{2,Int64},Array{Point{2,Int64},1}}:
[3, 1]
julia> meta(MultiPoint([p1]), city="Abuja", rainfall=1221.2)
ERROR: Metadata needs to be an array with the same length as data items. Found: String
also passing the metadata as a NamedTuple reproduces the error,
julia> using GeometryBasics; const GB = GeometryBasics
GeometryBasics
julia> tup = (featurecla = "Land", min_zoom = 0, scalerank = 0)
(featurecla = "Land", min_zoom = 0, scalerank = 0)
julia> polys = [Polygon(rand(Point{2, Float32}, 20)) for i in 1:10];
julia> multipoly = MultiPolygon(polys; tup...)
ERROR: Metadata needs to be an array with the same length as data items. Found: String
The text was updated successfully, but these errors were encountered:
One possible workaround is the way this issue was solved #52, i.e. defining a meta type for remaining multigeometries,
but as @visr pointed out the meta() call is going here rather than going to the overload method, so there might be something else happening?
A key point here is that generally a multi geometry is interpreted similarly to a single geometry, i.e. one feature, or one row in a table.
It may be fine to have multi geometries implemented as vectors of their single part versions, but they are not the same thing. In a vector of points, each point can have it's own metadata. In a MultiPoint, there is only one geometry, so only one metadata. Having a single multi geometry as a StructArray therefore does not quite seem the right approach.
For Geometries like MultiPoint, MultiPolygon the following error occurs,
also passing the metadata as a NamedTuple reproduces the error,
The text was updated successfully, but these errors were encountered: