关于测绘的matlab教程
关于测绘的MATLAB教程,以下是一些关键点和示例代码:
1. 使用mapshow和geoshow绘制地图
方法一:使用mapshow和shapefile
% 清除之前的图形
clc; clear; clf
% 定义shapefile路径
fnshp_L = 'E:\ChinaMap\国界与省界\bou2_4l.shp'; % PolyLine
fnshp_P = 'E:\ChinaMap\国界与省界\bou2_4p.shp'; % Polygon
% 读取shapefile数据
readL = shaperead(fnshp_L);
readP = shaperead(fnshp_P);
% 绘制图形
subplot(121); mapshow(readL); title('PolyLine of China');
subplot(122); mapshow(readP); title('Polygon of China');
```
方法二:使用geoshow和shapefile
```
% 清除之前的图形
clc; clear; clf
% 定义shapefile路径
fnshp_L = 'E:\ChinaMap\国界与省界\bou2_4l.shp'; % PolyLine
fnshp_P = 'E:\ChinaMap\国界与省界\bou2_4p.shp'; % Polygon
% 读取shapefile数据
readL = shaperead(fnshp_L);
readP = shaperead(fnshp_P);
% 绘制图形
subplot(121); geoshow(readL); title('PolyLine of China');