MATLAB: Do the rules I defined using the MAKESYMBOLSPEC command seem to be ignored

colorgeoshowignoremakesymbolspecMapping Toolboxrule

It sometimes happens that polygons from the same shape file will overlap each other. If this happens, it may seem that a rule is not being applied correctly.

Best Answer

GEOSHOW makes no promises about the order in which it constructs the polygons in the geostruct s, and it turns out to be a little bit easier, from an implementation perspective, to order them from last to first. Normally that causes no problems -- typically one is displaying polygons that either tile to cover a space (e.g., the 48 conterminous U.S. states) or that are otherwise non-overlapping (e.g., the polygons in landareas.shp).
You can work around this issue by changing the order of the geo-struct input to the GEOSHOW command.
s = shaperead('your_data_file_here');
% just as an example
clrs=makesymbolspec('Polygon', {'LevelString','land','FaceColor',[0 .8 0]},...
{'LevelString','lake','FaceColor',[0 .8 1]},...
{'LevelString','pond','FaceColor',[0 .8 1]},...
{'Default','FaceColor','k'});
% note the changed input order to GEOSHOW
geoshow(s(end:-1:1),'symbolspec',clrs);