Open visr opened 2 years ago
And what about Extent(X=(2,1))
? That works now as well. But perhaps it should? I don't know.
I'm thinking about extents crossing the antimeridian https://datatracker.ietf.org/doc/html/rfc7946#section-5 for instance. Because of that in geojson the bbox is not defined by min and max, but by southwest to northeast.
But there are already some operations defined in this package in terms of min and max. So then we should enforce that the bounds are ascending for each dimension?
Thanks this is good feedback. We should only allow 2 tuples.
But Im not sure how to handle antimerideans. We could force ascending order in Tuples, but add a struct wrapper that adds the wrapping point (e.g. 180) when thats allowed.
Yeah perhaps we should park the antimeridian for now, it's quite domain specific.
See #6.
Related to the 2 tuples, do you think it makes sense to add outer constructors that support AbstractVector and then run extrema
on them to find the extents, such that this would work:
julia> Extent(X=[2,1,4])
julia> extrema([2,1,4])
(1, 4)
Ok, maybe I'll make a PR demoing antimeridean ideas at some point.
Im hesitant about the vector idea. Half the time geospatial raster data represents intervals so the vector of point values doesn't define the extent anyway... so lets leave that to users to do for now.
I thought for a moment this returned a different type, but it's just
show
.But it made me think, should we allow these to be created? And what about tuples for a dimension that are not size 2?
Should we check for these in the inner constructor?