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

Grids generation problems on the whole sphere #1598

Closed
chasset opened this issue Feb 25, 2019 · 2 comments · Fixed by #2106
Closed

Grids generation problems on the whole sphere #1598

chasset opened this issue Feb 25, 2019 · 2 comments · Fixed by #2106

Comments

@chasset
Copy link

chasset commented Feb 25, 2019

First, I would like to thank you for your work. It is a great package for spatial analysis.

I try to get a grid of points on the whole sphere using http://turfjs.org/docs/#pointGrid.

This geoJSON (https://gist.github.com/chasset/2189b121941234acf3dbb90b1b0f111b
) is produced by :

turf.pointGrid([-179,-89,180,90], 100)

I also tried the following example. It doesn't produce any feature :

turf.pointGrid([-180,-90,180,90], 100)
turf.hexGrid([-179,-89,180,90], 100)
turf.squareGrid([-179,-89,180,90], 100)
@rowanwins
Copy link
Member

Hi @chasset

Thanks for the report, it's surprising that this hasn't been reported before!

I suspect the problem isthese lines where we calculate the distance between the bounding box points, it's finding the shortest distance around the globe when you want to travel right around the globe.

Cheers
R

@wangzhidavid
Copy link

Thank you for your work. It is a wonderful package. But i have the same problem. I tried multiple sets of data. It doesn't produce any feature :
turf.pointGrid([-169, -80, 139, 80], 10),

I also looked at the conversion function code, but could not find the logic problem.Whether the minimum value is considered to be limited.It's better to specify the minimum value in more detail.

Looking forward to your reply.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.

5 participants