ArcGIS shapes such as points and polygon, or even raster files can be plotted in Matlab. Here is an example of reading and plotting HUC4 polygons in Matlab.
First if read in the shape file that’s generated in ArcGIS
%read in shapefile huc = shaperead('C:HUC4.shp','UseGeoCoords', true, 'BoundingBox', [lonlim', latlim']);
then we get a struct like this, in which most of the columns are attribute table variables, with the first few columns showing the geometrical information about each polygon.
Sometimes the vertices are too many for each polygon, which makes the plotting process extremely slow. Here I am using a tool called DecimatePoly to reduce the total number of vertices 10 times less without making noticeable changes on the shape.
Next we will define the color of the polygon by one of the variables in the attribute table using makesymbolspec:
faceColors = makesymbolspec('Polygon',{'INDEX',[1 lenS],'FaceColor',color_att}); %lenS is the number of polygon %color_att…
View original post 87 more words