OpenDrift / opendrift

Open source framework for ocean trajectory modelling
https://opendrift.github.io
GNU General Public License v2.0
246 stars 120 forks source link

question about polygon in leeway #346

Closed limaolin1981611 closed 3 years ago

limaolin1981611 commented 4 years ago

I use two polygons to seed in leeway, the points are as follows:

(1)polygon 1 lon_input=[115.5, 115.5, 116.5, 116.5, 116] lat_input=[21.5, 22.5, 22.5, 21.5, 21]

(2)polygon 2 lon_input=[115.5, 115.5, 116.5, 116.5, 116, 116, 115] lat_input=[21.5, 22.5, 22.5, 21.5, 21, 23, 22]

the outputs of seed in leeway are as follows: leeway_polygon_seed leeway_polygon_seed1

The question is how does picture 2 comes out?

knutfrode commented 4 years ago

The second polygon is ill-shaped, and crosses itself. There is no check for this in OpenDrift, so output is then unpredictable.

If you change the 23 to 20 in lat_input, you get a real polygon.

limaolin1981611 commented 4 years ago

yes, If I change the the 23 to 20 in lat_input, the output is right as follow: leeway_polygon_seed

There is another question, How can I find the most popular position in the polygon?

knutfrode commented 4 years ago

What do you mean by "most popular position"? The elements should be evenly distributed within polygons, if radius=0. From your plot I see that you have a small radius/perturbation/uncertainty, which can be set to 0 if preferred.

knutfrode commented 3 years ago

Closing this issue. Please re-open if still relevant.