How can I remove the region outside of the vector data when I combine the vector and raster data on the same map?
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Rui Li (AIRicky)
le 13 Fév 2019
Commenté : Rui Li (AIRicky)
le 18 Fév 2019
Hi All,
I just plot a map combine the vector data and raster data with the following code,
load mapdemo.mat
ax = worldmap(latlim, lonlim);
surfm(Lat_lon,Lon_lat,China_data);
symbols=makesymbolspec('Polygon',{'default','FaceColor','none', 'LineStyle','--','LineWidth',0.2, 'EdgeColor',[0 0 0]});
geoshow('bou2_4p.shp', 'FaceColor','w','FaceAlpha',0,'EdgeColor','black','LineWidth', 1)
colorbar
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/203882/image.jpeg)
However, I want to obtain a map like this,
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/203883/image.jpeg)
I am wondering how can I remove the region outside of the vector data in the first figure to get the second figure. Could you help me? If Matlab mapping toolbox is not propoer to realize such function, is there other software is capable of this function?
Thank you so much.
Yours,
Ricky
0 commentaires
Réponse acceptée
KSSV
le 13 Fév 2019
You must be having the boundary coordinates in hand........use inpolygon and get the points lying inside the closed region. Read about inpolygon
Plus de réponses (0)
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!