cov2sde

The cov2sde command converts ArcInfo coverages to ArcSDE geodatabase feature classes.

Note: This function is not supported on 64-bit Windows, Linux, or HP-Itanium.

Usage syntax

cov2sde -o append -l <table,column> [-V <version_name>]
-f <cover,feature_cls> [-r <anno_relate>] [-d <dissolve_item>]
[-a {none | all | file=<file_name>}] [-c <commit_interval>] [-v]
[-i {<service> | <port#> | <direct connection>}] [-s <server_name>]
[-D <database_name>] [-u <DB_user_name>] [-p <DB_user_password>]
 

cov2sde -o create -l <table,column> -f <cover,feature_cls>
[Spatial_Index] [{-R <SRID> | [Spatial_Ref_Opts]}]
[-r <anno_relate>] [-d <dissolve_item>] [-M <minimum_ID>]
[-S <layer_description_str>] [-e <entity_mask>] [-v]
[-a {none | all | file=<file_name>}] [-k <config_keyword>]
[-V <version_name>] [-C <row_id_column>[,{SDE|USER},<min_ID>]]
[-c <commit_interval>] [-i {<service> | <port#> | <direct connection>}]
[-s <server_name>] [-D <database_name>] -u <DB_user_name>
[-p <DB_user_password>]
 

cov2sde -o init -l <table,column> -f <cover,feature_cls>
[-r <anno_relate>] [-d <dissolve_item>]
[-a {none | all | file=<file_name>}] [-c <commit_interval>]
[-v] [-s <server_name>] [-D <database_name>]
[-i {<service> | <port#> | <direct connection>}]
[-u <DB_user_name>] [-p <DB_user_password>]
 

Where

[Spatial_Ref_Opts] := [-x <xoffset,yoffset,xyscale[,xyClusterTol]>]
[-z <zoffset,zscale[,zClusterTol]>] [-m <moffset,mscale[,mClusterTol]>]
[-G {<projection_ID> | file=<proj_file_name>}]
 
[Spatial_Index] := [-g [Grid_Options] | GRID,[Grid_Options] | AUTOMATIC | NONE | RTREE }]

[Grid_Options] : = [<grid_sz0>[,<grid_sz1>[,<grid_sz2>]] [,][{FULL | SPARSE}]
 

cov2sde -h

cov2sde -?

Operations

Operation Description
append Adds features from the coverage to an existing feature class in the geodatabase (default)
create Creates a new feature class in the geodatabase and imports features into the new feature class from the coverage feature class

An error is returned if the feature class already exists in the geodatabase.

init Deletes all the features of an existing feature class in the geodatabase before importing new features from the coverage feature class

 

Options

Options Description
-a Attribute mode

none: Do not load any attributes (default).

all: Load all attribute columns.

If no attribute table exists for the feature class, one will be created. If one exists, incoming schema must be union compatible with the existing table if the APPEND option is used.

file=<file_name>: File containing lines in the form <INFO_item> [SDE_column]

The INFO_item selects the column to be output; the SDE_column (optional) is the new column name to be specified. Use this option to select only those INFO columns that you want to create in the feature class in the geodatabase. The columns will be ordered in the feature class as they appear in the list.

-c Commit rate (default: The value of the AUTOCOMMIT variable in the SERVER_CONFIG table)
-C RowID's column_name, column_type, and minimum_ID
-d Dissolve item for Map Librarian layer only
-D Database name (not supported on Oracle)
-e Entity types allowed (npsla3+MA)

n
Nil

p
Point features

s
Line (spaghetti) features

l
Simple line (line string) features

a
Area features

A
Annotation

c
CAD data

3
Three-dimensional features, which can be added to the entity type mask only with the add operation

+
Multipart features

M
Measures on coordinates

The -m option is required to store measure values on each coordinate. Measures can be added to the entity type mask only with the add operation.

-f Input feature class name from:

Coverage: -f <cover,feature_cls>

Librarian: -f <lib_name.layer_name,feature_cls>

ArcStorm: -f <db_name.lib_name.layer_name,feature_cls>

For annotation, regions, and routes, the feature class subclass is specified as: <feature_cls.subclass_name>.

-g Spatial index type and parameters
GRID,<grid_sz1>[,<grid_sz2>[,<grid_sz3>]] ,[FULL|SPARSE] Creates multilevel grid index
(Grid2 and grid3 are optional and are not used with Oracle Spatial, Informix, PostgreSQL, or SQL Server spatial types.)

Grid values are only valid for spatial indexes on feature classes stored in Oracle or SQL Server that use binary storage or feature classes stored in Oracle or DB2 that use ST_Geometry storage.

If you don't enter grid values, it is the same as specifying an AUTOMATIC spatial index type.

FULL grids create a spatial index grid on the entire feature envelope. This is the default option if GRID is specified and is the type of grid always created in ArcSDE 9.1 and lower.

SPARSE grids create spatial index grids only where grids actually include parts of the feature.

See the Discussion section for more details.

AUTOMATIC For Oracle Spatial, Informix, and PostgreSQL, this is RTREE.

For all other storage types, if the layer is in normal IO mode and there are 0 features, the grid type is NONE. If one or more features are present and the layer is in normal IO mode, grid sizes will be calculated and set based on the calculations below. If the layer is in load_only IO mode, grid sizes will be calculated and set based on the calculations below when the layer is returned to normal IO mode.

If no valid envelopes are detected, grid sizes are calculated as:

grid_size1 = 1000000.0 / layerGrid->xyUnits
grid_size2 = 1000000000.0 / layerGrid->xyUnits

If it is a point layer, grid sizes are calculated as:

grid_size1 = 1000.0 / layerGrid->xyUnits

NONE No spatial index is created.
RTREE Creates an R-tree index
-G Projection specifier (default: coverage's projection, if exists) <projection_ID> Projection ID file=<proj_file_name> File containing projection description string
-h or -? Use either of these options to see the usage and options for the command. Note: If using a C shell, use -h or "-\?".
-i ArcSDE service name, port number, or direct connection information (default: esri_sde or 5151)
-k Configuration keyword present in DBTUNE table (default: DEFAULTS)
-l Feature class table and spatial column name
-m Measure offset, measure scale, and measure cluster tolerance separated by commas
-M Layer's minimum ID (default: 1)
-o Operation
-p DBMS user password
-r Annotation relate name to load anno and feature at the same time; relate will be loaded from the INFO table <cover.REL>.
-R Spatial reference ID (SRID)
-s ArcSDE server host name (default: localhost)
-S Map layer description string
-u DBMS user name
-v Verbose option; reports records committed at the commit interval
-V Version name; if specified, uses only the data that belongs to the version, if not specified, uses the default version (default: sde.DEFAULT)

Version names are case sensitive; for example, SDE.DEFAULT is a different version from SDE.default.

-x The x-offset, y-offset, x,y scale values, and x,y cluster tolerance separated by commas

If the -x option is not specified, the x- and y-offset is calculated from the minimum x- and y-coordinate values of the coverage, the x,y scale is calculated from the maximum x or y delta value, and the x,y cluster tolerance is calculated based on the spatial reference system. If the x and y delta values cannot be obtained from the coverage, the default is 0.0, 0.0, 1000. If no spatial reference system is specified, the cluster tolerance is calculated as 2 times the cell resolution.

-z z-offset, z-scale, and z-cluster tolerance separated by commas

If -z is not specified, the values are 0.0, 1.0 for the offset and scale. The cluster tolerance is based on the spatial reference system. If no spatial reference system is defined, cluster tolerance is calculated as 2 times the cell resolution.

 

Discussion

Column names that contain a pound sign (#) or a dash (-) will have different names in the new ArcSDE feature class, because these characters are converted to underscores. Although <cover#> and <cover-id> will be different, cov2sde will automatically match these columns. If multiple coverages with the same items are imported, create only one feature class, then load all subsequent coverages with the -o append operation; the <cover#> and <cover-id> items will be matched automatically.

Feature class to ArcSDE entity (feature) type mapping

Coverage feature class ArcSDE entity (feature) type
point, node point, node
line simple line, line (sl)
polygon area (a)
region.<subclass> multipart area (a+)
route.<subclass> multipart lines with measures (slM+)
anno.<subclass> point, line, simple line, anno (pslA)

It may be necessary to widen the output width of any item using the INFO ALTER command. If the INFO LIST command is displaying asterisks (******) for any of the items of the coverage feature attribute table, increase the items output width. The cov2sde command uses the INFO item definition to derive the ArcSDE column definition. If an item value doesn't display, it will not load into the DBMS table. This problem will manifest itself as a DBMS error stating that the value is larger than the specified column precision allows.

Annotation

Cov2sde won't load feature-associated annotation from Map Librarian layers. To load feature-associated annotation from Map Librarian, extract the data to a coverage then import it from the coverage.

If loading annotations with no subclass using the -o create operation, you must use the -a none option. You can also load annotations with no subclass into an existing feature class with the -o append or -o init operations.

Spatial reference

The create operation requires you to provide a spatial reference. You can use an existing spatial reference system by entering the SRID number. Valid SRID numbers may be obtained by querying the sde.spatial_ref_sys table.

You can also enter the spatial reference by supplying the information directly. Spatial reference information includes the x- and y-coordinate offsets, x- and y-coordinate system units, z-coordinate offset, z-coordinate system units, measures offset, measure system units, and the coordinate reference system. If no false x,y and scale values are provided by the -x option, the extent of the coverage, ArcStorm library, or map library is used to calculate these values automatically. Note that the resulting feature class will have the highest attainable scale factor for that extent. If features that fall outside the original coverage's extent are appended to the feature class with subsequent loading operations, they will be rejected.

Spatial index grid

Beginning with ArcGIS Server 9.2, you have the option to create sparse spatial index grids. Sparse grids populate the spatial index with information for only those grids that actually contain a portion of a feature. For example, if you created a spatial index on a river feature class, only those grids that the river crossed would be indexed for the river.

This could be more efficient for spatial queries, because grids that do not qualify as crossing the feature (in this case, rivers) will be eliminated from the query results during the primary filter process ArcSDE performs when executing spatial queries. Be aware that if you use third-party applications to perform envelope-on-envelope spatial queries, using a sparse index grid will affect query results.

If instead you used a full grid for the rivers, the nonqualifying grids would still be eliminated, but they wouldn't be eliminated until the secondary filter process.

Text fields

When you use the append or init operations to add records to an existing feature class that contains a text field, check to see if the existing text fields are stored in Unicode (SE_NSTRING) format or a format other than (SE_STRING), then, for Oracle or SQL Server databases, ensure your UNICODE_STRING parameter setting in the DBTUNE table will create the same type of text fields. For example, if the feature class had been created prior to the 9.2 release, the text fields would be stored in the ArcSDE type SE_STRING. If your current DBTUNE setting for the UNICODE_STRING parameter of the DEFAULTS configuration keyword is TRUE, the append or init operation will fail because ArcSDE will try to load the text data as SE_NSTRING. Therefore, before adding the new records with init or append, you would need to alter the DBTUNE UNICODE_STRING parameter to false. 

Similarly, if the original feature class had been created while the DEFAULTS UNICODE_STRING parameter was set to true, the parameter was later changed to false, then you tried to add records to the existing feature class using append or init, it would fail. This would be because the feature class's text fields are stored as SE_NSTRING, but you are trying to add the same text fields as SE_STRING. The UNICODE_STRING parameter must be changed back to true before you could successfully run cov2sde -o append or -o init.

For details on altering dbtune parameter values, see the sdedbtune topic.

 

Examples

Append data to an existing feature class

The append operation is used to add features from a coverage to an existing feature class in the geodatabase.

cov2sde -o append -l wells,feature -V myversion -f wells,point

Create a feature class from a coverage

Use the create operation to create a new feature class in the geodatabase by loading data from a coverage, Map Librarian, or ArcStorm layer.

  1. Loading the regions from a coverage

    cov2sde -o create -l country,shape -f country,region.cntry -a all -s tiffany -i esri_av -u andy -p passwrd -g GRID,3000,SPARSE

  2. Loading polygons from an ArcStorm layer

    cov2sde -o create -l counties,feature -f worldas.worldlib.country,polygon -a all -s tiffany
    -i esri_av -u andy -p password -g GRID,FULL

  3. Loading lines from a coverage with feature-associated annotation

    First, establish a relate between the feature attribute table (in this case, AAT) and the text attribute table (TAT). Save the relate to an INFO file named <cover.rel>:

    Arc: relate add
    Relation Name: cityrel
    Table Identifier: cities.tatname
    Database Name: info
    INFO Item: cities-id
    Relate Column: cities-id
    Relate Type: linear
    Relate Access: ro
    Relation Name:

    Arc: relate save cities.rel
    1 Relates saved to file cities.rel

    Arc: q

    Second, specify the name of the relate with -r <relate>. Cov2sde will load the relate from the INFO file called <cover.rel>:

    cov2sde -o create -l cities,feature -f cities,point -r cityrel -g AUTOMATIC -x -180,-90,10000 -e pA -k WORLD -a all -s stout -u world -p world

  4. Loading points from a Map Librarian layer

    cov2sde -o create -l cities,feature -f maplib.cities,point -g SPARSE -x -180,90, 10000 -e slA -k WORLD -a all -s stout -u world -p world

  5. Loading stand-alone annotation from an ArcStorm layer

    cov2sde -o create -l rivernames,feature -f worldas.worldlib.rivers, anno.riv -g AUTOMATIC -x -180,-90,10000 -e slA -k WORLD -a all -s stout -u world -p world

  6. Loading feature-associated annotation from an ArcStorm layer

    First, establish a relate between the feature attribute table (in this case PAT) and the text attribute table (TAT). Save the relate to an INFO file named <database>.<library>.<layer.rel>:

    Arc: relate add
    Relation Name: cityrel
    Table Identifier: !cities.tatname
    Database Name: info
    INFO Item: cities-id
    Relate Column: cities-id
    Relate Type: linear
    Relate Access: ro
    Relation Name:

    Arc: relate save worldas.worldlib.cities.rel
    1 Relates saved to file worldas.worldlib.cities.rel

    Arc: q

    Second, specify the name of the relate with -r <relate>. Cov2sde will load the relate from an INFO file called <database>.<library>.<layer.rel>:

    cov2sde -o create -l cityname,shape -f worldas.worldlib.cities,point -r cityrel -e pA -g NONE -a all -u world -p world

  7. Creating a multiversioned feature class from a polygon coverage

    sdeversion -o create -V version1 -S 0 -A public -d Base version -u andy -p andy -s tiffany -i esri_av

    cov2sde -o create -l country,shape -f country,polygon -a all -s tiffany -i esri_av -u andy -p passwrd -g RTREE -V version1

  8. Setting the row ID column and its initial value

    The row ID column of a feature class's business table must be a unique integer column. The row ID column is always required if the feature class is stored in a DB2 or Informix DBMS or if the feature class contains an Oracle Spatial SDO_GEOMETRY column. Feature classes stored in the SQL Server DBMS and the Oracle DBMS (except those that have an SDO_GEOMETRY column) are not required to have a row ID defined unless they are registered with the geodatabase or they are to be registered as multiversioned.

    For those feature classes required to have a row ID defined, cov2sde creates a unique integer column called objectid. The -C option allows you to control the name, type, and initial value of the row ID column. If not specified, the default objectid column is created.

    If the -C option is specified, the column name can be any name that follows the DBMS naming convention. The default name is objectid. The type can either be maintained by ArcSDE (ArcSDE controls the sequence of values entered into the column, which is required by ArcGIS for any table registered with the geodatabase), or USER maintained, with which your application controls the sequence of values entered into the row ID. The default type is ArcSDE maintained. The initial value of the row ID can be a positive integer. The initial value defaults to 1.

    The -C option is useful if the coverage attribute table contains a unique integer column that can serve as the row ID of the feature class to which you intend to convert the coverage. Keep in mind that if the feature class is registered with the geodatabase, ArcSDE maintains further entry of values into the row ID column.

    The following is an example of a row ID column being created with the -C option. The row ID column is called cid, it is maintained by ArcSDE, and its initial value is set to 1. If the row ID column is required and the -C option is not specified, the row ID column is created with the name objectid, and it is maintained by ArcSDE with an initial value set to 1.

    cov2sde -o create -l country,shape -f country,polygon -a all -C cid,sde,1 -s tiffany -i esri_av -u andy -p passwrd -g AUTOMATIC

Delete existing features and import new ones

Use the init operation to delete the existing features in a feature class in the geodatabase before importing new features from a coverage.

cov2sde -o init -l parcel,shape -f parcel,polygon

 

 

Home

Copyright © Environmental Systems Research Institute, Inc. 2004 - 2010.