Class SpatialReferenceBuilder
Allows you to create and modify spatial references with custom tolerance and resolution values.
Inheritance
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.
- Create the SpatialReferenceBuilder by WKID, WKT string, or from an existing SpatialReference.
- Change Tolerance and/or Resolution as required.
- 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.
- 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, |
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 |
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
Applies to
Target | Versions |
---|---|
.NET Standard 2.0 | 200.8 |
.NET | 200.8 |
.NET Windows | 200.8 |
.NET Android | 200.8 |
.NET iOS | 200.8 |
.NET Framework | 200.8 |
UWP | 200.8 |