the 'polyarea' function dose not work well. how to solve it?

I want to calculate area of four polyshapes.
the result from one polygon seems wrong.(VFR_lon_merged, VFR_lat_merged) It returns NaN value.
I attacehd the data.
Please Let me know how to solve it.

回答 (1 件)

dpb
dpb 2022 年 8 月 20 日

0 投票

>> VFR=[VFR_lat_merged VFR_lon_merged];
>> find(any(~isfinite(VFR),2))
ans =
102
>> VFR(ans-5:ans+5,:)
ans =
37.5443 126.4193
37.5451 126.4259
37.5456 126.4325
37.5458 126.4392
37.5458 126.4392
NaN NaN
37.4425 126.4427
37.4423 126.4432
37.4421 126.4434
37.4412 126.4442
37.4402 126.4451
>>
Your original data contains a NaN entry -- looks as though this could probably just be ignored, but I didn't try to see what the shape actually is nor where/how this might fit (or not) into the contour.

2 件のコメント

Walter Roberson
Walter Roberson 2022 年 8 月 21 日
nan inside of a poly shape might possibly indicate multiple independent poly shapes together in one array.
dpb
dpb 2022 年 8 月 21 日
Good point, Walter...didn't think about that even though the variable names indicate a good possibility...

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangePolygonal Shapes についてさらに検索

タグ

質問済み:

2022 年 8 月 20 日

コメント済み:

dpb
2022 年 8 月 21 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by