Details

  • Type: New Feature New Feature
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 3.06, 3.07, 3.08, 3.09, 3.10, 3.11, 3.12, 3.13, 3.14, 3.15, 3.16, 3.17
  • Fix Version/s: 3.18
  • Component/s: Referencing
  • Labels:
    None

Description

CRS.equalsIgnoreMetadata(IdentifiedObject, IdentifiedObject) returns true only if every numerical values declared in the projection parameters and ellipsoid are strictly identical for both Coordinate Reference System. We should allow a tolerance value, probably relative to the greatest numerical value found in both objects for a given parameter.

In order to implement that, we will need to add this tolerance argument to the AbstractIdentifiedObject.equals(IdentifiedObject, boolean) method. One tricky issue we will face is how to redefine the AbstractMathTransform.equivalent(MathTransform, boolean) method, keeping in mind that the later does not expect a tolerance as a double because of the non-linear nature of map projection parameters.

We should also take the tolerance threshold in account during IdentifiedObjectFinder operations, which will require minor adjustments in the SQL queries built by DirectEpsgFactory.getCodeCandidates(IdentifiedObject).

Issue Links

Activity

Hide
Martin Desruisseaux added a comment -

Closed by mistake.

Show
Martin Desruisseaux added a comment - Closed by mistake.
Hide
Martin Desruisseaux added a comment -

It may be worth to implement a bestFit(List<IdentifiedObject> candidates, IdentifiedObject target) method in IdentifiedObjectFinder, which compare the objects in the list with the target using different tolerance threshold until a single element is found. A bilinear search in the range [0 .. threshold used for the search in the database] should be okay.

In addition, since we are going to hack close to the equals method, in may be worth to implement the caching of hash code values.

Show
Martin Desruisseaux added a comment - It may be worth to implement a bestFit(List<IdentifiedObject> candidates, IdentifiedObject target) method in IdentifiedObjectFinder, which compare the objects in the list with the target using different tolerance threshold until a single element is found. A bilinear search in the range [0 .. threshold used for the search in the database] should be okay. In addition, since we are going to hack close to the equals method, in may be worth to implement the caching of hash code values.
Hide
Martin Desruisseaux added a comment -

The AbstractIdentifiedObject.equals(Object, boolean) and AbstractMathTransform.equivalent(AbstractMathTransform) methods have been retrofitted in a single method, namely equals(Object, ComparisonMode), defined in the LenientComparable interface. For now only one tolerance value is defined: ComparisonMode.APPROXIMATIVE. However more enum could be added in a future version.

This issue is resolved but not closed because we still need to adapt DirectEpsgFactory in order to search for approximative ellipsoid semi-major length as documented in the issue description.

Show
Martin Desruisseaux added a comment - The AbstractIdentifiedObject.equals(Object, boolean) and AbstractMathTransform.equivalent(AbstractMathTransform) methods have been retrofitted in a single method, namely equals(Object, ComparisonMode), defined in the LenientComparable interface. For now only one tolerance value is defined: ComparisonMode.APPROXIMATIVE. However more enum could be added in a future version. This issue is resolved but not closed because we still need to adapt DirectEpsgFactory in order to search for approximative ellipsoid semi-major length as documented in the issue description.
Hide
Martin Desruisseaux added a comment -

Tolerance threshold is now implemented in DirectEpsgFactory.Finder.

Show
Martin Desruisseaux added a comment - Tolerance threshold is now implemented in DirectEpsgFactory.Finder.

People

  • Assignee:
    Martin Desruisseaux
    Reporter:
    Martin Desruisseaux
Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved:

Time Tracking

Estimated:
1d
Original Estimate - 1 day
Remaining:
6h
Time Spent - 2 hours Remaining Estimate - 6 hours
Logged:
2h
Time Spent - 2 hours Remaining Estimate - 6 hours