protected static final boolean isDistributedRenderQuery(final Query query) { return query.getHints().containsKey(DistributedRenderProcess.OPTIONS); }
/** * In case some scaling factor have been pre-applied, make sure to arrange the requested target * scaleFactors by taking into account the previous ones. * * <p>This is usually required when using overviews. Suppose you want to get a target * scaleFactor of 0.00001 and the worst overview provide you a scale factor of 0.0001, then the * current scaleFactor need to be adjusted by a remaining 0.1 factor. * * @param hints * @param scaleFactors * @return the arranged scaleFactor */ private static double[] arrangeScaleFactors(Hints hints, final double[] scaleFactors) { if (hints != null && hints.containsKey(GetCoverage.PRE_APPLIED_SCALE)) { Double[] preAppliedScale = (Double[]) hints.get(GetCoverage.PRE_APPLIED_SCALE); if (preAppliedScale != null) { scaleFactors[0] = scaleFactors[0] * preAppliedScale[0]; scaleFactors[1] = scaleFactors[1] * preAppliedScale[1]; } } return scaleFactors; } }
/** * 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; }
/** * 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 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; }
/** * 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; }
/** * 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; }
@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(ST_Force_2D("); encodeColumnName(prefix, gatt.getLocalName(), sql); sql.append(")),'base64')"); } else { sql.append("encode(ST_AsEWKB("); encodeColumnName(prefix, gatt.getLocalName(), sql); sql.append("),'base64')"); } } }
if (this.hints.containsKey(Hints.EXECUTOR_SERVICE)) { final Object executor = uHints.get(Hints.EXECUTOR_SERVICE); if (executor != null && executor instanceof ExecutorService){ if(this.hints.containsKey(Hints.MAX_ALLOWED_TILES)) this.maxAllowedTiles= ((Integer)this.hints.get(Hints.MAX_ALLOWED_TILES));
/** * Scan the provided hints (if any) and look for auxiliary entries to be set into the reader. * * @param hints */ private void setAuxiliaryEntries(Hints hints) { String prefix = ""; if (hints != null) { if (hints.containsKey(Utils.PARENT_DIR)) { prefix = (String) hints.get(Utils.PARENT_DIR) + File.separatorChar; } if (hints.containsKey(Utils.AUXILIARY_FILES_PATH)) { String filePath = (String) hints.get(Utils.AUXILIARY_FILES_PATH); filePath = makeAbsolute(prefix, filePath); reader.setAuxiliaryFilesPath(filePath); } if (hints.containsKey(Utils.AUXILIARY_DATASTORE_PATH)) { String filePath = (String) hints.get(Utils.AUXILIARY_DATASTORE_PATH); filePath = makeAbsolute(prefix, filePath); reader.setAuxiliaryDatastorePath(filePath); } if (hints.containsKey(Hints.REPOSITORY)) { reader.setRepository((Repository) hints.get(Hints.REPOSITORY)); } } }
private ReferencedEnvelope getEnvelope(final Query query) throws TransformException, FactoryException { if (query.getHints().containsKey(SubsampleProcess.OUTPUT_BBOX)) { return ((ReferencedEnvelope) query.getHints().get(SubsampleProcess.OUTPUT_BBOX)).transform( reader.getFeatureType().getCoordinateReferenceSystem(), true); } return null; }
if (hints != null && !hints.containsKey(JAI.KEY_BORDER_EXTENDER)) { final Object extender = hints.get(JAI.KEY_BORDER_EXTENDER); if (!(extender != null && extender instanceof BorderExtender)) {
if (this.hints.containsKey(Hints.GRID_COVERAGE_FACTORY)) { final Object factory = this.hints.get(Hints.GRID_COVERAGE_FACTORY); if (factory != null && factory instanceof GridCoverageFactory) {
if (this.query.getHints().containsKey(SubsampleProcess.SUBSAMPLE_ENABLED) && (Boolean) this.query.getHints().get(SubsampleProcess.SUBSAMPLE_ENABLED)) { spatialOnly = true;
contraints.limit, (DistributedRenderOptions) query.getHints().get(DistributedRenderProcess.OPTIONS)); } else if (query.getHints().containsKey(SubsampleProcess.OUTPUT_WIDTH) && query.getHints().containsKey(SubsampleProcess.OUTPUT_HEIGHT) && query.getHints().containsKey(SubsampleProcess.OUTPUT_BBOX)) { double pixelSize = 1; if (query.getHints().containsKey(SubsampleProcess.PIXEL_SIZE)) { pixelSize = (Double) query.getHints().get(SubsampleProcess.PIXEL_SIZE);
throw new DataSourceException("Unable to create reader for this mosaic since we could not parse the configuration."); if(this.hints.containsKey(Hints.MOSAIC_LOCATION_ATTRIBUTE)) this.locationAttributeName=((String)this.hints.get(Hints.MOSAIC_LOCATION_ATTRIBUTE));
if (query.getHints().containsKey(GeogigFeatureSource.WALK_INFO_KEY)) { WALK_INFO.set(builder.getBuiltWalkInfo());
if (request.getTileDimensions()!= null) { final Dimension tileDimension = request.getTileDimensions(); if (hints != null && hints.containsKey(JAI.KEY_IMAGE_LAYOUT)){ final Object layout = this.hints.get(JAI.KEY_IMAGE_LAYOUT); if (layout != null && layout instanceof ImageLayout){
final RenderingHints localHints = new RenderingHints(JAI.KEY_IMAGE_LAYOUT,layout); if (hints != null && !hints.isEmpty()){ if (hints.containsKey(JAI.KEY_TILE_CACHE)){ final Object tc = hints.get(JAI.KEY_TILE_CACHE); if (tc != null && tc instanceof TileCache) if (hints != null && hints.containsKey(JAI.KEY_BORDER_EXTENDER)){ final Object extender = hints.get(JAI.KEY_BORDER_EXTENDER); if (extender != null && extender instanceof BorderExtender) { localHints.add(ImageUtilities.BORDER_EXTENDER_HINTS); if (hints.containsKey(JAI.KEY_TILE_SCHEDULER)){ final Object ts = hints.get(JAI.KEY_TILE_SCHEDULER); if (ts != null && ts instanceof TileScheduler)
featureReader = FeatureReaderAdapter.of(diffType, diffFeatures); if (query.getHints().containsKey(GeogigFeatureSource.WALK_INFO_KEY)) { GeogigFeatureSource.WALK_INFO.set(diffWalkInfo);