Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

point-grid bug #1886

Open
entagir opened this issue Apr 23, 2020 · 2 comments · May be fixed by #1887
Open

point-grid bug #1886

entagir opened this issue Apr 23, 2020 · 2 comments · May be fixed by #1887

Comments

@entagir
Copy link

entagir commented Apr 23, 2020

Hi, I found a problem when building a grid for a big box.

Sample this prolem:
GeoJSON: https://gist.github.com/entagir/8a2f8e003731ce52ab87fe230dc2ab7f
or: https://jsonkeeper.com/b/GHL4
Code: https://jsfiddle.net/entagir/dsahcfej/11/

Thank!

@entagir
Copy link
Author

entagir commented Apr 23, 2020

#1887

@entagir entagir linked a pull request Apr 23, 2020 that will close this issue
@entagir entagir changed the title point-grid bag point-grid bug Apr 23, 2020
@Sieyalixnet
Copy link

Sieyalixnet commented Jan 12, 2022

@rowanwins
The same bug also exists in turf-interpolate.

var pointList = [];
for(let i=0;i<180;i++){
for(let j=0;j<360;j++){
let point = turf.point([-180+j1,90-i1]);
point.properties.solRad = Math.random() * 10;
pointList.push(point)
}}
console.log(turf.featureCollection(pointList))
var options = {gridType: 'points', property: 'solRad', units: 'degrees'};
var grid = turf.interpolate(turf.featureCollection(pointList), 1, options);
console.log(grid)

Such code result is:
{type: 'FeatureCollection', features: Array(64800)} {type: 'FeatureCollection', features: Array(179)}

It only interpolate -0.5 longitude.

However, if the longitude and latitude are set as -180-0 and 90-0 (1/4 size of global), it works:
{type: 'FeatureCollection', features: Array(16200)} {type: 'FeatureCollection', features: Array(15842)}

Thanks~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants