Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Correction of xFraction variable calculation.
I propose to calculate the distance in latitude from the edge of the box to the center and multiply by 2, because with a large box (more than half the length of the latitude), the distance is not calculated correctly (the shortest distance from edge to edge will envelope the Earth from the other side and will not be the length of the box).
I also propose to calculate the distance in latitude, located in the center of the height of the box, because Now it is calculated on the lower edge (south), which gives a very small number of points for large boxes (at a height from the equator to the pole), because at the northern and southern latitudes their length decreases with distance from the equator. Also, with the same small boxes (one in the northern hemisphere, the other in the southern), the difference in result will be visible. In this regard, I think it will be fair to consider the latitude located in the center of the box.
And you also need to revise the tests for this module.
Thank.
PS: I attach the results and testing code to the tests of the module turf-point-grid. For comparison.
turf-point-grid-test.zip
Resolves #1886