フィルターのクリア

Created Shape file from matrices

15 ビュー (過去 30 日間)
Jonathan Demmer
Jonathan Demmer 2022 年 7 月 29 日
回答済み: Walter Roberson 2022 年 7 月 29 日
Dear all,
i would like to convert a matlab file into a shape file. I wrote the code below, however an error message is still appearing (sea below), does someone have any ideas how to solve it, pelase?
Error message:
error using shapewrite
Expected input number 1, S, to be a vector.
Error in shapewrite>parseInputs (line 667)
validateattributes(S, ...
Error in shapewrite (line 82)
[S, basename, dbfspec] = parseInputs(varargin{:});
Error in average_current (line 137)
shapewrite(Data, 'EBB_current.shp');
%% Convert to shape file
clear all
close all
clc
% assign the path to your working directory:
cd ('E:\publi\Waiting-room\bird_swnasea\Velocity_file\');
file = 'Average_EBB.mat';
load(file,'U','V');
Data = struct([]) ; % initilaize structure
for i = 1:141 % number lines of matrices U and V
for j = 1:161 %number of column of matrices U and V
Data(i,j).Geometry = 'Polygon' ;
Data(i,j).X = U(i,j) ; % latitude
Data(i,j).Y = V(i,j); % longitude
Data(i,j).Name = 'EBB' ; % some random attribute/ name
end
end
shapewrite(Data, 'EBB_current.shp');

採用された回答

Walter Roberson
Walter Roberson 2022 年 7 月 29 日
shapewrite(Data(:), 'EBB_current.shp');

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeEntering Commands についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by