Spatial

From Oracle FAQ

Jump to: navigation, search

Oracle Spatial is an option of the Oracle database that allows users to store geographical or location information. Some examples: population by county, amount of sales by state, amount of employees per site, etc.

Contents

Functionality provided

Oracle Spatial provides all the functionality that Locator provided. In addition, it also supports:

  • Linear referenced features e.g. roads which store the distance along the road
  • Network models, such as road networks, allowing rapid calculation of shortest paths
  • Topological relationships can be stored, such as this property boundary touches this neighbouring boundary. Generally used by data producers wishing to edit high integrity spatial data
  • Storage of images such as satellite and aerial photography
  • A geocoder that translates address data to coordinate
  • Some more complex spatial functions, mainly for analysis and data aggregation

History

Spatial was first introduced with Oracle 8.1.5.

Licensing

Oracle Spatial is only available with Oracle Enterprise Edition as a separately licensed option.

Example

Create a spatial table to store GPS (Global Positioning System) coordinates:

CREATE TABLE gps (longlat MDSYS.SDO_GEOMETRY);

Register the spatial table:

INSERT INTO user_sdo_geom_metadata VALUES('GPS', 'LONGLAT',
        mdsys.sdo_dim_array(
        mdsys.sdo_dim_element('Long', -15, 25, 0.005),
        mdsys.sdo_dim_element('Lat', -35, -15, 0.005)), 8307);

Create a spatial index:

CREATE INDEX gps_ind ON gps(longlat) INDEXTYPE IS mdsys.spatial_index;

Load a record:

INSERT INTO gps VALUES (
   SDO_GEOMETRY(2003, 8307, NULL, SDO_ELEM_INFO_ARRAY(1, 1003, 1), SDO_ORDINATE_ARRAY(
          3428099223, -3.342E+09,
          3427750794, -3.342E+09,
          3427655045, -3.342E+09,
          3427548248, -3.342E+09,
          3427542723, -3.342E+09)));

Also see

  • Locator - scaled down "free" version of Oracle Spatial
  • Mapviewer - Oracle's map rendering solution

External links

Personal tools