add shapefile behind an Image

2 ビュー (過去 30 日間)
Tanmoyee Bhattacharya
Tanmoyee Bhattacharya 2016 年 5 月 6 日
I have a India shapefile.I show it in matlab a=shaperead(file);s=mapshow(s);I want to show only upper portion of india behind an Image.But it is not coming.If it is possible.
  1 件のコメント
Tanmoyee Bhattacharya
Tanmoyee Bhattacharya 2016 年 5 月 6 日

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

採用された回答

KSSV
KSSV 2016 年 5 月 6 日
clc; clear all ;
file = 'cpc_rfe_v2.0_sa_dly.bin.20020101.nc' ;
lon = ncread(file,'lon') ;
lat = ncread(file,'lat') ;
RF = ncread(file,'RF') ;
%
path = [pwd filesep 'India State wise with telangana' filesep 'india27-11.shp'] ;
S = shaperead(path) ;
n = length(S) ;
x = zeros(n,1) ; y =zeros(n,1) ;
pcolor(lon,lat,RF') ; shading interp ;
hold on
for i = 1:n
x = S(i).X ; y = S(i).Y ;
plot(x,y,'k')
% rfi = interp2(lon,lat,RF',x,y) ;
end

その他の回答 (1 件)

KSSV
KSSV 2016 年 5 月 6 日
編集済み: KSSV 2016 年 5 月 6 日
S=shaperead(file);
will give you a structure. For your file (from the last question) has the following information:
Geometry: 'Polygon'
BoundingBox: [2x2 double]
X: [1x1198 double]
Y: [1x1198 double]
id: 24
State: 'Uttarakhand'
Area__sqkm: 53483
GODA_STATE: ''
new: 1
Pick up the region (each state has different 'i'), and use plot(S(i).X,s(i).Y) on the plot you wanted.
And next question?
  1 件のコメント
Tanmoyee Bhattacharya
Tanmoyee Bhattacharya 2016 年 5 月 6 日
Thank you sir for your guidance.I solve it.

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

カテゴリ

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