ArcGIS for Desktop

  • Documentation
  • Pricing
  • Support

  • My Profile
  • Help
  • Sign Out
ArcGIS for Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS for Desktop

A complete professional GIS

ArcGIS for Server

GIS in your enterprise

ArcGIS for Developers

Tools to build location-aware apps

ArcGIS Solutions

Free template maps and apps for your industry

ArcGIS Marketplace

Get apps and data for your organization

  • Documentation
  • Pricing
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

Help

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • More...

Create Spatial Type

  • Summary
  • Usage
  • Syntax
  • Code sample
  • Environments
  • Licensing information

Summary

The Create Spatial Type tool adds or upgrades the ST_Geometry SQL type, subtypes, and functions to an Oracle or PostgreSQL database. This allows you to use the ST_Geometry SQL type to store geometries in a database that does not contain a geodatabase. This tool also can be used to upgrade an existing ST_Geometry installation in an Oracle or PostgreSQL database.

Usage

  • Only supported in Oracle and PostgreSQL databases.

Syntax

CreateSpatialType_management (input_database, sde_user_password, {tablespace_name}, {st_shape_library_path})
ParameterExplanationData 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 provided. The password policy of the underlying database will be enforced. If the sde user already exists in the database or database cluster, this password must match the existing password.

Encrypted String
tablespace_name
(Optional)

For Oracle, you can provide the name for a tablespace to be set as the default tablespace for the sde user. If the tablespace does not already exist, it will be created in the Oracle default storage location. If a tablespace with the specified name already exists, it will be set as the sde user's default.

String
st_shape_library_path
(Optional)

For Oracle, provide the location on the Oracle server where you placed the st_shape library.

File

Code sample

CreateSpatialType example 1

Executes the tool on a 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 module
import arcpy

arcpy.CreateSpatialType_management("C:\Documents and Settings\administrator\Application Data\ESRI\ArcCatalog\connection_to_db_ora.sde", "ed$pwd", "sdetbsp", "//ora/userfiles")
CreateSpatialType example 2

Executes 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 module
import arcpy

arcpy.CreateSpatialType_management("/ragsrh/users/ags/arcgis/server10.1/connections/connection_to_sp_pg.sde", "$Upass", "", "")

Environments

This tool does not use any geoprocessing environments

Licensing information

  • ArcGIS for Desktop Basic: No
  • ArcGIS for Desktop Standard: Yes
  • ArcGIS for Desktop Advanced: Yes

Related topics

  • Databases and ST_Geometry

ArcGIS for Desktop

  • Home
  • Documentation
  • Pricing
  • Support

ArcGIS Platform

  • ArcGIS Online
  • ArcGIS for Desktop
  • ArcGIS for Server
  • ArcGIS for Developers
  • ArcGIS Solutions
  • ArcGIS Marketplace

About Esri

  • About Us
  • Careers
  • Insiders Blog
  • User Conference
  • Developer Summit
Esri
Tell us what you think.
© Copyright 2016 Environmental Systems Research Institute, Inc. | Privacy | Legal