crop or clip matrix shapefile

1 回表示 (過去 30 日間)
Muhammad Habibie
Muhammad Habibie 2018 年 2 月 14 日
I have matrix 9600x19200 int16 that i want to cut as my shapefile. How could I cut?
I try using this:
I11 = cat(1,I10,I9); %Shapefile t = shaperead('F:\Citra\Shapefile\myshapefile.shp', 'UseGeoCoords', true); % Get x,y locations of pixels: [x,y] = pixcenters(I11); % Convert x,y arrays to grid: [X,Y] = meshgrid(x,y); % Remove trailing nan from shapefile rx = t.X(1:end-1); ry = t.Y(1:end-1); mask = inpolygon(X,Y,rx,ry); figure,imshow(mask,[]); colormap(gca,'jet'); colorbar;
the error : Error using parsePixMapInputs>parseOther (line 66) Function PIXCENTERS expected input number 1, R, to be either a 3-by-2 referencing matrix or a scalar map raster reference object. Instead its size was 9600x19200.
Error in parsePixMapInputs (line 22) [R, height, width, hasFlag] = parseOther(func_name, flagstr, varargin{:});
Error in pixcenters (line 51) = parsePixMapInputs('PIXCENTERS', 'makegrid', varargin{:});
Error in crop_matrix (line 74) [x,y] = pixcenters(I11);
Need some suggestion for crop matrix using shapefile

回答 (0 件)

カテゴリ

Help Center および File ExchangeMap Display についてさらに検索

Community Treasure Hunt

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

Start Hunting!