sdegroup

The sdegroup command merges features by combining their geometries into multipart shapes. Features are grouped by tiles or by a business table attribute.

Usage syntax

sdegroup -o append -S <source_layer,spl_column>
-T <target_layer,spl_column> [-c <commit_interval>]
[-D <database_name>] [-s <server_name>] [-k <config_keyword>]
[-i {<service> | <port#> | <direct connection>}] [-a {none | all | file=<file_name>}]
[-w <"where_clause">] [-t <Tile size> | column=<col_name> ]
-u <DB_user_name> [-p <DB_user_password>] [-N] [-q]
 

sdegroup -o create -S <source_layer,spl_column> -T <target_layer, spl_column>
-e <entity_type> [-a {none | all | file=<file_name>}] [-c <commit_interval>]
[-k <config_keyword>] [-w <"where_clause">] [spatial index
[-i {<service> | <port#> | <direct connection>}] [-s <server_name>]
[-D <database_name>] -u <DB_user_name> [-p <DB_user_password>] [-q]
[-t <Tile_size> | column=<col_name>]
 

sdegroup -o init -S <source_layer,spl_column>
-T <target_layer,spl_column> [-a {none | all | file=<file_name>}]
[-c <commit_interval>] [-k <config_keyword>] [-w <"where_clause">]
[-i {<service> | <port#> | <direct connection>}] [-s <server_name>]
[-D <database_name>] -u <DB_user_name> [-p <DB_user_password>]
[-N] [-q] [-t <Tile_size> | column=<col_name>]
 

Where

[Spatial_Index] := [-g {<grid_size1> [,<grid_size2> [,<grid_size3>]] |
GRID,<grid_1>[,<grid_2>[,<grid_3>]] | NONE | RTREE | AUTOMATIC]
 

sdegroup -h
 

sdegroup -?
 

Operations

Operation Description
append Adds features from a source feature class to any existing target feature class
create Creates a new feature class and imports features into it from a source feature class based on a grouping of shapes to a single feature
init Deletes all features from an existing target feature class before importing the grouped features from the source feature class

 

Options

Options Description
-a Attribute modes

none: Do not load any attributes (default).

all: Load all attribute columns.

If no attribute table exists for the feature, one is 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 <shape_column> [ sde_column]

The shape_column selects the column to be output; the sde_column is the new name to be specified.

-c Commit rate
-D Database or data source name (not supported on Oracle)
-e Entity types allowed (psla+)

If your source feature class has multiple shape types but you restrict the entity type to one shape type, only that shape type is copied to the target feature class. Valid entity types are as follows:

p: Point shapes
s: Line (spaghetti) shapes
l: Simple line (line string) shapes
a: Area shapes
+: Multipart shapes

For example, if the source feature class has lines and area shapes, but you use -e a+, only area shapes will be grouped and written to the new feature class.

-g
 
Spatial index type and parameters
 
<grid1,grid2,grid3> or
GRID,<grid_sz1>[,<grid_sz2>[,<grid_sz3>]]
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.

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 is 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 there are no valid envelopes 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
-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)
-N No verification is performed; the operation begins immediately after being invoked.
-o Operation
-p DBMS user password
-q Quietall titles and warnings are suppressed.
-s ArcSDE server host name (default: localhost)
-S Source feature class and spatial column names

If you are not the owner of the table, you must qualify the table name as owner.table.

-t Either the size of the tiles (default: 2) or the name of a column containing the values on which the features are to be grouped
-T Target feature class and spatial column names

If you are not the owner of the table, you must qualify the table name as owner.table.

-u DBMS user name
-w SQL WHERE clause

The WHERE clause is used to limit the records/values from the source table that are brought into the target feature class.

 

Discussion

The sdegroup command uses either tiles or a column value to group shapes into new multipart shapes. Using sdegroup can improve performance and display speed by reducing the number of rows that must be fetched from the database. However, you will lose the attribute data. The new table will be populated with the attribute values of the first feature for each new feature.

If you are grouping on a tile size, use a common viewing or query area to determine the tile size. If clients usually want to see an area of 1,600 square miles (40 by 40 miles) on a feature class that's 40,000 square miles (200 by 200 miles), you might want to use a tile size of 40. This will group the original features into 25 new features. Remember to consider the unit of measure of the feature class. If the feature class's unit of measure is feet, you would use 211,200 for the previous example.

Grouping on a column is usually done to combine all the features that have the same value into a single feature. For instance, if a feature class containing roads contains roads that are segmented into many line strings, roads with the same name could be combined into a single multiline string by grouping on a NAME column.

If the spatial index of the target and source feature class is a grid, you should increase the size of the grid cells, because you're reducing the number of features in each grid. How much depends on the size of the resulting grouped features. Run sdelayer -o si_stats to obtain grid statistics of the resulting target feature class, and determine if an adjustment to the grid cell size is necessary.

 

Examples

Add grouped features from a source feature class to an existing feature class

Use the append operation to bring additional grouped features into an existing feature class.

sdegroup -o append -S arroyos,shape -T rivers,shape -u av

Create a new feature class containing grouped features

The create operation is used to make new grouped feature classes.

Polygon and multipolygon features are grouped into multiline string features. This is done to avoid the loss of topology that would occur if polygon or multipolygon features were grouped into multipolygon features. Topology would be lost because multipolygons cannot share a common boundary. The common boundaries of grouped polygons and multipolygons would be dissolved.

To create a new feature class, target_cities, from the original cities feature class, use the following command syntax:

sdegroup -o create -S cities,shape -T target_cities,shape -u av -p mo -t 1 -e p+ -g 20,0,0 -i esri_81

The tile size is 1, and only points will be copied from the cities feature class.

In this example, the new feature class, target_roads, combines line strings from the source feature class roads into multiline strings based on their name:

sdegroup -o create -S roads,shape -T target_roads,shape -u av -p mo -t column=name -e sl+ -g 20,0,0 -i esri_81

The next example creates the target feature class grp_cities with values from the source feature class cities. It uses a WHERE clause to restrict the values from the cities.shape column, only bringing in those with values greater than 2.

sdegroup -o create -S cities,shape -T grp_cities,shape -w "shape > 2" -e p+ -a all -t 2

Delete the contents of an existing feature class then add new grouped features

The init operation will delete the features in an existing feature class, then repopulate the feature class with grouped features from the specified source file.

sdegroup -o init -S schools,shape -T elem_schools,shape -u av

 

Home

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