SE_layer_calculate_extent |
Gets the extent of all features in the layer matching the specified WHERE clause
LONG SE_layer_calculate_extent (SE_CONNECTION connection, const CHAR *table, const CHAR *column, BOOL use_index, SE_ENVELOPE *e, LFLOAT *minz, LFLOAT *maxz, const SE_SQL_CONSTRUCT *construct);
connection | The connection handle |
table | The table name |
column | The column name |
use_index | Use the spatial index cells to compute an approximate extent if TRUE |
e | The address of the SE_ENVELOPE structure that will receive the feature's extent |
minz | The address of the minimum z-value of the feature's envelope |
maxz | The address of the maximum z-value of the feature's envelope |
construct | An optional SE_SQL_CONSTRUCT structure |
SE_layer_calculate_extent returns the extent (the minimum bounding box) of the features in a layer. If a WHERE clause is specified, only those shapes satisfying the query are used to calculate the extent. The SE_SQL_CONSTRUCT WHERE clause can include related tables.
typedef struct {
LONG num_tables; /* Number of tables */
CHAR **tables; /* Table names */
CHAR *where; /* WHERE clause */
} SE_SQL_CONSTRUCT
If use_index is TRUE, an approximate envelope for the layer is computed by scanning the spatial index cells instead of the actual feature extents. This is much faster but results in an envelope which is slightly larger than the actual minimum bounding rectangle for the collection of features.
The SE_SQL_CONSTRUCT may be used to calculate the extent constrained by a WHERE clause, with or without joining to related tables.
SE_SUCCESS
SE_DB_IO_ERROR
SE_ROW_NOEXIST
SE_INVALID_POINTER
SE_INVALID_SQL
SE_LAYER_NOEXIST
SE_NET_FAILURE
SE_SDE_NOT_STARTED
If the layer does not contain any records or if the WHERE clause does not return any records, an empty envelope is returned.