Geography Reference
In-Depth Information
However, the three base types are not the only geometry types you'll work with. There are
variations such as:
linestring
multilinestring
multipolygon
Plus a few others that are rarely used.
A linestring can be thought of as a collection of line objects where each point, except for the
start and end points, is the same as the start or end point of the adjacent line. For example:
1,2 2,3 3,4
would be a linestring that starts at 1,2, goes through two segments, and ends at 3,4.
A multilinestring can be thought of as a collection of linestrings. For example:
(1,2 2,3 3,4) (6,7 7,8 8,9)
would be two linestrings running from 1,2 to 3,4, and from 6,7 to 8,9, each consisting of two
segments. The two linestrings would have a gap between them.
A multipolygon, as the name suggests, is a collection of polygons, but with a twist. Polygon
definitions cannot overlap if they are in the same graphical object. This is illustrated in
Figures 3 and 4.
Figure 2: Valid Multipolygon
Figure 3: Invalid Multipolygon
A multipolygon must contain at least one polygon that encloses all other polygons in the set.
This is known as the outer ring . Within this boundary, the other polygons often form holes in
the outer ring. This is used for building plans with courtyards, road layouts with roundabouts,
anything where an enclosed section needs to be removed from the internal area of the
defined shape.
Many spatial databases, however, will define even single polygons as multipolygons. This is
done so that it's easy to insert cutouts if needed at a later time.
Search WWH ::




Custom Search