Show / Hide Table of Contents

Class SpatialReferenceBuilder

Allows you to create and modify spatial references with custom tolerance and resolution values.

Inheritance
System.Object
SpatialReferenceBuilder
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Esri.ArcGISRuntime.Geometry
Assembly: Esri.ArcGISRuntime.dll
Syntax
public sealed class SpatialReferenceBuilder
Remarks

Spatial references have default precision properties when created using SpatialReference constructors from well-known ID (WKID) numbers or a well-known text (WKT) string. Esri strongly recommends using the default precision values in most cases because they have proved to perform quite well for most situations. Learn more about the properties of a spatial reference.

Users with high-accuracy data capture and storage workflows may require non-default precision values. The SpatialReferenceBuilder allows you to create SpatialReference objects and customize the precision properties Tolerance and Resolution, using the following workflow.

  1. Create the SpatialReferenceBuilder by WKID, WKT string, or from an existing SpatialReference.
  2. Change Tolerance and/or Resolution as required.
  3. Use IsValid after changing properties to check the new values are valid and consistent with each other - for example, Tolerance must be at least twice Resolution.
  4. Call ToSpatialReference() to produce a SpatialReference.

You can now use the new custom precision SpatialReference as required. For example:

  • When creating a new geodatabase table, setting SpatialReference with a custom Resolution determines the precision with which the coordinate values are stored. Note that shapefiles and also non-Esri data sources do not support storing coordinate values with resolution, and therefore any resolution set will be ignored in such cases.
  • Perform relational or topological GeometryEngine operations with a custom tolerance, by creating a Geometry with your customized Tolerance, and passing the geometry to the relational or topological operation - see GeometryEngine for more information.

If you are working with z-values (HasZ, HasZ), you may wish to also consider setting VerticalTolerance and/or VerticalResolution values.

Constructors

Name Description
SpatialReferenceBuilder(SpatialReference)

Initializes a new instance of the SpatialReferenceBuilder class with the specified spatial reference (including any customizations) as the starting point for further modifications.

SpatialReferenceBuilder(Int32)

Initializes a new instance of the SpatialReferenceBuilder class based on the given horizontal coordinate system.

SpatialReferenceBuilder(Int32, Int32)

Initializes a new instance of the SpatialReferenceBuilder class based on the given horizontal and vertical coordinate systems.

SpatialReferenceBuilder(String)

Initializes a new instance of the SpatialReferenceBuilder class based on well-known text.

Properties

Name Description
IsValid

Gets a value indicating whether a SpatialReference can be produced from the current builder properties, false otherwise.

Resolution

Gets or sets the minimum distance that separates unique x,y coordinate values when stored in an ArcGISFeatureTable.

Tolerance

Gets or sets the minimum distance that determines if two x,y coordinates are considered to be at the same location for relational and topological GeometryEngine operations.

Unit

Gets the unit of measure for the horizontal coordinate system of this spatial reference.

VerticalResolution

Gets or sets the minimum distance that separates unique z-values when stored in an ArcGISFeatureTable.

VerticalTolerance

Gets or sets the minimum distance that determines if two z-values are considered to be at the same location for GeometryEngine operations that compare z-values.

VerticalUnit

Gets the unit of measure for the vertical coordinate system of this spatial reference, or null if no vertical coordinate system is set for this builder.

VerticalWkid

Gets the well-known ID for the vertical coordinate system (VCS), or 0 if this builder has no VCS or has a custom VCS.

Wkid

Gets the well-known ID for the horizontal coordinate system, or 0 if this builder has a custom horizontal coordinate system.

WkText

Gets the well-known text definition of the horizontal and vertical coordinate systems of this builder.

Methods

Name Description
ToSpatialReference()

Returns a new SpatialReference based on the current values of this builder.

See Also

Unit
GeometryEngine

Applies to

TargetVersions
.NET Standard 2.0200.8
.NET200.8
.NET Windows200.8
.NET Android200.8
.NET iOS200.8
.NET Framework200.8
UWP200.8
In This Article
Back to top Copyright © 2022 Esri.