*/
protected CoordinateOperationAuthorityFactory getFallbackAuthorityFactory()
throws NoSuchAuthorityCodeException, FactoryException {
if(!fallbackAuthorityFactorySearched) { // Search once
CoordinateOperationAuthorityFactory candidate = null;
// These hints are to prevent infinite recursion when called
// from OrderedAxisAuthorityFactory. See "noForce(Hints)"
// from AuthorityBackedFactory.
// See also: http://jira.codehaus.org/browse/GEOT-1161
Hints h = new Hints();
h.put(Hints.FORCE_LONGITUDE_FIRST_AXIS_ORDER, Boolean.FALSE);
h.put(Hints.FORCE_STANDARD_AXIS_DIRECTIONS, Boolean.FALSE);
h.put(Hints.FORCE_STANDARD_AXIS_UNITS, Boolean.FALSE);
Set<CoordinateOperationAuthorityFactory> factories = ReferencingFactoryFinder.
getCoordinateOperationAuthorityFactories(h);
Iterator<CoordinateOperationAuthorityFactory> it = factories.iterator();
// Skip factories with higher priority than me.
while (it.hasNext()) {
candidate = it.next();
if (candidate == this) {
break;
}
}
// Get the next one for this same authority
while (it.hasNext()) {
candidate = it.next();
if (!(candidate instanceof CoordinateOperationFactoryUsingWKT)
&& candidate.getAuthority().getTitle().equals(this.getAuthority().getTitle())) {
fallbackAuthorityFactory = candidate;
break;
}
}
fallbackAuthorityFactorySearched = true;