Interface ISpatialReferenceFactory3

Namespace
ESRI.ArcGIS.Geometry
Assembly
ESRI.Server.Geometry.dll

Provides access to members that create vertical datums or coordinate systems.

[Guid("59025A77-2CF9-4EF6-992A-1EA18F0012F0")]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface ISpatialReferenceFactory3 : ISpatialReferenceFactory2, ISpatialReferenceFactory

Remarks

The ISpatialReferenceFactory3 interface has two methods that are useful when working with low and high precision spatial references. ConstructHighPrecisionSpatialReference creates a high precision spatial reference from a low precision spatial reference. Using this method will ensure that coordinate values will fit exactly into the new, denser grid mesh. Each intersection of the original grid is an intersection of the new grid. ConstructLowPrecisionSpatialReference will create a low precision spatial reference from an existing high precision one. You can require that the new resolution value be maintained, usually at the expense of the XY domain extent.

 

[C#]

When using this interface in a console application, you must mark the routine as single-threaded.  A class can be marked as single-threaded by adding the [STAThread] attribute immediately preceding your routine's declaration.

Example:

[STAThread]
    static void Main(string[] args)
    {
    }


[Visual Basic .NET]

When using this interface in a console application, you must mark the routine as single-threaded.  A class can be marked as single-threaded by adding the [STAThread] attribute immediately preceding your routine's declaration.

 

  <STAThread()> _
   Shared Sub Main(ByVal args As String()) 

   End Sub



Properties

GeoTransformationDefaults

IGeoTransformationOperationSet GeoTransformationDefaults { get; }

Property Value

IGeoTransformationOperationSet

Methods

ConstructHighPrecisionSpatialReference(ISpatialReference, int, int, int)

Constructs a high precision spatial reference based on an existing spatial reference. xy/z/mDoubler is the number of times the respective precision is to be doubled. A value of zero will find the maximum doubling for that precision.

ISpatialReference ConstructHighPrecisionSpatialReference(ISpatialReference inSR, int xyDoubler, int zDoubler, int mDoubler)

Parameters

inSR ISpatialReference
xyDoubler int
zDoubler int
mDoubler int

Returns

ISpatialReference

Remarks

ConstructHighPrecisionSpatialReference creates a high precision copy of an existing low precision spatial reference. It is used when the new high precision spatial reference grid must “mesh” with the existing low precision grid. Each point of the old grid is also a point of the new grid.

The doubler parameters are exponents of powers of 2. For example, if the xyDoubler = 2, then the XY grid resolution of the output spatial reference is 4 times the input grid resolution (16 new grid cells cover 1 old grid cell). The grid also is translated so it remains centered about its current location. If a doubler parameter is -1, then the closest legal resolution to the default that covers the input XY domain and the coordinate system's horizon is chosen. If the doubler parameter is -2, the smallest possible legal resolution that covers the input XY domain and the coordinate system's horizon is chosen. In these cases, the highest exponent is chosen that will produce an output grid that both contains all the grid points defined by the input grid and covers the horizon of the input spatial reference. A doubler value of zero will maintain the existing resolution of the low precision spatial reference. It is an error to specify a doubler parameter that will result in a grid smaller than the corresponding input grid.

For ProjectedCoordinateSystems or GeographicCoordinateSystems the minimum values of the domain extent are defined just outside the envelope defined by the coordinate system's horizon.

 

[C#]

    private void ConstructHighPrecisionSpatialReference()
    {
        // use activator class with SpatialReferenceEnvironment singleton
        Type factoryType = Type.GetTypeFromProgID("esriGeometry.SpatialReferenceEnvironment");
        System.Object obj = Activator.CreateInstance(factoryType);
        ISpatialReferenceFactory3 spatialReferenceFactory = obj as ISpatialReferenceFactory3;




        ISpatialReference lowSpatialReference = spatialReferenceFactory.CreateSpatialReference(4326);

        IControlPrecision2 controlPrecision = lowSpatialReference as IControlPrecision2;
        //creates a low-precision SR
        controlPrecision.IsHighPrecision = false;

        ISpatialReferenceResolution spatialReferenceResolution = lowSpatialReference as ISpatialReferenceResolution;

        lowSpatialReference.SetFalseOriginAndUnits(-85, 120, 100000);
        //XYDoubler = -1 will result in highest legal resolution
        //M and Z doubler = 0 will result in output high precision SR matching resolution of input SR
        ISpatialReference highSpatialReference = spatialReferenceFactory.ConstructHighPrecisionSpatialReference(lowSpatialReference, -1, 0, 0);
    }



ConstructLowPrecisionSpatialReference(bool, ISpatialReference, IEnvelope)

Construct a low precision spatial reference with the same scale factor as the high precision input, but with a different domain extent. If the calculated domain extent cannot cover the specified data extent, an error is returned.

ISpatialReference ConstructLowPrecisionSpatialReference(bool bMatchPrecision, ISpatialReference inSR, IEnvelope dataExtent)

Parameters

bMatchPrecision bool
inSR ISpatialReference
dataExtent IEnvelope

Returns

ISpatialReference

Remarks

ConstructLowPrecisionSpatialReference creates a low precision copy of an existing high precision spatial reference.

  •  bMatchPrecision indicates whether the output low precision spatial reference should have the same resolution as the input high precision spatial reference. If not, then pExtent is used to help determine the output resolution.
  • pInSR is the existing high precision spatial reference. Passing in a low precision spatial reference will return an error.
  • pExtent is used to determine the output resolution when matching the input resolultion is not desired. ConstructLowPrecisionSpatialReference delegates to the existing method IGeometryEnvironment::ConstructDomainExtent in that case, which attempts to enlarge the extent by a factor of 1.5 (clipped against the horizon extent). If an empty envelope is passed in and bMatchPrecision is FALSE, then the low precision version of ISpatialReferenceResolution::ConstructFromHorizon is used for GeographicCoordinateSystems or ProjectedCoordinateSystems. If bMatchPrecision is true, then an attempt is made to use the domain extent as the new domain extent; the precision is not matched in this case.

CreateDatum(int)

IDatum CreateDatum(int datumType)

Parameters

datumType int

Returns

IDatum

CreateESRISpatialReference(string, out ISpatialReference, out int)

void CreateESRISpatialReference(string spatRefInfo, out ISpatialReference SpatialReference, out int cBytesRead)

Parameters

spatRefInfo string
SpatialReference ISpatialReference
cBytesRead int

CreateESRISpatialReferenceFromPRJ(string)

ISpatialReference CreateESRISpatialReferenceFromPRJ(string prj)

Parameters

prj string

Returns

ISpatialReference

CreateESRISpatialReferenceFromPRJFile(string)

ISpatialReference CreateESRISpatialReferenceFromPRJFile(string prjFile)

Parameters

prjFile string

Returns

ISpatialReference

CreateESRISpatialReferenceInfo(string, out ISpatialReferenceInfo, out int)

Creates a spatial reference system and defines it from the specified ESRISpatialReference buffer.

void CreateESRISpatialReferenceInfo(string spatRefInfo, out ISpatialReferenceInfo SpatialReference, out int cBytesRead)

Parameters

spatRefInfo string
SpatialReference ISpatialReferenceInfo
cBytesRead int

CreateESRISpatialReferenceInfoFromPRJ(string)

Creates a spatial reference from a PRJ string.

ISpatialReferenceInfo CreateESRISpatialReferenceInfoFromPRJ(string prj)

Parameters

prj string

Returns

ISpatialReferenceInfo

CreateESRISpatialReferenceInfoFromPRJFile(string)

Creates a spatial reference from a PRJ file.

ISpatialReferenceInfo CreateESRISpatialReferenceInfoFromPRJFile(string prjFile)

Parameters

prjFile string

Returns

ISpatialReferenceInfo

CreateGeoTransformation(int)

ITransformation CreateGeoTransformation(int gTransformationType)

Parameters

gTransformationType int

Returns

ITransformation

CreateGeographicCoordinateSystem(int)

IGeographicCoordinateSystem CreateGeographicCoordinateSystem(int gcsType)

Parameters

gcsType int

Returns

IGeographicCoordinateSystem

CreateParameter(int)

IParameter CreateParameter(int parameterType)

Parameters

parameterType int

Returns

IParameter

CreatePredefinedAngularUnits()

ISet CreatePredefinedAngularUnits()

Returns

ISet

CreatePredefinedDatums()

ISet CreatePredefinedDatums()

Returns

ISet

CreatePredefinedGeographicTransformations()

ISet CreatePredefinedGeographicTransformations()

Returns

ISet

CreatePredefinedLinearUnits()

ISet CreatePredefinedLinearUnits()

Returns

ISet

CreatePredefinedPrimeMeridians()

ISet CreatePredefinedPrimeMeridians()

Returns

ISet

CreatePredefinedProjections()

ISet CreatePredefinedProjections()

Returns

ISet

CreatePredefinedSpheroids()

ISet CreatePredefinedSpheroids()

Returns

ISet

CreatePredefinedVerticalCoordinateSystems()

Creates a list of predefined vertical coordinate systems.

ISet CreatePredefinedVerticalCoordinateSystems()

Returns

ISet

CreatePredefinedVerticalDatums()

Creates a list of predefined vertical datums.

ISet CreatePredefinedVerticalDatums()

Returns

ISet

CreatePrimeMeridian(int)

IPrimeMeridian CreatePrimeMeridian(int primeMeridianType)

Parameters

primeMeridianType int

Returns

IPrimeMeridian

CreateProjectedCoordinateSystem(int)

IProjectedCoordinateSystem CreateProjectedCoordinateSystem(int pcsType)

Parameters

pcsType int

Returns

IProjectedCoordinateSystem

CreateProjection(int)

IProjection CreateProjection(int projectionType)

Parameters

projectionType int

Returns

IProjection

CreateSpatialReference(int)

ISpatialReference CreateSpatialReference(int srID)

Parameters

srID int

Returns

ISpatialReference

CreateSpheroid(int)

ISpheroid CreateSpheroid(int spheroidType)

Parameters

spheroidType int

Returns

ISpheroid

CreateUnit(int)

IUnit CreateUnit(int unitType)

Parameters

unitType int

Returns

IUnit

CreateVerticalCoordinateSystem(int)

Creates a predefined vertical coordinate system from an enumeration or ID code.

IVerticalCoordinateSystem CreateVerticalCoordinateSystem(int vcsID)

Parameters

vcsID int

Returns

IVerticalCoordinateSystem

CreateVerticalCoordinateSystemFromESRISpatialReference(string)

Creates a vertical coordinate system from its string format.

IVerticalCoordinateSystem CreateVerticalCoordinateSystemFromESRISpatialReference(string srInfo)

Parameters

srInfo string

Returns

IVerticalCoordinateSystem

CreateVerticalDatum(int)

Creates a predefined vertical datum from an enumeration or ID code.

IVerticalDatum CreateVerticalDatum(int vdID)

Parameters

vdID int

Returns

IVerticalDatum

ExportESRISpatialReferenceInfoToPRJFile(string, ISpatialReferenceInfo)

Exports a spatial reference to a PRJ file.

void ExportESRISpatialReferenceInfoToPRJFile(string prjFile, ISpatialReferenceInfo SpatialReference)

Parameters

prjFile string
SpatialReference ISpatialReferenceInfo

ExportESRISpatialReferenceToPRJFile(string, ISpatialReference)

void ExportESRISpatialReferenceToPRJFile(string prjFile, ISpatialReference SpatialReference)

Parameters

prjFile string
SpatialReference ISpatialReference

GetPredefinedGeographicTransformations()

ISet GetPredefinedGeographicTransformations()

Returns

ISet