Why do the rules I defined using the MAKESYMBOLSPEC command seem to be ignored?

2 views (last 30 days)
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.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 3 Sep 2009
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);

More Answers (0)

Products


Release

R2009a

Community Treasure Hunt

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

Start Hunting!