ArcObjects Library Reference (Geometry)  

IGeometryServer.FindSRByWKID Method

Defines an SR based upon its well known identifier (WKID) and optionally a WKID for a vertical datum. The resolution and xy tolerances are either computed from the sr horizon or set to defaults. 'authority' is typically either 'EPSG' or 'Esri'.

[Visual Basic .NET]
Public Function FindSRByWKID ( _
    ByVal authority As String, _
    ByVal WKID As Integer, _
    ByVal WKID_Z As Integer, _
    ByVal bDefaultXYResolution As Boolean, _
    ByVal bDefaultXYTolerance As Boolean _
) As ISpatialReference
[C#]
public ISpatialReference FindSRByWKID (
    string authority,
    int WKID,
    int WKID_Z,
    bool bDefaultXYResolution,
    bool bDefaultXYTolerance
);
[C++]
HRESULT FindSRByWKID(
  BSTR authority,
  long WKID,
  long WKID_Z,
  VARIANT_BOOL bDefaultXYResolution,
  VARIANT_BOOL bDefaultXYTolerance,
  ISpatialReference** ppSR
);
[C++]

Parameters

authority   authority is a parameter of type BSTR WKID   WKID is a parameter of type long WKID_Z   WKID_Z is a parameter of type long bDefaultXYResolution   bDefaultXYResolution is a parameter of type VARIANT_BOOL bDefaultXYTolerance   bDefaultXYTolerance is a parameter of type VARIANT_BOOL ppSR [out, retval]

  ppSR is a parameter of type ISpatialReference

Product Availability

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

Remarks

Returns a predefined, high precision spatial reference based on its OGP/EPSG Well Known Identifier (WKID, aka “factory code”).  Valid WKIDs are listed below. If WKID_Z > -1, then a vertical coordinate system will be created and associated with the horizontal coordinate system.


AuthorityName is usually  "EPSG" or "ESRI", but can also be an arbitrary string. It can also be the empty string if you want the default authority name associated with the new spatial reference. Clients can associate their own authority names with factory codes that are currently associated with the EPSG or ESRI authority names, because only the WKID is used to create the spatial reference. Here are the current rules for mapping WKID ranges to default authority names:

• A WKID in the EPSG code range (1000 – 32768) will result in an AUTHORITY name of “EPSG”, and the version will be the current EPSG version used (currently “6.12”).
• A WKID in the ESRI code range (33000 – 199999) will result in an AUTHORITY name of “ESRI”, and the version will be the current PE library version (currently “9.3”).
• A WKID in the user (objedit) range (200000 – 209199) will result in an AUTHORITY name of “CUSTOM”, with no version associated with it.  This name is specified by the OGC.

For web service clients of the geometry server, the returned WKT (well known text) element of the spatial reference will have an “AUTHORITY’ tag in it, containing the default or the client-specified authority name and the specified WKID.

If bDefaultXYResolution is true, then the xy coordinate grid resolution will be set to its default value (see SetDefaultXYResolution for details). If it is false, the finest possible resolution that covers the horizon of the spatial reference will be used (see ConstructFromHorizon for details).

If bDefaultXYTolerance is true, then the default xy tolerance of 1mm will be used (see SetDefaultXYTolerance for details). If it is false, then the minimum xy tolerance will be used (2.0 * xy coordinate grid resolution).

Lists of the valid WKIDs for predefined Projected Coordinate Systems can be found here:
esriSRProjCS2Type, esriSRProjCS3Type, esriSRProjCS4Type, esriSRProjCSType

Lists of the valid WKIDs for predefined Geographic Coordinate Systems can be found here:

esriSRGeoCS2Type, esriSRGeoCS3Type, esriSRGeoCSType

 

Default XY Resolution values
 

SpatialReference type

Precision

Default value

ProjectedCoordinateSystem

high

1/10 mm

ProjectedCoordinateSystem

low

1 mm

GeographicCoordinateSystem

high

1/10,000 arc-second

GeographicCoordinateSystem

low

1/500 arc-second

UnknownCoordinateSystem

high

1/10 mm

UnknownCoordinateSystem

low

1 mm

 

Defining an XY resolution

Defining an XY resolution for a spatial reference depends on the type and precision of a coordinate system.  For high precision spatial references, the domain extent and resolution must be sufficient to cover the horizon of a given coordinate system.  For low-precision spatial references the domain extent is centered on the horizon center.  

 

For a high precision ProjectedCoordinateSystem (PCS), the domain extent is a square completely covering, and slightly larger than, the horizon extent of the PCS (which is an arbitrary rectangle). The scale factor (1/precision) is chosen to fit this domain.  For a low precision PCS, the center of the domain extent is aligned with the center of the horizon extent and expanded to achieve a target resolution of 1mm.

 

For a high precision GeographicCoordinateSystem (GCS), the square domain (-400, -400, 400, 400), expressed in the units of the spatial reference, is used.  For a low precision GCS the upper right hand corner is adjusted to achieve a default resolution of 1/500 of an arc-second.

 

For an UnknownCoordinateSystem (UCS), the "horizon" is defined to be a square that produces a resolution of 1 millimeter for a low precision UCS or 1/10 mm for a high precision UCS.

 

Default XY Tolerance calculations

For a ProjectedCoordinateSystem or an UnknownCoordinateSystem, the default tolerance is 1 mm (expressed in the units of the spatial reference) or 2.0 * XYResolution, whichever is larger. For a GeographicCoordinateSystem, it is the angle subtending 1 mm at the equator, or 2.0 * XYResolution, whichever is larger. 
The minimum allowable XYTolerance is 2.0 * XYResolution.   If the default XY tolerance is not greater than or equal to 2.0 * XYResolution, the XYTolerance will be set at 2.0 * XYResolution.

See Also

IGeometryServer Interface