geospatial icon indicating copy to clipboard operation
geospatial copied to clipboard

Add equals2D, equals3D and equalsBy to feature and geometry classes

Open navispatial opened this issue 1 year ago • 0 comments

Position already has:

 /// True if this position equals with [other] by testing 2D coordinates only.
  ///
  /// If [toleranceHoriz] is given, then differences on 2D coordinate values
  /// (ie. x and y, or lon and lat) between this and [other] must be within
  /// tolerance. Otherwise value must be exactly same.
  ///
  /// Tolerance values must be null or positive (>= 0).
  bool equals2D(Position other, {num? toleranceHoriz});

  /// True if this position equals with [other] by testing 3D coordinates only.
  ///
  /// Returns false if this or [other] is not a 3D position.
  ///
  /// If [toleranceHoriz] is given, then differences on 2D coordinate values
  /// (ie. x and y, or lon and lat) between this and [other] must be within
  /// tolerance. Otherwise value must be exactly same.
  ///
  /// The tolerance for vertical coordinate values (ie. z or elev) is given by
  /// an optional [toleranceVert] value.
  ///
  /// Tolerance values must be null or positive (>= 0).
  bool equals3D(
    Position other, {
    num? toleranceHoriz,
    num? toleranceVert,
  });

Also Box has similar methods.

Add also to geometry and feature classes equals2D and equals3D that would check all coordinates / positions in geometries.

Consider also "equalsBy" on feature classes that might allow to select whether to test by id, geometry or properties, or all.

navispatial avatar Aug 08 '22 18:08 navispatial