Tuesday, November 13, 2018

Quickly plot a shapefile in Matlab


Are you having a trouble in plotting shapefile in Matlab or the geoshow and mapshow is taking too much time to plot your shapefile then you can use the approach shown below. This is very quick.

shpfile=('landareas.shp');
S1 = shaperead(shpfile);
XX=[];YY=[];
for j=1:length(S1)
%Look for your X and Y variables in your shapefile
XX=[XX S1(j).X;];
YY=[YY S1(j).Y;];
end

plot(XX,YY)

Please leave a comment if you have any problem or if this solution has worked for you.

Related queries:
Plot fast shapefile.
Shapefile hangs, very slow
Quickly view a shapefile in Matlab

No comments:

Post a Comment