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

Degenerate TileLayouts #2026

Closed
fosskers opened this issue Feb 21, 2017 · 0 comments
Closed

Degenerate TileLayouts #2026

fosskers opened this issue Feb 21, 2017 · 0 comments
Assignees

Comments

@fosskers
Copy link
Contributor

fosskers commented Feb 21, 2017

Currently, the following are possible:

scala> TileLayout(0, 0, 10, 10)
res0: geotrellis.raster.TileLayout = TileLayout(0,0,10,10)

scala> TileLayout(-5, -5, 10, 10)
res1: geotrellis.raster.TileLayout = TileLayout(-5,-5,10,10)

where the results are degenerate, nonsensically sized TileLayouts. Changing this to make it impossible would mean a guarantee of sanity in code that expects positively-sized TileLayouts, with the disadvantage of bounds-checking every time one is created.

In the absence of unsigned integer types on the JVM (the proper fix), I suppose the only approach to refusing negative values would be to throw an Exception?

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