SpatialReferenceBuilder class final

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

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 SpatialReference.tolerance and SpatialReference.resolution, using the following workflow.

  1. Create the SpatialReferenceBuilder by WKID, WKT string, or from an existing SpatialReference.
  2. Change SpatialReferenceBuilder.tolerance and/or SpatialReferenceBuilder.resolution as required.
  3. Use SpatialReferenceBuilder.isValid after changing properties to check the new values are valid and consistent with each other - for example, SpatialReferenceBuilder.tolerance must be at least twice SpatialReferenceBuilder.resolution.
  4. Call SpatialReferenceBuilder.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 TableDescription.spatialReference with a custom SpatialReference.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 SpatialReference.tolerance, and passing the geometry to the relational or topological operation - see GeometryEngine for more information.

If you are working with z-values (Geometry.hasZ, FeatureTable.hasZ), you may wish to also consider setting SpatialReferenceBuilder.verticalTolerance and/or SpatialReferenceBuilder.verticalResolution values.

Implemented types

Constructors

SpatialReferenceBuilder.new({required int wkid, int verticalWkid = 0})
Creates a spatial reference builder based on the given horizontal and vertical coordinate systems.
factory
SpatialReferenceBuilder.fromSpatialReference(SpatialReference spatialReference)
Creates a spatial reference builder with the specified spatial reference (including any customizations) as the starting point for further modifications.
factory
SpatialReferenceBuilder.fromWkText(String wkText)
Creates a spatial reference builder based on well-known text.
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
isValid bool
True if a SpatialReference can be produced from the current builder properties, false otherwise.
no setter
resolution double
The minimum distance that separates unique x,y coordinate values when stored in an ArcGISFeatureTable.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
tolerance double
The minimum distance that determines if two x,y coordinates are considered to be at the same location for relational and topological GeometryEngine operations.
getter/setter pair
unit Unit
The unit of measure for the horizontal coordinate system of this spatial reference.
no setter
verticalResolution double
The minimum distance that separates unique z-values when stored in an ArcGISFeatureTable.
getter/setter pair
verticalTolerance double
The minimum distance that determines if two z-values are considered to be at the same location for GeometryEngine operations that compare z-values.
getter/setter pair
verticalUnit LinearUnit?
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.
no setter
verticalWkid int
The well-known ID for the vertical coordinate system (VCS), or 0 if this builder has no VCS or has a custom VCS.
no setter
wkid int
The well-known ID for the horizontal coordinate system, or 0 if this builder has a custom horizontal coordinate system.
no setter
wkText String
The well-known text definition of the horizontal and vertical coordinate systems of this builder.
no setter

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toSpatialReference() SpatialReference
Returns a new SpatialReference based on the current values of this builder.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited