16.2. The OpenGIS Geometry Model

MySQL 5.0

16.2. The OpenGIS Geometry Model

The set of geometry types proposed by OGC's SQL with Geometry Types environment is based on the OpenGIS Geometry Model. In this model, each geometric object has the following general properties:

  • It is associated with a Spatial Reference System, which describes the coordinate space in which the object is defined.

  • It belongs to some geometry class.

16.2.1. The Geometry Class Hierarchy

The geometry classes define a hierarchy as follows:

  • (non-instantiable)

    • (instantiable)

    • (non-instantiable)

      • (instantiable)

    • (non-instantiable)

      • (instantiable)

    • (instantiable)

      • (instantiable)

      • (non-instantiable)

        • (instantiable)

      • (non-instantiable)

        • (instantiable)

It is not possible to create objects in non-instantiable classes. It is possible to create objects in instantiable classes. All classes have properties, and instantiable classes may also have assertions (rules that define valid class instances).

is the base class. It is an abstract class. The instantiable subclasses of are restricted to zero-, one-, and two-dimensional geometric objects that exist in two-dimensional coordinate space. All instantiable geometry classes are defined so that valid instances of a geometry class are topologically closed (that is, all defined geometries include their boundary).

The base class has subclasses for , , , and :

  • represents zero-dimensional objects.

  • represents one-dimensional objects, and has subclass , with sub-subclasses and .

  • is designed for two-dimensional objects and has subclass .

  • has specialized zero-, one-, and two-dimensional collection classes named , , and for modeling geometries corresponding to collections of , , and , respectively. and are introduced as abstract superclasses that generalize the collection interfaces to handle and .

, , , , and are defined as non-instantiable classes. They define a common set of methods for their subclasses and are included for extensibility.

, , , , , , and are instantiable classes.

16.2.2. Class Geometry

is the root class of the hierarchy. It is a non-instantiable class but has a number of properties that are common to all geometry values created from any of the subclasses. These properties are described in the following list. Particular subclasses have their own specific properties, described later.

Geometry Properties

A geometry value has the following properties:

  • Its type. Each geometry belongs to one of the instantiable classes in the hierarchy.

  • Its SRID, or Spatial Reference Identifier. This value identifies the geometry's associated Spatial Reference System that describes the coordinate space in which the geometry object is defined.

    In MySQL, the SRID value is just an integer associated with the geometry value. All calculations are done assuming Euclidean (planar) geometry.

  • Its coordinates in its Spatial Reference System, represented as double-precision (eight-byte) numbers. All non-empty geometries include at least one pair of (X,Y) coordinates. Empty geometries contain no coordinates.

    Coordinates are related to the SRID. For example, in different coordinate systems, the distance between two objects may differ even when objects have the same coordinates, because the distance on the planar coordinate system and the distance on the geocentric system (coordinates on the Earth's surface) are different things.

  • Its interior, boundary, and exterior.

    Every geometry occupies some position in space. The exterior of a geometry is all space not occupied by the geometry. The interior is the space occupied by the geometry. The boundary is the interface between the geometry's interior and exterior.

  • Its MBR (Minimum Bounding Rectangle), or Envelope. This is the bounding geometry, formed by the minimum and maximum (X,Y) coordinates:

    ((MINX MINY, MAXX MINY, MAXX MAXY, MINX MAXY, MINX MINY))
    
  • Whether the value is simple or non-simple. Geometry values of types (, , ) are either simple or non-simple. Each type determines its own assertions for being simple or non-simple.

  • Whether the value is closed or not closed. Geometry values of types (, ) are either closed or not closed. Each type determines its own assertions for being closed or not closed.

  • Whether the value is empty or non-empty A geometry is empty if it does not have any points. Exterior, interior, and boundary of an empty geometry are not defined (that is, they are represented by a value). An empty geometry is defined to be always simple and has an area of 0.

  • Its dimension. A geometry can have a dimension of –1, 0, 1, or 2:

    • –1 for an empty geometry.

    • 0 for a geometry with no length and no area.

    • 1 for a geometry with non-zero length and zero area.

    • 2 for a geometry with non-zero area.

    objects have a dimension of zero. objects have a dimension of 1. objects have a dimension of 2. The dimensions of , , and objects are the same as the dimensions of the elements they consist of.

16.2.3. Class Point

A is a geometry that represents a single location in coordinate space.

Examples

  • Imagine a large-scale map of the world with many cities. A object could represent each city.

  • On a city map, a object could represent a bus stop.

Properties

  • X-coordinate value.

  • Y-coordinate value.

  • is defined as a zero-dimensional geometry.

  • The boundary of a is the empty set.

16.2.4. Class Curve

A is a one-dimensional geometry, usually represented by a sequence of points. Particular subclasses of define the type of interpolation between points. is a non-instantiable class.

Properties

  • A has the coordinates of its points.

  • A is defined as a one-dimensional geometry.

  • A is simple if it does not pass through the same point twice.

  • A is closed if its start point is equal to its endpoint.

  • The boundary of a closed is empty.

  • The boundary of a non-closed consists of its two endpoints.

  • A that is simple and closed is a .

16.2.5. Class LineString

A is a with linear interpolation between points.

Examples

  • On a world map, objects could represent rivers.

  • In a city map, objects could represent streets.

Properties

  • A has coordinates of segments, defined by each consecutive pair of points.

  • A is a if it consists of exactly two points.

  • A is a if it is both closed and simple.

16.2.6. Class Surface

A is a two-dimensional geometry. It is a non-instantiable class. Its only instantiable subclass is .

Properties

  • A is defined as a two-dimensional geometry.

  • The OpenGIS specification defines a simple as a geometry that consists of a single “patch” that is associated with a single exterior boundary and zero or more interior boundaries.

  • The boundary of a simple is the set of closed curves corresponding to its exterior and interior boundaries.

16.2.7. Class Polygon

A is a planar representing a multisided geometry. It is defined by a single exterior boundary and zero or more interior boundaries, where each interior boundary defines a hole in the .

Examples

  • On a region map, objects could represent forests, districts, and so on.

Assertions

  • The boundary of a consists of a set of objects (that is, objects that are both simple and closed) that make up its exterior and interior boundaries.

  • A has no rings that cross. The rings in the boundary of a may intersect at a , but only as a tangent.

  • A has no lines, spikes, or punctures.

  • A has an interior that is a connected point set.

  • A may have holes. The exterior of a with holes is not connected. Each hole defines a connected component of the exterior.

The preceding assertions make a a simple geometry.

16.2.8. Class GeometryCollection

A is a geometry that is a collection of one or more geometries of any class.

All the elements in a must be in the same Spatial Reference System (that is, in the same coordinate system). There are no other constraints on the elements of a , although the subclasses of described in the following sections may restrict membership. Restrictions may be based on:

  • Element type (for example, a may contain only elements)

  • Dimension

  • Constraints on the degree of spatial overlap between elements

16.2.9. Class MultiPoint

A is a geometry collection composed of elements. The points are not connected or ordered in any way.

Examples

  • On a world map, a could represent a chain of small islands.

  • On a city map, a could represent the outlets for a ticket office.

Properties

  • A is a zero-dimensional geometry.

  • A is simple if no two of its values are equal (have identical coordinate values).

  • The boundary of a is the empty set.

16.2.10. Class MultiCurve

A is a geometry collection composed of elements. is a non-instantiable class.

Properties

  • A is a one-dimensional geometry.

  • A is simple if and only if all of its elements are simple; the only intersections between any two elements occur at points that are on the boundaries of both elements.

  • A boundary is obtained by applying the “mod 2 union rule” (also known as the “odd-even rule”): A point is in the boundary of a if it is in the boundaries of an odd number of elements.

  • A is closed if all of its elements are closed.

  • The boundary of a closed is always empty.

16.2.11. Class MultiLineString

A is a geometry collection composed of elements.

Examples

  • On a region map, a could represent a river system or a highway system.

16.2.12. Class MultiSurface

A is a geometry collection composed of surface elements. is a non-instantiable class. Its only instantiable subclass is .

Assertions

  • Two surfaces have no interiors that intersect.

  • Two elements have boundaries that intersect at most at a finite number of points.

16.2.13. Class MultiPolygon

A is a object composed of elements.

Examples

  • On a region map, a could represent a system of lakes.

Assertions

  • A has no two elements with interiors that intersect.

  • A has no two elements that cross (crossing is also forbidden by the previous assertion), or that touch at an infinite number of points.

  • A may not have cut lines, spikes, or punctures. A is a regular, closed point set.

  • A that has more than one has an interior that is not connected. The number of connected components of the interior of a is equal to the number of values in the .

Properties

  • A is a two-dimensional geometry.

  • A boundary is a set of closed curves ( values) corresponding to the boundaries of its elements.

  • Each in the boundary of the is in the boundary of exactly one element.

  • Every in the boundary of an element is in the boundary of the .