This document is archived and information here might be outdated.  Recommended version.


IGeoDataset.SpatialReference Property (ArcObjects .NET 10.6 SDK)
ArcObjects Library Reference (GeoDatabase)  

IGeoDataset.SpatialReference Property

The spatial reference of the GeoDataset.

[Visual Basic .NET]
Public ReadOnly Property SpatialReference As ISpatialReference
[C#]
public ISpatialReference SpatialReference {get;}
[C++]
HRESULT get_SpatialReference(
  ISpatialReference** spref
);
[C++]

Parameters spref [out, retval]
spref is a parameter of type ISpatialReference**

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Remarks

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.

See Also

IGeoDataset Interface

.NET Snippets

Get Spatial Reference from Dataset | Create Grid From Feature Class

.NET Samples

Implementing a schematic layout algorithm and its layout property page (Code Files: TranslateTree)

.NET Related Topics

Checking for topology error features in a geodatabase topology | Converting between high- and low-precision spatial references | Executing spatial queries | Geodatabase | How to create a multimodal network dataset | How to create a network dataset | How to create a union of several polygons | Working with topology errors