Function File: symspec = makesymbolspec (geometry, rule#1...rule#n)
Function File: symspec = makesymbolspec (geometry, {"Default", property1, value1, ...})
Function File: symspec = makesymbolspec (geometry, {attr, attval, Property1, Value1, ...})

Create a symbol specification structure for use with mapshow.

Each symbolspec refers to one geometry type. geometry can be one of "Point", "MultiPoint", "Line", "PolyLine", "Polygon", or "Patch". The following argument(s) are rules. Each rule is a separate cell array. The first entry of a rule must be the string "Default" of an attribute/value pair. The attribute attr should conform to the attributes of the map feature to be drawn with the symbolspec; often these are the attributes of shapefiles. The value attval can be a:

  • Numeric value or range of values (row vector). Map features with attribute attr values equal to, or in the range ATTVAL (end points inclusive) will be drawn with the propety/value pairs in the rest of the rule. These include X and Y coordinates.
  • Logical value. The map features with values for attribute attr equal to attval will be drawn with the propety/value pairs in the rest of the rule.
  • Character string. Those map features with attr text strings corresponding to attval will be drawn with the propety/value pairs in the rest of the rule.

In case of oct-type structs (see shaperead.m) additional attributes are available:

X
Y
Z
M

X, Y, Z or M-values of vertices of polylines / polygons / multipatches are used to indicate the matching shape features are to be drawn. A matching value of just one sigle vertex of poit in the specified range suffices to match a shape feature.

npt

npt encodes for the number of vertices for each multipoint, polygon, polyline or multipatch shape feature in the original shapefile.

npr

npr encodes for the number of parts of each shape feature.

The property/value pairs for each rule should conform to the geometry type. That is, for (Multi)Point features only marker properties may be specified, similarly for Lines/Polylines (line properties) and Polygons/Patches (patch and fill properties).

The case of input geometries and properties does not matter; makesymbolspec will turn them into the "official" casing.

  symsp1 = makesymbolspec ("Line", {"TAG1", "road", ...
                                     "color", "b"})
  (draw polylines tagged "road" as blue lines)
  symsp2 = makesymbolspec ...
           ("Line", {"TAG1", "road", "color", "b", ...
                     "linestyle", "-", "linewidth", 3} ...
                    {"TAG1", "rail", "color", ...
                      [0.7 0.5 0.2], ...
                     "linestyle", "--", "linewidth", 2})
  (like above, but with polylines tagged "rail" as dashed
   light brown lines)
  symsp3 = makesymbolspec 
           ("Polygon", {"M", [ 0    10], "Facecolor", "c"}, ...
                       {"M", [10.01 20], "Facecolor", "b"}, ...
                       {"M", [20.01 30], "Facecolor", "m"})
  (Note: only possible with oct-style shapestructs; create a
   symbolspec using M-values in three classes)

See also: mapshow, geoshow.

Package: mapping