/** * Reports the GeoTools {@linkplain #getVersion version} number to the {@linkplain System#out * standard output stream}. * * @param args Command line arguments. */ public static void main(String[] args) { final Arguments arguments = new Arguments(args); args = arguments.getRemainingArguments(0); arguments.out.print("GeoTools version "); arguments.out.println(getVersion()); final Hints hints = getDefaultHints(); if (hints != null && !hints.isEmpty()) { arguments.out.println(hints); } } }
/** * Merges the wrapper hints with the query ones, making sure not to overwrite the query ones * * @param q * @return */ protected Query mergeHints(Query q) { if (this.hints == null || this.hints.isEmpty()) { return q; } Query clone = new Query(q); Hints hints = clone.getHints(); if (hints == null || hints.isEmpty()) { clone.setHints(this.hints); } else { for (Entry<Object, Object> entry : this.hints.entrySet()) { if (!hints.containsKey(entry.getKey())) { hints.put(entry.getKey(), entry.getValue()); } } } return clone; }
/** * Creates a new factory backed by an authority factory fetched using the specified hints. This * constructor recognizes the {@link Hints#CRS_FACTORY CRS}, {@link Hints#CS_FACTORY CS}, {@link * Hints#DATUM_FACTORY DATUM} and {@link Hints#MATH_TRANSFORM_FACTORY MATH_TRANSFORM} {@code * FACTORY} hints. * * @param userHints The hints, or {@code null} if none. */ public AuthorityBackedFactory(Hints userHints) { super(userHints, PRIORITY); /* * Removes the hint processed by the super-class. This include hints like * LENIENT_DATUM_SHIFT, which usually don't apply to authority factories. * An other way to see this is to said that this class "consumed" the hints. * By removing them, we increase the chances to get an empty map of remaining hints, * which in turn help to get the default CoordinateOperationAuthorityFactory * (instead of forcing a new instance). */ userHints = new Hints(userHints); userHints.keySet().removeAll(hints.keySet()); userHints.remove(Hints.FORCE_LONGITUDE_FIRST_AXIS_ORDER); userHints.remove(Hints.FORCE_STANDARD_AXIS_DIRECTIONS); userHints.remove(Hints.FORCE_STANDARD_AXIS_UNITS); if (!userHints.isEmpty()) { noForce(userHints); authorityFactory = ReferencingFactoryFinder.getCoordinateOperationAuthorityFactory( DEFAULT_AUTHORITY, userHints); } }
if (!reduced.isEmpty()) { setHintsInto(reduced); addImplementationHints(reduced);
/** * Returns a default processor instance. * * <p><strong>Note:</strong> this is a temporary method, until we have GeoAPI interface for * coverage processor and a factory finder for their implementations. */ public static synchronized CoverageProcessor getInstance(final Hints hints) { if (hints == null || hints.isEmpty()) { if (DEFAULT == null) { DEFAULT = new CacheableCoverageProcessor(); processorsPool.put(new Hints(), DEFAULT); } return DEFAULT; } if (processorsPool.containsKey(hints)) return processorsPool.get(hints); final CoverageProcessor processor = new CacheableCoverageProcessor(hints); processorsPool.put(hints, processor); return processor; }
if (hints != null && !hints.isEmpty()) {