/** * Returns true if the coverage has not been processed in any way since it has been read * * @param coverage */ private boolean isUnprocessed(GridCoverage2D coverage) { RenderedImage ri = coverage.getRenderedImage(); if (ri instanceof RenderedOp) { RenderedOp op = (RenderedOp) ri; return op.getOperationName().startsWith("ImageRead"); } else if (ri instanceof OpImage) { return ri.getClass().getSimpleName().startsWith("ImageRead"); } else { return true; } } }
String operationName = ((RenderedOp) localImage).getOperationName(); if ("BandMerge".equalsIgnoreCase(operationName)) { Vector<RenderedImage> sources = localImage.getSources();
String operationName = ((RenderedOp) data).getOperationName(); if (operationName.equalsIgnoreCase(AFFINE) || operationName.equalsIgnoreCase(SCALE)
String operationName = ((RenderedOp) data).getOperationName(); PropertyGenerator propertyGenerator = null; if (operationName.equalsIgnoreCase(SCALE)
if (image instanceof RenderedOp) { RenderedOp op = (RenderedOp) image; if ("Crop".equals(op.getOperationName()) || "GTCrop".equals(op.getOperationName())) { ParameterBlock paramBlock = op.getParameterBlock(); source = paramBlock.getRenderedSource(0);
private String getImageName(RenderedImage source) { if (source instanceof RenderedOp) { return "RenderedOp, <i>" + ((RenderedOp) source).getOperationName() + "</i>"; } else { return "Generic <i>" + source.getClass() + "</i>"; } }
private String getImageName(RenderedImage source) { if (source instanceof RenderedOp) { return "RenderedOp, <i>" + ((RenderedOp) source).getOperationName() + "</i>"; } else { return "Generic <i>" + source.getClass() + "</i>"; } }
String opName = op.getOperationName();
String operationName = op.getOperationName(); String renderingName = "null"; try
String operationName = op.getOperationName(); String renderingName = "null"; try
/** * Creates the view and logs a record. */ private static GridCoverage2D createView(final GridCoverage2D coverage, final RenderedOp view, final GridSampleDimension[] targetBands, final int code, final Hints userHints) { final InternationalString name = coverage.getName(); if (GridCoverage2D.LOGGER.isLoggable(CoverageProcessor.OPERATION)) { // Logs a message using the same level than grid coverage processor. final String operation = view.getOperationName(); final String shortName = operation.substring(operation.lastIndexOf('.') + 1); final Locale locale = coverage.getLocale(); final LogRecord record = Loggings.getResources(locale).getLogRecord( CoverageProcessor.OPERATION, LoggingKeys.SAMPLE_TRANSCODE_$3, new Object[] { (name != null) ? name.toString(locale) : Vocabulary.getResources(locale).getString(VocabularyKeys.UNTITLED), Integer.valueOf(code), shortName }); record.setSourceClassName(GridCoverage2D.class.getName()); record.setSourceMethodName("geophysics"); final Logger logger = GridCoverage2D.LOGGER; record.setLoggerName(logger.getName()); logger.log(record); } final GridCoverage[] sources = new GridCoverage[] {coverage}; return new GridCoverage2D(name, view, coverage.gridGeometry, targetBands, sources, null, userHints); }
if(image instanceof RenderedOp) { RenderedOp op = (RenderedOp) image; if("Crop".equals(op.getOperationName()) || "GTCrop".equals(op.getOperationName())) { ParameterBlock paramBlock = op.getParameterBlock(); source = paramBlock.getRenderedSource(0);
private RenderedImage getWarpOperation(RenderedOp roiOp) { String name = roiOp.getOperationName(); if("binarize".equals(name)) { return roiOp.getSourceImage(0); } else { return roiOp.getRendering(); } }
/* {7} */ targetImage.getOperationName(),
hb.dataLine("Name", image.getOperationName() + " (" + renderingName + ')');
hb.dataLine("Name", image.getOperationName() + " (" + renderingName + ')');
@Test public void testTinyRasterBboxContained() throws Exception { CoverageInfo coverageInfo = addRasterToMap(MockData.TASMANIA_DEM); Envelope env = coverageInfo.boundingBox(); Coordinate center = env.centre(); GridEnvelope range = coverageInfo.getGrid().getGridRange(); double offset = (env.getMaxX() - env.getMinX()) / range.getSpan(0) / 10.0; Rectangle imageBounds = produceMap( center.x + offset, center.x + 2 * offset, center.y + offset, center.y + 2 * offset); assertNotBlank("testTinyRasterBboxContained", this.image); assertEquals("Mosaic", this.op.getOperationName()); Rectangle roiBounds = getRoiBounds(); assertTrue( "Expected " + imageBounds + " to contain " + roiBounds, imageBounds.contains(roiBounds)); }
@Test public void testTinyRasterBboxIntersection() throws Exception { CoverageInfo coverageInfo = addRasterToMap(MockData.TASMANIA_DEM); Envelope env = coverageInfo.boundingBox(); GridEnvelope range = coverageInfo.getGrid().getGridRange(); double offset = (env.getMaxX() - env.getMinX()) / range.getSpan(0) / 20.0; Rectangle imageBounds = produceMap( env.getMinX() - offset, env.getMinX() + offset, env.getMaxY() - offset, env.getMaxY() + offset); assertNotBlank("testTinyRasterBboxIntersection", this.image); assertEquals("Mosaic", this.op.getOperationName()); Rectangle roiBounds = getRoiBounds(); assertTrue( "Expected " + imageBounds + " to contain " + roiBounds, imageBounds.contains(roiBounds)); }
@Test public void testTinyRasterBboxNoIntersection() throws Exception { CoverageInfo coverageInfo = addRasterToMap(MockData.TASMANIA_DEM); Envelope env = coverageInfo.boundingBox(); GridEnvelope range = coverageInfo.getGrid().getGridRange(); double offset = (env.getMaxX() - env.getMinX()) / range.getSpan(0) / 10.0; Rectangle imageBounds = produceMap( env.getMaxX() + offset, env.getMaxX() + 2 * offset, env.getMinY() - 2 * offset, env.getMinY() - offset); assertNotBlank("testTinyRasterBboxNoIntersection", this.image); assertEquals("Mosaic", this.op.getOperationName()); Rectangle roiBounds = getRoiBounds(); assertTrue( "Expected " + imageBounds + " to contain " + roiBounds, imageBounds.contains(roiBounds)); }
params.addSource(sourceImage); final RenderedOp op = JAI.create("scale", params); assertEquals("scale", op.getOperationName());