How to extract data through the shapefile (India) from global precipitation data.

4 ビュー (過去 30 日間)
varunesh
varunesh 2018 年 6 月 1 日
編集済み: varunesh 2018 年 6 月 6 日
Hello Guys,
I have shapefile for Indian region. Actually, I want to extract Indian region data through this shapefile from global data. Please help me for doing this. I am attaching here both (Shaplefile and Global data in .mat).
Thank you so much in advance.
Regards,
Varunesh

採用された回答

KSSV
KSSV 2018 年 6 月 1 日
YOu need to read about inpolygon. This function helps you to extract what you want.
shapefile = 'India_Shapefile\ind_state_2000.shp' ;
S = load('global_data.mat') ;
C = shaperead(shapefile) ;
N = length(C) ;
lon = S.lon ; lat = S.lat ;
P = S.prc ;
[X,Y] = meshgrid(lon,lat) ;
iwant = cell(N,2) ;
for i =1:N
Cx = C(i).X ; Cy = C(i).Y ;
idx = inpolygon(X(:),Y(:),Cx',Cy') ;
P1 = P(:,:,1)' ;
iwant{i,1} = P1(idx) ;
P2 = P(:,:,2)' ;
iwant{i,2} = P2(idx) ;
end
  1 件のコメント
varunesh
varunesh 2018 年 6 月 6 日
編集済み: varunesh 2018 年 6 月 6 日
How to Extract through this shapefile. Please help me.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMap Display についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by