How to ignore points outside polygon shapefiles MATLAB mapping toolbox

5 ビュー (過去 30 日間)
Poulomi Ganguli
Poulomi Ganguli 2021 年 6 月 3 日
コメント済み: Poulomi Ganguli 2021 年 6 月 11 日
Hello:
I have polygon shape file, where the shape file comprises of multiple polygon each in a struct format. I want to superimpose gridded data over it, however, I want to mask the data points which are not located within these polygons. I came across several example, for example, one here: https://de.mathworks.com/matlabcentral/answers/311766-how-to-mask-data-points-outside-a-border-using-geoshow
Since ours is not a standard shapefile as available within MATLAB but an area of watershed comprising several polygons, the code shown here is not working for me. Could any one pls. suggest how to remove the data points from visualization which is not located within the polygon.

回答 (1 件)

KSSV
KSSV 2021 年 6 月 4 日
REad about inpolygon, this will give you indices of points lying inside the polygon.
  3 件のコメント
KSSV
KSSV 2021 年 6 月 4 日
Attach your data.
Poulomi Ganguli
Poulomi Ganguli 2021 年 6 月 11 日
I have attached my shapefile along with an excel sheet that contain longitude, latitude and the value. I needed to map thes values over the shapefile.

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by