turf icon indicating copy to clipboard operation
turf copied to clipboard

Unspecified behaviour when `cellSide` does not fit the specified grid in `squareGrid`

Open agdhruv opened this issue 5 years ago • 2 comments

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.

agdhruv avatar Aug 08 '19 07:08 agdhruv

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...

bertday avatar Nov 26 '22 22:11 bertday

#1214

mfnash avatar Aug 10 '23 04:08 mfnash