Create Spatial Type (Data Management)

Summary

Adds the ST_Geometry SQL type, subtypes, and functions to an Oracle or a PostgreSQL database. This allows you to use the ST_Geometry SQL type to store geometries in a database that does not contain a geodatabase. You can also use this tool to upgrade the existing ST_Geometry type, subtypes, and functions in an Oracle or a PostgreSQL database.

Usage

Parameters

LabelExplanationData Type
Input Database Connection

The input_database is the database connection file (.sde) that connects to the Oracle or PostgreSQL database. You must connect as a database administrator user; in Oracle, you must connect as the sys user.

Workspace
SDE User Password

The password for the sde database user. If the sde user does not exist in the database, it will be created and will use the password you provide. The password policy of the underlying database will be enforced. If the sde user does exist in the database or database cluster, this password must match the existing password.

Encrypted String
Tablespace Name
(Optional)

The name of a tablespace that will be set as the default tablespace for the sde user in Oracle. If the tablespace name does not exist, it will be created in the Oracle default storage location. If a tablespace with the specified name does exist, it will be set as the sde user's default.

String
ST_Geometry Shape Library Path
(Optional)

The location on the Oracle server where the st_shape library resides.

File

Derived Output

LabelExplanationData Type
Output Workspace

The updated database.

Workspace

arcpy.management.CreateSpatialType(input_database, sde_user_password, {tablespace_name}, {st_shape_library_path})
NameExplanationData Type
input_database

The input_database is the database connection file (.sde) that connects to the Oracle or PostgreSQL database. You must connect as a database administrator user; in Oracle, you must connect as the sys user.

Workspace
sde_user_password

The password for the sde database user. If the sde user does not exist in the database, it will be created and will use the password you provide. The password policy of the underlying database will be enforced. If the sde user does exist in the database or database cluster, this password must match the existing password.

Encrypted String
tablespace_name
(Optional)

The name of a tablespace that will be set as the default tablespace for the sde user in Oracle. If the tablespace name does not exist, it will be created in the Oracle default storage location. If a tablespace with the specified name does exist, it will be set as the sde user's default.

String
st_shape_library_path
(Optional)

The location on the Oracle server where the st_shape library resides.

File

Derived Output

NameExplanationData Type
out_workspace

The updated database.

Workspace

Code sample

CreateSpatialType example 1 (Python window)

Execute the tool on a Microsoft Windows computer to create or upgrade the ST_Geometry type in an Oracle database named db_ora using an existing connection file. The password for the sde user is specified, a tablespace named sdetbsp is created, and the location of the st_shape file on the Oracle server is specified.


import arcpy
arcpy.CreateSpatialType_management(
    "D:/connections/connection_to_db_ora.sde", "ed$pwd", "sdetbsp", 
    r"c:\st_geometry\st_shapelib.dll")
CreateSpatialType example 2 (Python window)

Execute the tool on a Linux computer to create or upgrade the ST_Geometry type in a PostgreSQL database named sp_pg using an existing connection file and the sde user's password is set.


import arcpy
arcpy.CreateSpatialType_management(
    "/ragsrh/users/connections/connection_to_sp_pg.sde", "$Upass", "sdetbsp", 
    "/st_geometry/libst_shapelib.so")

Environments

This tool does not use any geoprocessing environments.

Related topics