Function File: [h] = shapedraw (shp)
Function File: [h] = shapedraw (shp, clr)
Function File: [h] = shapedraw (shp, clr, ...)
Function File: [h] = shapedraw (shp, ...)

Plot contents of a shapefile, a map-/geostruct or a struct made by shaperead.m.

shp can be a shapefile (will be read and plotted), a struct made by shaperead, or a mapstruct or geostruct, possibly made by some other function. shapeplot.m will try to determine the type. Points, MultiPoints, Polylines, Polygons and MultiPatch shape features can be plotted.

The optional argument clr can be a predefined color name (’b’, ’green’, etc.) or an RGB triplet. The default is [0.6, 0.6, 0.6] which produces a grey plot. Polygons and MultiPatches can also be plotted as solid patches; then clr needs to have a second row indicating the fill color. Octave does not support transparent fills yet. Single-character color codes can be combined with linestyle indicators ":", "-", "–", "-.", ".-" and/or marker style indicators "*", ".", "+", "@", "v", "^", ">", "<", "d", "h", "o", "p", "s" to modify the linestyle for polylines.

Other graphics properties for drawing can be supplied either instead of, or after the color argument and will be conveyed as-is to the actual drawing routines. Depending on shapetype, the following proqperties are accepted:

  • All shape types: Visible, LineStyle, LineWidth, Marker, MarkerEdgeColor, MarkerFaceColor, MarkerSize
  • Point, MultiPoints, Line, Polyline: Color
  • Polygon, MultiPatch: FaceColor, EdgeColor

Polygons with holes can be properly plotted provided the holes are separate shape feature parts comprising counterclockwise polylines; the first partial feature must be the clockwise outer polygon. The Octave-Forge geometry package is required to assess whether multipart polygons have holes and to properly draw them. shapedraw.m will search for the geometry package the first time it is instructed to plot filled polygons. To initiate a new search later on (e.g., after the geometry package has been loaded), simply invoke shapedraw without any arguments.

Optional output argument h is the figure handle of the plot.

See also: geoshow, mapshow, shapeinfo, shaperead.

Package: mapping