/** * Returns a factory from the specified hints. Used by {@link URN_AuthorityFactory} constructor * as well. */ static AllAuthoritiesFactory getFactory(Hints hints, final String authority) { if (!defaultAxisOrderHints(hints, authority)) { hints = new Hints(hints); hints.put(Hints.FORCE_LONGITUDE_FIRST_AXIS_ORDER, Boolean.FALSE); } return new AllAuthoritiesFactory(hints); }
/** * Invoked when a factory is requested for a specific version. This method should create a * factory for the exact version specified by the argument, or return {@code null} if no such * factory is available. In the later case, this class will fallback on the factory specified at * {@linkplain #URI_AuthorityFactory(AuthorityFactory, String, Citation) construction time}. * * @param version The version for the factory to create. * @return The factory, of {@code null} if there is none for the specified version. * @throws FactoryException if an error occurred while creating the factory. */ protected AuthorityFactory createVersionedFactory(final Version version) throws FactoryException { final Hints hints = new Hints(factory.getImplementationHints()); hints.put(Hints.VERSION, version); final List<AuthorityFactory> factories = Arrays.asList(new AuthorityFactory[] {new AllAuthoritiesFactory(hints), factory}); return FallbackAuthorityFactory.create(factories); }
/** * Creates a new instance of GeoTiffMetadata2CRSAdapter * * @param hints a map of hints to locate the authority and object factories. (can be null) */ public GeoTiffMetadata2CRSAdapter(Hints hints) { this.hints = hints != null ? hints.clone() : GeoTools.getDefaultHints().clone(); // various authority related factories allAuthoritiesFactory = new AllAuthoritiesFactory(this.hints); // various factories datumObjFactory = ReferencingFactoryFinder.getDatumFactory(this.hints); mtFactory = ReferencingFactoryFinder.getMathTransformFactory(this.hints); }
/** * Creates a new instance of GeoTiffMetadata2CRSAdapter * * @param hints * a map of hints to locate the authority and object factories. * (can be null) */ public GeoTiffMetadata2CRSAdapter(Hints hints) { final Hints tempHints = hints != null ? new Hints(hints) : DEFAULT_HINTS; this.hints = (Hints) tempHints.clone(); allAuthoritiesFactory = hints != null ? new AllAuthoritiesFactory(this.hints): DEFAULT_ALLAUTHORITIES_FACTORY; // factory = new ThreadedEpsgFactory(hints); datumObjFactory = ReferencingFactoryFinder.getDatumFactory(this.hints); crsFactory = ReferencingFactoryFinder.getCRSFactory(this.hints); csFactory = ReferencingFactoryFinder.getCSFactory(this.hints); tempHints.put(Hints.DATUM_AUTHORITY_FACTORY, allAuthoritiesFactory); tempHints.put(Hints.CS_FACTORY, csFactory); tempHints.put(Hints.CRS_FACTORY, crsFactory); tempHints.put(Hints.MATH_TRANSFORM_FACTORY, mtFactory); factories = ReferencingFactoryContainer.instance(tempHints); }