turf
turf copied to clipboard
Unspecified behaviour when `cellSide` does not fit the specified grid in `squareGrid`
Refer this line: https://github.com/Turfjs/turf/blob/b6cb691e0d23293ca0c881fe561f0e8a4536ad6a/packages/turf-rectangle-grid/index.js#L48
The documentation does not clarify how squareGrid
behaves in the following case: cellSide
does not fit in the specified bbox
.
The referred line above suggests that the grid would be centered in the bbox
to ensure that it is completely inside it. However, #444 suggests that it may overflow the bbox
.
Question: What does Turf (intend to) do when such a scenario occurs? Suggestion: The behavior must be specified in the documentation.
This was unexpected behavior for me as well — I assumed the square grid would be oversized to cover the bounding box, not be constrained to fit inside it.
+1 to @agdhruv's suggestion that this should be documented. I'll submit a PR for this!
Personally, I would love to see an option for oversizing the square grid as well. I'll think on this...
#1214