Turf Mask near Meridian #2447
Unanswered
aldenpoole
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I am attempting to create a grid of points using a polygon as a mask. This works well, unless the polygon is sitting on a meridian. Say a polygon has coordinates:
I am using a combination of Turf and Cesium to draw and generate different shapes. Cesium handles these coordinates fine just as they are, or if I add 360 to the negative longitudes. However, when trying to create a Turf mask with this polygon, it fails. Depending on how I try to resolve it, I either get "t.geometry is undefined' when trying to make the mask, or the mask is produced, but at the first point that crosses over the meridian, the mask generated doesn't actually cross the meridian it seems to just change the longitude to a positive longitude. I can't post all of my code here or a picture as I work on a closed gap, but will try to clarify further if that description isn't sufficient.
I can't find anything in the Turf documentation or functions that would solve this issue, why does adding 360 degrees not work and why doesn't Turf have a function to sort of normalize polygons that cross a meridian using the method described here?
Thanks in advance.
Beta Was this translation helpful? Give feedback.
All reactions