Spatial concepts

The Netezza Performance Server Spatial and Spatial ESRI cartridges contain functions and capabilities that let you query information about geometric features or geographical data.

For example:
  • The location of a store, restaurant, a wireless service tower, national park, or other landmark
  • A plot or area of land, such as an office park, a county or precinct, or a wireless coverage zone
  • A running feature such as a street, river, railway line, tunnel, or power line
You can correlate spatial data with other data to allows powerful interpretations as well as images of the data correlations. For example:
  • Identify the number of wireless calls that occur in a particular area to improve the planning process for the addition of new towers for better wireless service
  • Map the location of stores and calculate the distance between customer addresses and the store location to plan advertising coverage
  • Identify an aquifer area and plan a buffer around it to calculate the impact and cost of a fence or enclosure protecting the water zone from unauthorized access

Spatial data typically originates from three sources: it can be derived from business data, calculated using spatial functions, or imported from external sources or databases.

Geometry types

There are two main categories of geometry types:
  • An instantiated type can be rendered visually in a mapping or image application, and has a corresponding constructor function.
    Point
    Represents a specific location, such as a city, an intersection of two streets, a radio tower, or a building.
    Linestring
    Represents a linear feature such as a street, trail, route, river, or power line.
    Polygon
    Represents an area or parcel, such as a university campus, a homeowner’s property, a park, a floodplain, a service coverage area, or a floor plan.
    Multipoint
    Represents a collection of points.
    Multistring
    Represents a collection of linestrings.
    Multipolygon
    Represents a collection of polygons.
    Geometry collection
    Represents a collection of geometries of any type.
  • An abstract (or non-instantiated) type cannot be rendered visually in mapping or image applications and does not have a corresponding constructor function. It can only be passed as a parameter to another spatial function.
    Geometry
    The abstract type that includes all geometries.
    Curve
    The abstract type for Linestring geometries.
    Surface
    The abstract type for Polygon geometries.
    MultiCurve
    The abstract type for Multistring geometries.
    MultiSurface
    The abstract type for Multipolygon geometries.

For a more complete description of the geometry types, refer to the OpenGIS standard specification.

Figure 1. Geometry types

Geometric Properties

Geometric types have coordinate and dimension properties:
  • Coordinates define location, shape, and size:
    • X—left or right
    • Y—up or down
    • Z—altitude or depth
    • M—a measure associated with the object, such as the distance along a linestring from the start point, the temperature at a geographical location, the flow rate of a pipe, or the speed limit for a particular stretch of roadway
  • The number of dimensions specifies whether an object is empty, a point, a line, or a polygon:
    • -1—an empty object
    • 0—a point type
    • 1—a line string
    • 2—a polygon that has an area larger than 0
Note: The Netezza Performance Server Spatial cartridge supports vector objects and spatial operators, as defined in the OpenGIS standard. The cartridge does not support 3D geocodings, raster data, or rater functions.

Simple and non-simple geometries

As defined in the OpenGIS standard, a simple geometry is one that does not have any “anomalous” geometric points, such as self intersection or self tangency. Each geometric type defines its simple and non-simple aspects. Some examples of non-simple geometries include: a polygon with vertices inside the area of the polygon itself; a linestring that intersects itself; a multipoint that has two points with equal coordinates; a polygon with an interior ring that touches the polygon’s boundary. See Figure 2: Simple and Non-Simple Geometries.

#spatial__fig_spatial_snons shows some examples of simple and non-simple geometries. The two geometries on the left are simple geometries that do not intersect within themselves. On the right side, both the linestring and the polygon have self-intersecting lines, and thus are non-simple. By default, the Netezza Performance Server Spatial cartridge supports only simple geometries; thus, a geometric object definition that is non-simple cannot be inserted or loaded. The only exception is when a geometry is created and the “skipSimpleTest” parameter is set to true (ST_WKBToSQL() and ST_WKTToSQL()).

#spatial__fig_sampsim shows a sample SQL query to add the linestring object illustrated in the Cartesian grid to a table named geomtable. The query successfully adds the linestring object.

#spatial__fig_sampnonsim shows a sample query that defines the non-simple linestring object illustrated in the grid.

Note that the 1st SQL query returns an error. The 2nd SQL query has the exact same non simple geometry but is successful since the skipSimpleTest is set to “true”.

Note that loading of non-simple geometric data can lead to unexpected, incorrect results when analyzing the non-simple geometries for values such as distance, area, contains, or intersections. To load geometric data from other sources to the Netezza Performance Server database, best practices are available for dealing with potential non-simple geometries in the data.

Spatial geometry types

Geometry types are defined by a new fundamental data type called ST_Geometry. ST_Geometry is a VARCHAR data field that represents a spatial object such as a point, linestring, or polygon. The following data types are subtypes of ST_Geometry:
ST_Point
ST_Curve (non-instantiable)
ST_Linestring
ST_Surface (non-instantiable)
ST_Polygon
ST_Multipoint
ST_MultiCurve (non-instantiable)
ST_MultiLineString
ST_MultiSurface (non-instantiable)
ST_MultiPolygon
ST_GeomCollection
The following subtypes that are defined in the OpenGIS standard cannot be used:
ST_Polyhedral
ST_Text

In the OpenGIS standard, each geometry type has a defined integer value. #spatial__table_opengis shows the integer code values and the number of coordinates for each type. These codes are used by the Netezza Performance Server spatial functions.

Table 1. OpenGIS standard geometry type values
Code Geometry Types Coordinates
0 GEOMETRY X Y
1 POINT
2 LINESTRING
3 POLYGON
4 MULTIPOINT
5 MULTILINESTRING
6 MULTIPOLYGON
7 GEOMCOLLECTION
13 CURVE
14 SURFACE
15 POLYHEDRALSURFACE
1000 GEOMETRYZ X Y Z
1001 POINTZ
1002 LINESTRINGZ
1003 POLYGONZ
1004 MULTIPOINTZ
1005 MULTILINESTRINGZ
1006 MULTIPOLYGONZ
1007 GEOMCOLLECTIONZ
1013 CURVEZ
1014 SURFACEZ
1015 POLYHEDRALSURFACEZ
2000 GEOMETRYM X Y M
2001 POINTM
2002 LINESTRINGM
2003 POLYGONM
2004 MULTIPOINTM
2005 MULTILINESTRINGM
2005 MULTILINESTRINGM
2006 MULTIPOLYGONM
2007 GEOMCOLLECTIONM
2013 CURVEM
2014 SURFACEM
2015 POLYHEDRALSURFACEM
3000 GEOMETRYZM X Y Z M
3001 POINTZM
3002 LINESTRINGZM
3003 POLYGONZM
3004 MULTIPOINTZM
3005 MULTILINESTRINGZM
3006 MULTIPOLYGONZM
3007 GEOMCOLLECTIONZM
3013 CURVEZM
3014 SURFACEZM
3015 POLYHEDRALSURFACEZM