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


ISpatialReference.GetDomain Method (ArcObjects .NET 10.4 SDK)
ArcObjects Library Reference (Geometry)  

ISpatialReference.GetDomain Method

The XY domain extent.

[Visual Basic .NET]
Public Sub GetDomain ( _
    ByRef XMin As Double, _
    ByRef XMax As Double, _
    ByRef YMin As Double, _
    ByRef YMax As Double _
)
[C#]
public void GetDomain (
    ref double XMin,
    ref double XMax,
    ref double YMin,
    ref double YMax
);
[C++]
HRESULT GetDomain(
  double* XMin,
  double* XMax,
  double* YMin,
  double* YMax
);
[C++]

Parameters XMin [out] XMin is a parameter of type double XMax [out] XMax is a parameter of type double YMin [out] YMin is a parameter of type double YMax [out] YMax is a parameter of type double

Product Availability

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

Description

An alternative method to the GetFalseOriginAndUnits method. Returns the minimum and maximum allowed X and Y values for a spatial reference. Use GetFalseOriginAndUnits to obtain the allowed precision (1/resolution) value.

Remarks

The GetDomain and SetDomain methods are used to set and get the square domain extent of a coordinate system. The domain extent is different than the valid area of a coordinate system. The domain extent is an arbitrary square used to delimit valid coordinates for a spatial reference system and determine their resolution. It is possible that the domain extent is larger than the usable area of a coordinate system (a UTM zone, for example). A small domain extent gives you finer resolution coordinates over a smaller area. A larger domain extent lets you represent features over a larger geographic area but with coarser resolution.

[C#]

//This code example shows how to get the xy domain extent of a dataset.
private void GetSpatialReferenceProperties(IFeatureClass featureClass)
{
    IGeoDataset geoDataset=featureClass as IGeoDataset;
    //get access to SpatialReference through IGeoDataset
    ISpatialReference spatialReference=geoDataset.SpatialReference;
    //get the xy domain extent of the dataset
    double xMin;
    double xMax;
    double yMin;
    double yMax;
    spatialReference.GetDomain(out xMin, out xMax, out yMin, out yMax);
    System.Windows.Forms.MessageBox.Show(xMin + ", " + xMax + ", " + yMin + ", " + yMax);
}

[Visual Basic .NET]

    'This code example shows how to get the xy domain extent of a dataset.
    'This example assumes that a valid workspace object has already been established.
    Sub GetDomain_Example(ByVal pWorkspace As IWorkspace)
        Dim pFeatWS As IFeatureWorkspace
        pFeatWS=pWorkspace

        Dim pFeatDS As IFeatureDataset
        pFeatDS=pFeatWS.OpenFeatureDataset("railroad")
        Dim pGeoDataset As IGeoDataset
        pGeoDataset=pFeatDS

        'get access to SpatialReference through IGeoDataset
        Dim pSpatRef As ISpatialReference
        pSpatRef=pGeoDataset.SpatialReference

        Dim dXmax As Double
        Dim dYmax As Double
        Dim dXmin As Double
        Dim dYmin As Double
        'get the xy domain extent of the dataset
        pSpatRef.GetDomain(dXmin, dXmax, dYmin, dYmax)
        Debug.Print(dXmin & ", ", dXmax & ", " & dYmin, ", " & dYmax)
    End Sub

See Also

ISpatialReference Interface

.NET Snippets

Set Max Extent On Spatial Domain | Create Test Polyline from Geometry Environment

.NET Related Topics

Constructing a high- or low-precision spatial reference | Working with GeometryEnvironment