About Accessing Data in Spatial AI

Spatial data refers to layers of geometries, such as points, lines, and polygons.

The geometries record the location and shape of spatial objects and are associated with other types of data for analysis (refer to Oracle Spatial Developer's Guide for more information). Spatial AI API provides the SpatialDataFrame class, a data structure that unifies how spatial data is accessed in spatial analysis and machine learning workflows.

A SpatialDataFrame instance is created by calling the create() class method and passing in a reference to the data, which is called a dataset. A dataset refers to a data source and contains the connection and location of the source data.

The following table lists the four types of datasets (or data sources) that are supported.

Data Source Description
DBSpatialDataset A reference to a database table with a geometry layer.
FileSpatialDataset A reference to a directory or file in a spatial format within a local file system.
PARObjStoreSpatialDataset A reference to a folder or object in a spatial format located in OCI Object Store containing a Pre-Authenticated Request URL.
GeoDataFrameDataset A reference to an existing GeoDataFrame.

The following code example shows how to create an instance of SpatialDataFrame using DBSpatialDataset as data source to reference the database table la_block_groups.

import oml
from oraclesai import SpatialDataFrame, DBSpatialDataset

block_groups = SpatialDataFrame.create(DBSpatialDataset(table='la_block_groups', schema='oml_user'))