Replies: 1 comment
-
Two areas to maybe address before deciding on an approach: First is to decide what exactly are we giving someone when they ask for a rectangle? Is it the corners of a spherical rectangle like you'd see on the surface of the Earth? Or a planar rectangle on a 2D projection? Those points will differ more and more as you get further toward the poles. The former is more accurate and consistent, whereas the latter will "look nicer" on a map. I'm firmly team "spherical earth" - I'd want this to work as well in Sweden as it does in Kenya. Second is that the way we define the API seems odd. We have a bounding box, and then a cell width - which isn't guaranteed to be an exact multiple of the bbox edge, so we fudge that by re-centering which then leads to issues like #2013 . Would seem neater to choose between:
I can imagine use cases for both, so perhaps warrants splitting into two functions. |
Beta Was this translation helpful? Give feedback.
-
Capturing some grid function related things I've been researching in one place for discussion and just awareness.
I noticed there's been some changes in behavior for at least the squareGrid/rectangleGrid functions in 2021 where something seems off/incorrect, or just don't do quite what the docs imply (for example that specifying units for cellSide will return cells that are equidistant in those units).
#2638
#2136
#2203
In addition, across all issues open/closed I see a call for the grid functions (hexGrid, squareGrid, rectangleGrid, triangleGrid, pointGrid?), to construct grids that meet different constraints. For example:
Possible solutions include:
methods
within each function rather than a one-size-fits-all approach that doesn't meet most needs. Or if the different options needed are too varied, create multiple functions.Beta Was this translation helpful? Give feedback.
All reactions