Replies: 1 comment
-
The cell array after 'attributes' must come as triplets, e.g.
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi Wolfgang:
I calculate ksn values in Andes, and then I want to export these ksn values to ArcGIS supported files (e.g., shapefile). I paste my codes below:
Dem = GRIDobj("Dem_sub_900.tif");
FD = FLOWobj(Dem,'preprocess','carve');
A = flowacc(FD);
S = STREAMobj(FD,'minarea',1e6,'unit','map');
S = klargestconncomps(S,1);
zs = crs(S,Dem,'K',6,'tau',0.1);
k = ksn(S,zs,A,0.45);
% Convert the stream object to a structure that can be exported
S_struct = STREAMobj2mapstruct(S, 'attributes', {'ksn', k});
% Specify the output shapefile path
shapefile_path = 'ksn_streams.shp';
% Export to shapefile
shapewrite(S_struct, shapefile_path);
Then 'STREAMobj2mapstruct' raises error 'Error using cell Size inputs must be integers.' When I export 's' without attributes, the error gone.
Could you help me to fix it?
Thank you
Hanze
Beta Was this translation helpful? Give feedback.
All reactions