Turfjs / Turfjs/turf

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

Open
#1,741 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

@turf/square-grid
Dominant language
TypeScript
Stars
10.5k
Forks
1k
Avg merge
1h 11m
Merged PRs (30d)
4

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at packages/turf-rectangle-grid/index.js line 48 and compare its behavior with the concern raised in #444. Confirm with maintainers whether squareGrid should stay within the bbox or overflow when cellSide does not fit, then document the decided behavior in the relevant documentation. Done means the edge case and resulting grid placement are explicitly described.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.