public interface IGeoDataset
extends java.io.Serializable
This interface provides access to information about spatial datasets, in particular their spatial reference and geographic extent. All layers also implement this interface.
IEnvelope
Modifier and Type | Method and Description |
---|---|
IEnvelope |
getExtent()
The extent of the GeoDataset.
|
ISpatialReference |
getSpatialReference()
The spatial reference of the GeoDataset.
|
ISpatialReference getSpatialReference() throws java.io.IOException, AutomationException
This property is read only. For layers, when the first layer is added to ArcMap, its spatial reference is read by this property, and the map is set to this spatial reference.
Instances of the esriCarto.GroupLayer class will return null for this property, as a group layer can contain multiple datasets with different spatial references.
Modifications to a spatial reference returned by this property will not be persisted. To modify the spatial reference of a dataset, the IGeoDatasetSchemaEdit and IGeoDatasetSchemaEdit2 interfaces should be used.
java.io.IOException
- If there are interop problems.AutomationException
- If the ArcObject component throws an exception.IEnvelope getExtent() throws java.io.IOException, AutomationException
The IGeoDataset::Extent property returns an envelope representing the maximum extent of data which has been stored in the dataset.
Consider the following scenario. A new feature class has features added to it. The IGeoDataset::Extent is then requested and an envelope is returned. The extents of the envelope returned are represented by the red box in the image below.
If a portion of the features were then deleted and the extent is again requested an envelope with the exact same extents as during the first request would be returned (see image below). This is because the deletion of features does not shrink the extent. However all additions of features outside the red box would increase the envelope returned to encompass the newly added features.
If you would like to update the IGeoDataset::Extent property to reflect the current features in your dataset please see IFeatureClassManage::UpdateExtent (also see IFeatureClassLoad). In the image below the extent has been updated and a new envelope is being returned.
ESRI's GroupLayer implements this property differently from most other layer coclasses. When you instantiate a new GroupLayer, this property will return a valid envelope with zero height and width. With most other newly instantiated layers (for example FeatureLayer, RasterLayer, TinLayer), this property initally returns Nothing.
java.io.IOException
- If there are interop problems.AutomationException
- If the ArcObject component throws an exception.