ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Core.Geometry Namespace / SpatialReferenceBuilder Class / XYResolution Property
Example

In This Topic
    XYResolution Property (SpatialReferenceBuilder)
    In This Topic
    Gets or sets the XYResolution. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    Public Property XYResolution As Double
    public double XYResolution {get; set;}
    Exceptions
    ExceptionDescription
    This method or property must be called within the lambda passed to QueuedTask.Run.
    Remarks
    The XYResolution is in meters for PCS and degrees for GCS. When setting the XYResolution, if the input value is not valid (i.e. less than 0), the default value will be set.
    Example
    SpatialReference Properties
    {
      // SpatialReferenceBuilder constructors need to run on the MCT.
      ArcGIS.Desktop.Framework.Threading.Tasks.QueuedTask.Run(() =>
      {
        // use the builder constructor
        using (SpatialReferenceBuilder srBuilder = new SpatialReferenceBuilder(3857))
        {
          // spatial reference builder properties
          int builderWkid = srBuilder.Wkid;
          string builderWkt = srBuilder.Wkt;
          string builderName = srBuilder.Name;
    
          double xyScale = srBuilder.XYScale;
          double xyTolerance = srBuilder.XYTolerance;
          double xyResolution = srBuilder.XYResolution;
          Unit unit = srBuilder.Unit;
    
          double zScale = srBuilder.ZScale;
          double zTolerance = srBuilder.ZTolerance;
          Unit zUnit = srBuilder.ZUnit;
    
          double mScale = srBuilder.MScale;
          double mTolerance = srBuilder.MTolerance;
    
          double falseX = srBuilder.FalseX;
          double falseY = srBuilder.FalseY;
          double falseZ = srBuilder.FalseZ;
          double falseM = srBuilder.FalseM;
    
          // get the spatial reference
          SpatialReference sr3857 = srBuilder.ToSpatialReference();
    
          // spatial reference properties
          int srWkid = sr3857.Wkid;
          string srWkt = sr3857.Wkt;
          string srName = sr3857.Name;
    
          xyScale = sr3857.XYScale;
          xyTolerance = sr3857.XYTolerance;
          xyResolution = sr3857.XYResolution;
          unit = sr3857.Unit;
    
          zScale = sr3857.ZScale;
          zTolerance = sr3857.ZTolerance;
          zUnit = sr3857.ZUnit;
    
          mScale = sr3857.MScale;
          mTolerance = sr3857.MTolerance;
    
          falseX = sr3857.FalseX;
          falseY = sr3857.FalseY;
          falseZ = sr3857.FalseZ;
          falseM = sr3857.FalseM;
    
          bool hasVcs = sr3857.HasVcs;
        }
      });
    }
    Requirements

    Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.0 or higher.
    See Also