Advertisement

MATLAB将TIFF转换为Shape,并对Tiff及shape进行读写

阅读量:
  • 读TIFF

[A,R] = geotiffread(‘Filename.tif’);
info = geotiffinfo(‘Filename.tif’);

  • 写TIFF

geotiffwrite(‘Filename’,A,R,‘GeoKeyDirectoryTag’,info.GeoTIFFTags.GeoKeyDirectoryTag)

  • 读Shape

A = shaperead(‘Filename.shp’);

  • 写Shape

shapewrite(Map, 'Filename'); % 该Map变量是结构体类型,并需包含点线面等数据类型信息
% 若需将数组A转换为Shape格式
A = num2cell(A);
fields = {'X', 'Y', 'Z'}; % 定义字段名列表
A = cell2struct(A, fields, dim); % 当fields为N×1时设置dim=1;若fields为1×M则设置dim=2
[A.Geometry] = deal('Point'); % 以点为例设置几何属性
shapewrite(A, 'Filename');

  • Tiff2Shp

通过调用g

全部评论 (0)

还没有任何评论哟~