It looks like we're computing cols / rows via the ceil operation but validating it via the round function.
In short, yes. And GridExtent currently operates in its constructor using round
so in order to remain consistent, we should use that elsewhere when we construct new GridExtents, like in withResolution
and combine
.
The long version is that withResolution is unclear and could use reworking because it amplifies a core issue with GridExtent. The issue is that extent and cell sizes are represented as Double while cols and rows are represented as Integer:
- A GridExtent can be specified as having an extent and a specific number of cols and rows. This is fine, because we divide a double by an int and get a double cell size in each dimension
- A GridExtent can be specified as an extent and a CellSize. This is less fine, because we take a double and divide by a double to get a...double for cols and rows. But cols and rows are ints! So how to we choose what the right answer is for cols and rows in the