SAP Sybase IQ follows the SQL Multimedia (SQL/MM) standard for storing and accessing geospatial data. A key component of this standard is the use of the ST_Geometry type hierarchy to define how geospatial data is created. Within the hierarchy, the prefix ST is used for all data types (also referred to as classes or types).
When a column is identified as a specific type, the values of the type and its subtypes can be stored in the column. For example, a column identified as ST_GeomCollection can also store the ST_MultiPoint, ST_MultiSurface, ST_MultiCurve, ST_MultiPolygon, and ST_MultiLineString values.
The following diagram illustrates the hierarchy of the ST_Geometry data types and their subtypes:
The types on the left are supertypes (or base types) for the subtypes (or derived types) on the right.
SAP Sybase IQ supports the following spatial data types:
ST_Dimension returns 0 for non-empty points.
In GIS data, points are typically used to represent locations such as addresses, or geographic features such as a mountain.
In GIS data, linestrings are typically used to represent rivers, roads, or delivery routes.
ST_Dimension returns 2 for non-empty polygons.
In GIS data, polygons are typically used to represent territories (counties, towns, states, and so on), lakes, and large geographic features such as parks.
In GIS data, multipoints are typically used to represent a set of locations.
In GIS data, multipolygons are often used to represent territories made up of multiple regions (for example a state with islands), or geographic features such as a system of lakes.
In GIS data, multilinestrings are often used to represent geographic features like rivers or a highway network.
A subtype (or derived type) is more specific than its supertype (or base type). For example, ST_LineString is a more specific type of ST_Curve.
A subtype inherits all methods from all supertypes. For example, ST_Polygon values can call methods from the ST_Geometry, ST_Surface and ST_CurvePolygon supertypes.
A value of a subtype can be automatically converted to any of its supertypes. For example, an ST_Point value can be used where a ST_Geometry parameter is required, as in point1.ST_Distance( point2 ).
A column or variable can store a values of any subtype. For example, a column of type ST_Geometry(SRID=4326) can store spatial values of any type.
A column, variable, or expression with a declared type can be treated as, or cast to a subtype. For example, you can use the TREAT expression to change a ST_Polygon value in a ST_Geometry column named geom to have declared type ST_Surface so you can call the ST_Area method on it with TREAT( geom AS ST_Surface ).ST_Area().