Replies: 1 comment 5 replies
-
I believe this function only supports creating random points within the bounding box you pass, which you appear to pass the bounding box of your circle. The bounding box of your circle is the smallest rectangle that fits your circle,which will include areas outside of the circle itself. I don't have an elegant solution to do what you want in turf offhand, but brute force you could keep creating random points until you get one 'within' your circle or with distance from center less than or equal to the radius. |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm trying to use the following code to generate a random point that is included in a circle, but when I calculate the distance from the center of the circle to this point it's exceeds the radius from far, what am I doing wrong ?
and I get something like
Distance: 594 kilometers
Beta Was this translation helpful? Give feedback.
All reactions