What is Oracle Spatial?
Oracle Spatial is an extension to the Oracle database management system (DBMS) that adds a spatial type and spatial query functions to Oracle. It is offered by Oracle using two primary options.
- Oracle Spatial is an optional feature of the Oracle Database Enterprise Edition. In addition to providing the SDO_Geometry type, Oracle Spatial provides a number of additional geospatial capabilities.
- Oracle Locator provides a subset of Oracle Spatial capabilities. It is included as a standard feature of Oracle Database Standard and Enterprise editions. Among other capabilities, it provides the Oracle Spatial geometry type (referred to as SDO_Geometry) and a SQL API to this content.
Oracle Spatial shares duplicate functionality with many geographic information systems including ArcGIS. The primary way in which most ArcGIS users apply Oracle Spatial is as an optional mechanism for geodatabase storage and access in an Oracle DBMS. Essentially, one of the choices that ArcGIS users can make each time they create a new feature class or raster dataset in a geodatabase in Oracle is how to store feature or raster geometry—they can use either the geodatabase or the Oracle Spatial data storage options.
ArcSDE supports Oracle Spatial's Object Relational Model as an optional method to store spatial data. Specifically, Oracle Spatial or Locator geometry can be used to store and manage the feature and raster contents of datasets within ArcSDE geodatabases.
An overview of Oracle Spatial data storage
Oracle Spatial provides a spatial geometry type (MDSYS.SDO_GEOMETRY), spatial metadata schema, indexing methods, functions, and implementation rules, which are described below.
Oracle Locator is a subset of Oracle Spatial. Oracle Locator includes the SDO_GEOMETRY data type along with some of the functionality provided with Oracle Spatial. Oracle Locator can be used with ArcSDE. Refer to Oracle's documentation for an explanation of the difference between Oracle Spatial and Oracle Locator. Throughout this topic, "Oracle Locator" can be used in place of references to "Oracle Spatial."
-
SDO_GEOMETRY
The Oracle Spatial geometry type SDO_GEOMETRY is implemented using Oracle's extensible object-relational type system. The SDO_GEOMETRY type stores information about a geometry including its geometry type, spatial reference ID, interpolation type (straight versus curved), and coordinate values. The SDO_GEOMETRY type in ArcSDE geodatabases supports single and multipart point, line, and area geometry. Geometries can be described as having linear interpolation between coordinates as defined by the OpenGIS Simple Feature Specification. Geometries can also be constructed from circular curves or a combination of both interpolation methods.Application programs are responsible for properly inserting, updating, and fetching the contents of the SDO_GEOMETRY type using Oracle's object-relational SQL interface. Applications are also responsible for ensuring that the content of each geometry adheres to the rules defined in the Oracle Spatial documentation. Oracle provides geometry validation routines that can be executed after inserting geometries. Additionally, beginning with Oracle 11.1.0.7, geometry is validated on index inserts.
Note:Oracle's geometry validation routines do not implement precisely the same set of rules as the ArcSDE geometry validation. However, ArcSDE is designed to write SDO_GEOMETRY that satisfies Oracle's validation rules.
-
Metadata schema
Information about every SDO_GEOMETRY column should be recorded in the Oracle Spatial metadata schema, though Oracle Spatial does not do this automatically. (The Oracle Spatial metadata schema is exposed for each schema as the view USER_SDO_GEOM_METADATA.) The software that creates SDO_GEOMETRY columns must insert the metadata for those columns. ArcSDE does this for any SDO_GEOMETRY feature classes it creates. The metadata contains the spatial column name, the name of the table it resides in and its owner, the Oracle Spatial Reference Identifier (SRID), number of dimensions, the range of each dimension, and its coordinate tolerance.
-
Spatial indexes
Spatial indexes provide fast access to features based on the location of their geometry. For SDO_GEOMETRY, R-tree spatial indexes are generally the most efficient and easiest to create, and Oracle recommends their use in most situations. Oracle Spatial provides the Spatial Index Advisor utility to assist in determining the best type of spatial index for a given table. In addition, consult your Oracle Spatial User's Guide and Reference for detailed information on supported spatial index types, how to create them, and the trade-offs of different spatial index methods.
-
Spatial functions
Oracle Spatial extends SQL with spatial search functions for primary and secondary filtering. Including the SDO_FILTER function in a SQL query performs a primary spatial search utilizing the spatial index. Spatial predicates, such as SDO_RELATE and SDO_CONTAINS, return secondary relationships between pairs of SDO_GEOMETRY objects.Oracle Spatial has spatial transformation functions that change the form of an SDO_GEOMETRY value. For example, the SDO_BUFFER function computes the coordinates of a new SDO_GEOMETRY object as a buffer polygon at a given distance surrounding the original geometry. Other spatial transformation functions include SDO_DIFFERENCE and SDO_INTERSECTION.
-
Coordinate reference and SRID
Oracle Spatial provides access to a number of predefined coordinate reference systems using an SRID value. The SRID value, stored in the SDO_GEOMETRY object, specifies the coordinate reference for the geometry stored in that object. If it is not NULL, the SRID in the SDO_GEOMETRY object is a foreign key into a table containing details about each SRID. This table is MDSYS.CS_SRS. The SDO_TRANSFORM function uses the spatial reference ID to establish coordinate reference transformations. ArcSDE also uses this information to create ArcSDE spatial references.