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

empty Extent #4

Open
visr opened this issue Jun 23, 2022 · 4 comments
Open

empty Extent #4

visr opened this issue Jun 23, 2022 · 4 comments

Comments

@visr
Copy link
Contributor

visr commented Jun 23, 2022

I thought for a moment this returned a different type, but it's just show.

julia> Extent()
ExtentNamedTuple()

But it made me think, should we allow these to be created?
And what about tuples for a dimension that are not size 2?

julia> Extent(X=(2,3,4))
Extent(X = (2, 3, 4),)

julia> Extent(X=(2,))
Extent(X = (2,),)

Should we check for these in the inner constructor?

@visr
Copy link
Contributor Author

visr commented Jun 23, 2022

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?

@rafaqz
Copy link
Owner

rafaqz commented Jun 23, 2022

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.

@visr
Copy link
Contributor Author

visr commented Jun 24, 2022

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)

@rafaqz
Copy link
Owner

rafaqz commented Jun 24, 2022

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.

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