Register With Geodatabase (Data Management)

Summary

Registers feature classes, tables, views, and raster layers with the geodatabase. Registering is used for data created in the database with third-party tools using SQL or in ArcGIS Pro with tools that do not register with the geodatabase (Create Unregistered Feature Class, Create Unregistered Table, and Create Database View tools).

Only limited functionality is available from ArcGIS clients and services for data is that is not registered. Registration stores information about the items—such as table and column names, spatial extent, and geometry type—in the geodatabase's system tables. This allows the registered items to participate in geodatabase functionality.

Learn more about how to register a table or view with the geodatabase

Usage

  • Views you create in file and enterprise geodatabases using the Create Database View tool can be registered with the geodatabase.

  • To register with an enterprise geodatabase, you must be connected as the owner of the input dataset.

  • Views that are registered with the geodatabase cannot participate in some geodatabase behavior and are read-only through ArcGIS clients. Views are not supported in feature services even if you register them with the geodatabase.

Parameters

LabelExplanationData Type
Input Datasets

The feature class, table, view, or raster created using third-party tools or SQL, or the view created using the Create Database View tool that will be registered with the geodatabase. The dataset must exist in the same database as the geodatabase. The workspaces supported include file, mobile, and enterprise geodatabases.

Table View; Raster Layer
Object ID Field
(Optional)

The field that will be used as the ObjectID field. When using an existing field from the input datasets, an integer data type is required. If an existing field is not used, an ObjectID field will be created and populated.

Note:

When registering a view, an existing integer field is required.

Field
Shape Field
(Optional)

The field that identifies the shape of the features. If the input dataset contains a spatial data type column, include this field during the registration process.

Field
Geometry Type
(Optional)

Specifies the geometry type. If the Shape Field parameter value is provided, you must specify a geometry type. Supported geometry types are point, multipoint, polygon, polyline, and multipatch. If the dataset being registered contains existing features, the geometry type specified must match the entity type of these features.

  • PointThe geometry type will be point.
  • MultipointThe geometry type will be multipoint.
  • PolygonThe geometry type will be polygon.
  • PolylineThe geometry type will be polyline.
  • MultipatchThe geometry type will be multipatch.
String
Coordinate System
(Optional)

If the Shape Field parameter value is provided and the table is empty, specify the coordinate system to be used for features. If the dataset being registered contains existing features, the coordinate system specified must match the coordinate system of the existing features.

Spatial Reference
Specify Extent
(Optional)

If the Shape Field parameter value is provided, specify the allowable coordinate range for x,y coordinates. If the dataset being registered contains existing features, the extent of the existing features will be used.

Envelope

Derived Output

LabelExplanationData Type
Registered Dataset

The registered dataset.

Table

arcpy.management.RegisterWithGeodatabase(in_dataset, {in_object_id_field}, {in_shape_field}, {in_geometry_type}, {in_spatial_reference}, {in_extent})
NameExplanationData Type
in_dataset

The feature class, table, view, or raster created using third-party tools or SQL, or the view created using the Create Database View tool that will be registered with the geodatabase. The dataset must exist in the same database as the geodatabase. The workspaces supported include file, mobile, and enterprise geodatabases.

Table View; Raster Layer
in_object_id_field
(Optional)

The field that will be used as the ObjectID field. When using an existing field from the input datasets, an integer data type is required. If an existing field is not used, an ObjectID field will be created and populated.

Note:

When registering a view, an existing integer field is required.

Field
in_shape_field
(Optional)

The field that identifies the shape of the features. If the input dataset contains a spatial data type column, include this field during the registration process.

Field
in_geometry_type
(Optional)

Specifies the geometry type. If the in_shape_field parameter value is provided, you must specify a geometry type. If the dataset being registered contains existing features, the geometry type specified must match the entity type of these features.

  • POINTThe geometry type will be point.
  • MULTIPOINTThe geometry type will be multipoint.
  • POLYGONThe geometry type will be polygon.
  • POLYLINEThe geometry type will be polyline.
  • MULTIPATCHThe geometry type will be multipatch.
String
in_spatial_reference
(Optional)

If the in_shape_field parameter value is provided and the table is empty, specify the coordinate system to be used for features. If the dataset being registered contains existing features, the coordinate system specified must match the coordinate system of the existing features. Valid values are a Spatial Reference object, a file with a .prj extension, or a string representation of a coordinate system.

Spatial Reference
in_extent
(Optional)

If the in_shape_field parameter value is provided, specify the allowable coordinate range for x,y coordinates in the following order: "XMin YMin XMax YMax". If the dataset being registered contains existing features, the extent of the existing features will be used.

Envelope

Derived Output

NameExplanationData Type
reg_dataset

The registered dataset.

Table

Code sample

RegisterWithGeodatabase example 1 (Python window)

The following Python window script demonstrates how to use the RegisterWithGeodatabase function in the Python window for a spatial table that contains point geometry features. Since the underlying table contains existing features, the coordinate reference and feature extent information can be discovered and do not need to be explicitly listed.

import arcpy
arcpy.env.workspace = r"Database Connections/connection.sde"
arcpy.management.RegisterWithGeodatabase("database.owner.COUNTIES", "OID", 
                                         "Shape", "POINT")
RegisterWithGeodatabase example 2 (stand-alone script)

The following stand-alone script is a simple example of how to apply the RegisterWithGeodatabase function in scripting.

# RegisterWithGeodatabase.py
# Description: Simple example showing use of RegisterWithGeodatabase tool
 
# Import system modules
import arcpy

# Set variables
inTable = r"c:\connectionFiles\Connection to esriServer.sde\database.dbo.cities"
oid_field = "OID"
shape_field = "Shape"
geometry_type = "POINT"
sr = arcpy.SpatialReference(4326)
in_extent = "11 10 14 34"

# Process: Register With Geodatabase
arcpy.management.RegisterWithGeodatabase(inTable, oid_field, shape_field, 
                                         geometry_type, sr, in_extent)
RegisterWithGeodatabase example 3 (stand-alone script)

Register a view named trees in a file geodatabase.

# RegisterWithGeodatabase.py
# Description: Example showing use of RegisterWithGeodatabase tool with a file 
#              gdb view.

# Import system modules
import arcpy

# Create a view in the geodatabase
arcpy.management.CreateDatabaseView("C:\\testdata\\mytest.gdb",
                                    "trees",
                                    "select objectid, owner, parcel from inventory where type = trees")

# Set variables
inTable = r"C:\\testdata\\mytest.gdb\\trees"

# Process: Register With Geodatabase
arcpy.management.RegisterWithGeodatabase(inTable, "objectid")

Environments

Licensing information

  • Basic: No
  • Standard: Yes
  • Advanced: Yes

Related topics