adding boundary to shapefile

조회 수: 1 (최근 30일)
Tanmoyee Bhattacharya
Tanmoyee Bhattacharya 2016년 5월 6일
답변: KSSV 2016년 5월 6일
Sir, I plot an Image from a nc file by using imagesc(lon,lat,a);I want to add my area shapefile.I import s=shaperead(shapefile);mapshow(s);But it is showing colour insiade the shapefile.I want only boundary.How can I do this.
  댓글 수: 3
Tanmoyee Bhattacharya
Tanmoyee Bhattacharya 2016년 5월 6일
Tanmoyee Bhattacharya
Tanmoyee Bhattacharya 2016년 5월 6일

댓글을 달려면 로그인하십시오.

답변 (2개)

KSSV
KSSV 2016년 5월 6일
S = shaperead('file') is a structure. Use plot(S(i).X,S(i).Y) ,,i will be from 1:length(S). Varies according to your state. I suggest you to use pcolor or surf rather imagesc for plotting.

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

카테고리

Help CenterFile Exchange에서 Map Display에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by