@Override public boolean accept(Product product) { final GeoCoding geoCoding = product.getSceneGeoCoding(); return geoCoding != null && geoCoding.canGetGeoPos() && geoCoding.canGetPixelPos(); } }
private boolean canUseGeoCoordinates(Product product) { final GeoCoding geoCoding = product.getSceneGeoCoding(); return geoCoding != null && geoCoding.canGetPixelPos() && geoCoding.canGetGeoPos(); }
private static boolean intersectsWith(Product sourceProduct, Product targetProduct) { final GeoCoding srcGC = sourceProduct.getSceneGeoCoding(); final GeoCoding targetGC = targetProduct.getSceneGeoCoding(); if (srcGC != null && srcGC.canGetGeoPos() && targetGC != null && targetGC.canGetGeoPos()) { final GeneralPath[] sourcePath = ProductUtils.createGeoBoundaryPaths(sourceProduct); final GeneralPath[] targetPath = ProductUtils.createGeoBoundaryPaths(targetProduct); for (GeneralPath spath : sourcePath) { Rectangle bounds = spath.getBounds(); for (GeneralPath tPath : targetPath) { if (tPath.getBounds().intersects(bounds)) { return true; } } } } return false; } }
private void setEnableState() { ProductNode productNode = lookup.lookup(ProductNode.class); boolean state = false; if (productNode != null) { Product product = productNode.getProduct(); if (product != null && !product.isMultiSize()) { state = product.getSceneGeoCoding() != null && product.getSceneGeoCoding().canGetGeoPos() && product.getSceneGeoCoding().canGetPixelPos(); } } setEnabled(state); }
@Override public boolean accept(Product collocationProduct) { final Product referenceProduct = getReferenceProduct(); if (referenceProduct == collocationProduct || collocationProduct.getSceneGeoCoding() == null) { return false; } if (referenceProduct == null) { return true; } final GeoCoding geoCoding = collocationProduct.getSceneGeoCoding(); if (geoCoding.canGetGeoPos() && geoCoding.canGetPixelPos() && (geoCoding instanceof CrsGeoCoding)) { final GeneralPath[] sourcePath = ProductUtils.createGeoBoundaryPaths(referenceProduct); final GeneralPath[] collocationPath = ProductUtils.createGeoBoundaryPaths(collocationProduct); for (GeneralPath path : sourcePath) { Rectangle bounds = path.getBounds(); for (GeneralPath colPath : collocationPath) { if (colPath.getBounds().intersects(bounds)) { return true; } } } } return false; } }
if (geoCoding.canGetGeoPos()) { final PixelPos pixelPos = new PixelPos(imagePosX, imagePosY); geoCoding.getGeoPos(pixelPos, geoPos);
if (thisGeoCoding != null && thatGeoCoding != null && thisGeoCoding.canGetGeoPos() && thatGeoCoding.canGetPixelPos()) { final Viewport thisViewport = layerCanvas.getViewport(); final Viewport thatViewport = thatView.layerCanvas.getViewport();
if (sourceProducts[0].getSceneGeoCoding() != null && sourceProducts[0].getSceneGeoCoding().canGetGeoPos()) { masterProduct = sourceProducts[0]; slaveProduct = sourceProducts[1]; } else if (sourceProducts[1].getSceneGeoCoding() != null && sourceProducts[1].getSceneGeoCoding().canGetGeoPos()) { masterProduct = sourceProducts[1]; slaveProduct = sourceProducts[0];
final boolean hasGeoCoding = geoCoding != null; canGetPixelPos = hasGeoCoding && geoCoding.canGetPixelPos(); canGetGeoPos = hasGeoCoding && geoCoding.canGetGeoPos();