No label chapter. It also describes the creation of the OGC980461FS schema, which is the schema defined in the OpenGIS project document 98-046r1.
This section describes the creation of the SampleFeatureSchema, which is the example feature schema described in theFDO Provider for ArcSDE does not support the creation or destruction of feature schema (that is, does not support the FdoIApplySchema and FdoIDestroySchema commands.) However, it does support the FdoIDescribeSchema command. The intended use of FDO Provider for ArcSDE is to operate on already existing feature schemas. FDO Provider for ArcSDE supports inserting, selecting, updating, and deleting data in existing schemas.
sdetable and sdelayer commands, which can be used to create a schema in any of the data store technologies used by ArcSDE. This part of the description is generic. Other parts of the description are specific to Oracle and to Windows XP because Oracle is the data store technology and Windows XP is the operating system for this exercise.
You can use FDO Provider for ArcSDE to operate on a new feature schema. However, you must create the schema using ArcSDE tools. In particular you use theFirst, you must create an Oracle username for the feature schema (that is, the name of the Oracle user is the name of the feature schema.) To do this, you connect as system administrator to the Oracle instance used by the ArcSDE server. The following command creates the user and grants to that user the privileges necessary for the ArcSDE tool commands to succeed:
grant connect,resource to <schemaName> identified by <password>
Secondly, you must log in to the host where the ArcSDE server is running. ArcSDE tools are on the host machine where the ArcSDE server resides.
sdetable and sdelayer commands in a command window to create each of the classes. Since you are executing these commands on the host where the ArcSDE server is located, you can omit the server name option. If the ArcSDE server is connected to only one data store, you can omit the service option. For more information about all of the ArcSDE commands, consult the ArcSDE Developer Help Guide.
Finally, execute theIn this sample a feature schema called SampleFeatureSchema is created, which contains one feature class called SampleFeatureClass. This feature class has the following three properties:
sdetable -o create command to add the integer and string properties to SampleFeatureClass. Then, use the sdetable -o alter_reg command to identify the SampleIdentityDataProperty as an identity property. Finally, use the sdelayer -o add command to add the geometric property to SampleFeatureClass. This assumes that only one ArcSDE server service is running so that the -i option is optional. The -i option takes a service name as an argument.
First, use thesdetable -o create command can be invoked as follows:
Thesdetable -o create -t SampleFeatureClass -d “SampleIdentityDataProperty INTEGER(10), SampleNameDataProperty STRING(64)” -u SampleFeatureSchema -p test.
-o option takes the command option name. The -d option takes the column definitions, which is a quoted list of column name/column type pairs delimited by commas. The -u option takes an Oracle database user name, which becomes the feature schema name. The -p option takes a password.
Thesdetable -o alter_reg command is invoked as follows:
Thesdetable -o alter_reg -t SampleFeatureClass -c SampleIdentityDataProperty -C USER -u SampleFeatureSchema -p test
-c option identifies the column name that will be the identity property. The -C option indicates whether SDE is supposed to generate the value or obtain it from the user. You will be prompted to confirm that you want to alter the registration of the table.
Thesdelayer command is invoked as follows:
Thesdelayer -o add -l SampleFeatureClass,SampleGeometricProperty -E 0,0,100,50 -e a -u SampleFeatureSchema -p test
-o option takes the command option name. The -l option identifies the table and column. The -E option identifies the extents; the arguments are <xmin,ymin,xmax,ymax>. The -e option identifies the geometry type with ‘a’ indicating an area shape.
The980946r1. The types of the properties belonging to the classes is similar to that of SampleFeatureClass, namely, an integer, a string, and a geometry. One difference is that the geometry in three of the classes is multipart. Two of them have MULTIPOLYGON geometries, and one of them has a MULTILINESTRING geometry. A multipart geometry is indicated by adding a ‘+’ to the entity argument to the -e option in the sdelayer command. A MULTIPOLYGON geometry is indicated by “-e a+”, and a MULTILINESTRING geometry is indicated by “-e l+”.
This schema contains the ten classes defined in the OpenGIS Project DocumentAn ArcSDE table cannot have two geometries. This restriction impacts the definition of the buildings class, which has a POLYGON and a POINT geometry. We have chosen to add the POINT geometry. The OpenGIS 98-046r1 document defines one query that references building objects, and the POINT geometry supports this query.
ArcSDE Commands That Define the OGC980461FS Classes
sdetable -o create -t lakes -d "fid integer(10), name string(64)" -u OGC980461FS -p test
sdetable -o alter_reg -t lakes -c fid -C user -u OGC980461FS -p test
sdelayer -o add -l lakes,shore -E 0,0,100,50 -e a -u OGC980461FS -p test
sdetable -o create -t road_segments -d "fid integer(10), name string(64), aliases string(64), num_lanes integer(10)" -u OGC980461FS -p test
sdetable -o alter_reg -t road_segments -c fid -C user -u OGC980461FS -p test
sdelayer -o add -l road_segments,centerline -E 0,0,100,50 -e l -u OGC980461FS -p test
sdetable -o create -t divided_routes -d "fid integer(10), name string(64), num_lanes integer(10)" -u OGC980461FS -p test
sdetable -o alter_reg -t divided_routes -c fid -C user -u OGC980461FS -p test
sdelayer -o add -l divided_routes,centerlines -E 0,0,100,50 -e l+ -u OGC980461FS -p test
sdetable -o create -t forests -d "fid integer(10), name string(64)" -u OGC980461FS -p test
sdetable -o alter_reg -t forests -c fid -C user -u OGC980461FS -p test
sdelayer -o add -l forests,boundary -E 0,0,100,50 -e a+ -u OGC980461FS -p test
sdetable -o create -t bridges -d "fid integer(10), name string(64)" -u OGC980461FS -p test
sdetable -o alter_reg -t bridges -c fid -C user -u OGC980461FS -p test
sdelayer -o add -l bridges,position -E 0,0,100,50 -e p -u OGC980461FS -p test
sdetable -o create -t streams -d "fid integer(10), name string(64)" -u OGC980461FS -p test
sdetable -o alter_reg -t streams -c fid -C user -u OGC980461FS -p test
sdelayer -o add -l streams,centerline -E 0,0,100,50 -e l -u OGC980461FS -p test
sdetable -o create -t buildings -d "fid integer(10), address string(64)" -u OGC980461FS -p test
sdetable -o alter_reg -t buildings -c fid -C user -u OGC980461FS -p test
sdelayer -o add -l buildings,position -E 0,0,100,50 -e p -u OGC980461FS -p test
sdetable -o create -t ponds -d "fid integer(10), name string(64), type string(64)" -u OGC980461FS -p test
sdetable -o alter_reg -t ponds -c fid -C user -u OGC980461FS -p test
sdelayer -o add -l ponds,shores -E 0,0,100,50 -e a+ -u OGC980461FS -p test
sdetable -o create -t named_places -d "fid integer(10), name string(64)" -u OGC980461FS -p test
sdetable -o alter_reg -t named_places -c fid -C user -u OGC980461FS -p test
sdelayer -o add -l named_places,boundary -E 0,0,100,50 -e a -u OGC980461FS -p test
sdetable -o create -t map_neatlines -d "fid integer(10)" -u OGC980461FS -p test
sdetable -o alter_reg -t map_neatlines -c fid -C user -u OGC980461FS -p test
sdelayer -o add -l map_neatlines,neatline -E 0,0,100,50 -e a -u OGC980461FS -p test