if (defHints != null && defHints.containsKey(Hints.EXECUTOR_SERVICE)) { executor = (ThreadPoolExecutor) defHints.get(Hints.EXECUTOR_SERVICE);
canSupportHeterogeneousCoverages, delegate, referenceName, coverageView); if (this.hints != null && this.hints.containsKey(Hints.GRID_COVERAGE_FACTORY)) { final Object factory = this.hints.get(Hints.GRID_COVERAGE_FACTORY); if (factory != null && factory instanceof GridCoverageFactory) {
if (hints != null && hints.containsKey(JOINS)) { List<Join> joins = (List<Join>) hints.get(JOINS); SimpleFeatureTypeBuilder typeBuilder = new SimpleFeatureTypeBuilder();
private void updateLocalHints(Hints hints, RenderingHints localHints) { if (hints != null && hints.containsKey(JAI.KEY_TILE_CACHE)) { final Object cache = hints.get(JAI.KEY_TILE_CACHE); if (cache != null && cache instanceof TileCache) localHints.add(new RenderingHints(JAI.KEY_TILE_CACHE, (TileCache) cache)); } if (hints != null && hints.containsKey(JAI.KEY_TILE_SCHEDULER)) { final Object scheduler = hints.get(JAI.KEY_TILE_SCHEDULER); if (scheduler != null && scheduler instanceof TileScheduler) localHints.add( new RenderingHints(JAI.KEY_TILE_SCHEDULER, (TileScheduler) scheduler)); } }
public AggregateFactory getAggregateFactory() { if (aggregateFactory == null) { if (hints.containsKey(Hints.AGGREGATE_FACTORY)) { // check the hints for something explicit Object factory = hints.get(Hints.AGGREGATE_FACTORY); if (factory instanceof AggregateFactory) { aggregateFactory = (AggregateFactory) factory; return aggregateFactory; } } aggregateFactory = GeometryFactoryFinder.getAggregateFactory(hints); } return aggregateFactory; }
public GeometryFactory getGeometryFactory() { if (geometryFactory == null) { if (hints.containsKey(Hints.GEOMETRY_FACTORY)) { // check the hints for something explicit Object factory = hints.get(Hints.GEOMETRY_FACTORY); if (factory instanceof GeometryFactory) { geometryFactory = (GeometryFactory) factory; return geometryFactory; } } geometryFactory = GeometryFactoryFinder.getGeometryFactory(hints); } return geometryFactory; }
private void updateReaderWithAuxiliaryPath( Hints hints, ImageReader reader, Key key, String method) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException { String filePath = (String) hints.get(key); if (filePath != null && hints.containsKey(Utils.PARENT_DIR)) { String parentDir = (String) hints.get(Utils.PARENT_DIR); // check if the file is not already absolute (old configuration file) if (!new File(filePath).isAbsolute()) { filePath = parentDir + File.separatorChar + filePath; } } if (filePath != null) { MethodUtils.invokeMethod(reader, method, filePath); } }
/** * Checks if reduction required and makes sense * * @param hints hints passed in * @param gatt Geometry attribute descriptor * @param param {@link Hints#GEOMETRY_GENERALIZATION} or {@link Hints#GEOMETRY_SIMPLIFICATION} * @return true to indicate reducing the geometry, false otherwise */ protected boolean isGeometryReduceRequired( Hints hints, GeometryDescriptor gatt, Hints.Key param) { if (hints == null) return false; if (hints.containsKey(param) == false) return false; if (gatt.getType().getBinding() == Point.class) return false; return true; }
public ComplexFactory getComplexFactory() { if (complexFactory == null) { if (hints.containsKey(Hints.COMPLEX_FACTORY)) { // check the hints for something explicit Object factory = hints.get(Hints.COMPLEX_FACTORY); if (factory instanceof ComplexFactory) { complexFactory = (ComplexFactory) factory; return complexFactory; } } complexFactory = GeometryFactoryFinder.getComplexFactory(hints); } return complexFactory; }
public PositionFactory getPositionFactory() { if (positionFactory == null) { if (hints.containsKey(Hints.POSITION_FACTORY)) { // check the hints for something explicit Object factory = hints.get(Hints.POSITION_FACTORY); if (factory instanceof PositionFactory) { positionFactory = (PositionFactory) factory; return positionFactory; } } positionFactory = GeometryFactoryFinder.getPositionFactory(hints); } return positionFactory; }
public PrimitiveFactory getPrimitiveFactory() { if (primitiveFactory == null) { if (hints.containsKey(Hints.PRIMITIVE_FACTORY)) { // check the hints for something explicit Object factory = hints.get(Hints.PRIMITIVE_FACTORY); if (factory instanceof PrimitiveFactory) { primitiveFactory = (PrimitiveFactory) factory; return primitiveFactory; } } primitiveFactory = GeometryFactoryFinder.getPrimitiveFactory(hints); } return primitiveFactory; }
/** * This method is responsible for checking the overview policy as defined by the provided {@link * Hints}. * * @return the overview policy which can be one of {@link Hints#VALUE_OVERVIEW_POLICY_IGNORE}, * {@link Hints#VALUE_OVERVIEW_POLICY_NEAREST}, {@link Hints#VALUE_OVERVIEW_POLICY_SPEED}, * {@link Hints#VALUE_OVERVIEW_POLICY_QUALITY}. Default is {@link * Hints#VALUE_OVERVIEW_POLICY_NEAREST}. */ private OverviewPolicy extractOverviewPolicy() { if (this.hints != null) if (this.hints.containsKey(Hints.OVERVIEW_POLICY)) overviewPolicy = (OverviewPolicy) this.hints.get(Hints.OVERVIEW_POLICY); // use default if not provided. Default is nearest if (overviewPolicy == null) overviewPolicy = OverviewPolicy.getDefaultPolicy(); assert overviewPolicy != null; return overviewPolicy; }
/** * Returns {@code true} if the image colormodel must be expanded for the operation. * * @param image The image to reproject. * @param hints The {@link Hints} used during the reprojection. */ private static boolean isColorModelExpanded(final RenderedImage image, final Hints hints) { if (image.getColorModel() instanceof IndexColorModel) { if (hints != null && hints.containsKey(JAI.KEY_REPLACE_INDEX_COLOR_MODEL)) { Boolean replace = (Boolean) hints.get(JAI.KEY_REPLACE_INDEX_COLOR_MODEL); if (replace != null) { return replace; } } } return false; }
/** * This method is responsible for checking the decimation policy as defined by the provided * {@link Hints}. * * @return the decimation policy which can be one of {@link DecimationPolicy#ALLOW}, {@link * DecimationPolicy#DISALLOW}. Default is {@link DecimationPolicy#ALLOW}. */ private DecimationPolicy extractDecimationPolicy() { if (this.hints != null) if (this.hints.containsKey(Hints.DECIMATION_POLICY)) decimationPolicy = (DecimationPolicy) this.hints.get(Hints.DECIMATION_POLICY); // use default if not provided. Default is allow if (decimationPolicy == null) { decimationPolicy = DecimationPolicy.getDefaultPolicy(); } assert decimationPolicy != null; return decimationPolicy; }
/** * This method is responsible for checking the overview policy as defined by the provided {@link * Hints}. * * @return the overview policy which can be one of {@link OverviewPolicy#IGNORE}, {@link * OverviewPolicy#NEAREST}, {@link OverviewPolicy#SPEED}, {@link OverviewPolicy#QUALITY}. * Default is {@link OverviewPolicy#NEAREST}. */ private OverviewPolicy extractOverviewPolicy() { // check if a policy was provided using hints (check even the // deprecated one) if (this.hints != null) if (this.hints.containsKey(Hints.OVERVIEW_POLICY)) overviewPolicy = (OverviewPolicy) this.hints.get(Hints.OVERVIEW_POLICY); // use default if not provided. Default is nearest if (overviewPolicy == null) { overviewPolicy = OverviewPolicy.getDefaultPolicy(); } assert overviewPolicy != null; return overviewPolicy; }
/** * This method is responsible for checking the overview policy as defined by the provided {@link * Hints}. * * @return the overview policy which can be one of {@link Hints#VALUE_OVERVIEW_POLICY_IGNORE}, * {@link Hints#VALUE_OVERVIEW_POLICY_NEAREST}, {@link Hints#VALUE_OVERVIEW_POLICY_SPEED}, * {@link Hints#VALUE_OVERVIEW_POLICY_QUALITY}. Default is {@link * Hints#VALUE_OVERVIEW_POLICY_NEAREST}. */ private OverviewPolicy extractOverviewPolicy() { OverviewPolicy overviewPolicy = null; // check if a policy was provided using hints (check even the // deprecated one) if (this.hints != null) if (this.hints.containsKey(Hints.OVERVIEW_POLICY)) overviewPolicy = (OverviewPolicy) this.hints.get(Hints.OVERVIEW_POLICY); // use default if not provided. Default is nearest if (overviewPolicy == null) overviewPolicy = OverviewPolicy.getDefaultPolicy(); assert overviewPolicy != null; return overviewPolicy; }
private ImageMosaicReader getImageMosaicReader(Hints hints) { ImageMosaicReader imReader = null; if (hints != null && hints.containsKey(Utils.MOSAIC_READER)) { Object reader = hints.get(Utils.MOSAIC_READER); if (reader instanceof ImageMosaicReader) { if (getParentReader() == null) { setParentReader((ImageMosaicReader) reader); } imReader = (ImageMosaicReader) reader; } } return imReader; }
@Override public void encodeGeometryColumn( GeometryDescriptor gatt, String prefix, int srid, Hints hints, StringBuffer sql) { boolean geography = "geography".equals(gatt.getUserData().get(JDBCDataStore.JDBC_NATIVE_TYPENAME)); if (geography) { sql.append("encode(ST_AsBinary("); encodeColumnName(prefix, gatt.getLocalName(), sql); sql.append("),'base64')"); } else { boolean force2D = hints != null && hints.containsKey(Hints.FEATURE_2D) && Boolean.TRUE.equals(hints.get(Hints.FEATURE_2D)); if (force2D) { sql.append("encode(ST_AsBinary(" + getForce2DFunction() + "("); encodeColumnName(prefix, gatt.getLocalName(), sql); sql.append(")),'base64')"); } else { sql.append("encode(ST_AsEWKB("); encodeColumnName(prefix, gatt.getLocalName(), sql); sql.append("),'base64')"); } } }
/** * 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; }
private Hints updateRepositoryHints(CatalogBuilderConfiguration configuration, Hints hints) { ImageMosaicReader reader = getImageMosaicReader(hints); if (reader != null) { Hints readerHints = reader.getHints(); if (readerHints != null && readerHints.containsKey(Hints.REPOSITORY)) { hints.add(new Hints(Hints.REPOSITORY, readerHints.get(Hints.REPOSITORY))); } } return hints; }