Frequently asked question

How can information be obtained about the geometry of a feature in a layer in Oracle?

Last Published: April 25, 2020

Answer

To get information about the geometry of a feature that is stored using SDO_Geometry in a geodatabase in Oracle, use the sdelayer command with the feature_info operation.

The syntax for the command is as follows:

sdelayer -o feature_info -l <table,column> [-V <version>] [-r {valid | all | invalid}] 
[-w <"where_clause">] [-c] [Spatial_Index] [-S <layer_description_str>] [-q] [-i <service>]
[-s <server_name>] [-D <database>] [-u <DB_User_name> [-p <DB_User_password>] [-q]

To obtain the desired geometry information, use the -l option to specify the layer (and its spatial column). For an explanation of what the other options do, please consult the ArcSDE Administration Command Reference provided with the ArcSDE installation media. Links to this reference are also provided in the Related Information section below.

When executing the sdelayer command with the feature_info operation, up to 21 different characteristics of each feature in the layer are visible. These characteristics are presented in a series of comma-delimited fields. Fields are returned in the following order:

1. Row ID (Integer): The row ID of the table containing the spatial column. If the table does not have an ArcSDE or user-maintained row ID column, the Feature ID (FID) column value is returned instead. If it has neither a row ID or an FID, the value returned is 0.

2. FID (Integer): The Feature ID of the shape. If there is no FID, the row ID is returned instead. If there is neither row ID nor FID, 0 is returned.

3. Entity Type (one character): A single character indicating the entity type, either N (Nil), P (Point), S (Simple), L (Line), or A (Area).

4. Annotation (Boolean): Indicates whether or not the shape has ArcSDE annotation. Values are either T (true) or F (false).

5. CAD Data (Boolean): Indicates whether or not the shape contains ArcSDE CAD data. Returned values are either T (true) or F (false).

6. Number of Points (Integer): The total number of points in the shape.

7. Number of Parts (Integer): The number of parts in the shape. If an error is encountered when obtaining the parts, that error code from the sdeerno.h file is supplied instead.

8. Number of Subparts (Integer): The number of subparts in the shape. If this is a type of shape that does not have subparts, the value is 0. If an error is encountered when obtaining the subparts, the error code from the sdeerno.h file is supplied.

9. Self-Touching Rings (Boolean): Indicates the presence (T) or absence (F) of inclusions or conjoined inner rings in the shape. T is always returned for area shapes.

10. Minimum Precision (Integer): The minimum layer precision to contain this feature: either LOW (32-bit) or HIGH (64-bit).

11. Verification (Integer): Indicates whether or not ArcSDE considers a shape valid. A value for this field is only returned if the -r option is used to specify 'all' the features in the layer being evaluated for validity. Possible return values are 0 if the shape is verified as correct, or a negative error code from the sdeerno.h file if it is incorrect. This information is most helpful when determining which features in an Oracle Spatial database are not valid, so that this can be corrected.

12. Area (Floating Point): The area of the shape, or 0.0 if this shape is not a polygon. Units depend on the coordinate system of the layer.

13. Length (Floating Point): The length or perimeter of the shape, or 0.0 if this shape is a point or multipoint. Units depend on the coordinate system of the layer.

14. Minimum X (Floating Point): The minimum x-coordinate of this shape.

15. Maximum X (Floating Point): The maximum x-coordinate of this shape.

16. Minimum Y (Floating Point): The minimum y-coordinate of this shape.

17. Maximum Y (Floating Point): The maximum y-coordinate of this shape.

18. Minimum Z (Floating Point): The minimum z-coordinate of this shape. This field is only present if the layer has z-coordinates.

19. Maximum Z (Floating Point): The maximum z-coordinate of this shape. This field is only present if the layer has z-coordinates.

20. Minimum Measure (Floating Point): The minimum measure of this shape. This field is only present if the layer has measures.

21. Maximum Measure (Floating Point): The maximum measure of this shape. This field is only present if the layer has measures.

Note:
Values for numbers 12 through 21 are only returned if the –c option is specified.


The following is an example of the results returned for one feature in the DEFAULT version of a layer named jurisdictions owned by the user 'editor':

sdelayer -o feature_info -l jurisdictions,shape -w "jnumber=42" -r all -c -i 9022 -u editor -p changenit

Layer Administration Utility
-----------------------------------------------------------------------------
Row Id, FID, Entity Type, Annotation, CAD data, Number of Points, Number of Parts,
Number of Subparts, Self-Touching Rings, Minimum Precision, Verification

11,69,A,F,F,132,2,6,T,LOW,0,900000,3800,15012,16003,6698,7601

These results indicate that this feature:
▪ Has a Row ID of 11
▪ Has a Feature ID of 69
▪ Is an area entity (a polygon)
▪ Does not contain annotation
▪ Does not contain CAD data
▪ Contains 132 points
▪ Is made up of 2 parts and 6 subparts
▪ Contains self-touching rings
▪ Is stored in low precision (has a minimum precision of 32-bits)
▪ Is a valid shape
▪ Has an area of 900,000 square feet
▪ Has a perimeter of 3,800 feet
▪ Has a minimum x-coordinate of 15012
▪ Has a maximum x-coordinate of 16003
▪ Has a minimum y-coordinate of 6698
▪ Has a maximum y-coordinate of 7601
▪ Does not contain z-coordinates
▪ Does not contain measures

Article ID:000007567

Software:
  • Legacy Products

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options

Related Information

Discover more on this topic