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 CenterFile Exchange에서 Map Display에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!