@Override public PixelPos getPixelPos(final GeoPos geoPos, PixelPos pixelPos) { if (pixelPos == null) { pixelPos = new PixelPos(); } pixelPos.setInvalid(); if (geoPos.isValid()) { getPixelPosUsingQuadTreeSearch(geoPos, pixelPos); } return pixelPos; }
/** * Returns the pixel co-ordinates as x/y for a given geographical position given as lat/lon. * This algorithm * * @param geoPos the geographical position as lat/lon. * @param pixelPos the return value */ public void getPixelPosUsingQuadTreeSearch(final GeoPos geoPos, PixelPos pixelPos) { final Result result = new Result(); boolean pixelFound = quadTreeSearch(0, geoPos.lat, geoPos.lon, 0, 0, width, height, result); if (pixelFound) { pixelPos.setLocation(result.x + 0.5f, result.y + 0.5f); } else { pixelPos.setInvalid(); } }
/** * Returns the pixel co-ordinates as x/y for a given geographical position given as lat/lon. * * @param geoPos the geographical position as lat/lon in the coordinate system determined by {@link #getDatum()} * @param pixelPos an instance of <code>Point</code> to be used as return value. If this parameter is * <code>null</code>, the method creates a new instance which it then returns. * @return the pixel co-ordinates as x/y */ public PixelPos getPixelPos(GeoPos geoPos, PixelPos pixelPos) { if (pixelPos == null) { pixelPos = new PixelPos(); } pixelPos.setInvalid(); final int index = getGeoCodingIndexfor(geoPos); _lastCenterLineIndex = index; final GeoCoding gc = _gcList.get(index); if (gc != null) { gc.getPixelPos(geoPos, pixelPos); } if (pixelPos.isValid()) { pixelPos.y += (index * getScanlineHeight()) - getScanlineOffset(); if(pixelPos.y < 0 || pixelPos.y >= getSceneHeight()) pixelPos.setInvalid(); } return pixelPos; }
double lat = latImage.getData(new Rectangle(x, y, 1, 1)).getSampleDouble(x, y, 0); if (Math.abs(lat - geoPos.getLat()) > 0.05) { pixelPos.setInvalid(); pixelPos.setInvalid();
pixelPos.setLocation(pixelPos.x + 0.5f, pixelPos.y + 0.5f); } else { pixelPos.setInvalid();
/** * Returns the pixel co-ordinates as x/y for a given geographical position given as lat/lon. * This algorithm * * @param geoPos the geographical position as lat/lon. * @param pixelPos the return value */ public void getPixelPosUsingQuadTreeSearch(final GeoPos geoPos, PixelPos pixelPos) { initialize(); final Result result = new Result(); boolean pixelFound = quadTreeSearch(0, geoPos.lat, geoPos.lon, 0, 0, rasterWidth, rasterHeight, result); if (pixelFound) { pixelPos.setLocation(result.x + 0.5f, result.y + 0.5f); } else { pixelPos.setInvalid(); } }
pixelPos.setLocation(x0 + 0.5f, y0 + 0.5f); } else { pixelPos.setInvalid(); pixelPos.setInvalid();
@Override public PixelPos getPixelPos(final GeoPos geoPos, PixelPos pixelPos) { if (pixelPos == null) { pixelPos = new PixelPos(); } if (geoPos.isValid()) { // ensurePixelPosEstimatorExist(); // if (pixelPosEstimator.canGetPixelPos()) { pixelPosEstimator.getPixelPos(geoPos, pixelPos); if (pixelPos.isValid()) { pixelFinder.findPixelPos(geoPos, pixelPos); } // } else { // pixelPos.setInvalid(); // } } else { pixelPos.setInvalid(); } return pixelPos; }
final double y = p.getY(); if (!EXTRAPOLATE && (x < bounds.getMinX() || x > bounds.getMaxX() || y < bounds.getMinY() || y > bounds.getMaxY())) { p.setInvalid(); p.setInvalid(); p.setInvalid();
/** * Returns the pixel co-ordinates as x/y for a given geographical position given as lat/lon. * * @param geoPos the geographical position as lat/lon. * @param pixelPos an instance of <code>Point</code> to be used as return value. If this parameter is * <code>null</code>, the method creates a new instance which it then returns. * * @return the pixel co-ordinates as x/y */ @Override public PixelPos getPixelPos(final GeoPos geoPos, PixelPos pixelPos) { initialize(); if (pixelPos == null) { pixelPos = new PixelPos(); } if (geoPos.isValid()) { if (pixelPosEstimator != null) { getPixelPosUsingEstimator(geoPos, pixelPos); } else { getPixelPosUsingQuadTreeSearch(geoPos, pixelPos); } } else { pixelPos.setInvalid(); } return pixelPos; }
pixelPos.setLocation(result.getX() + 0.5f, result.getY() + 0.5f); } else { pixelPos.setInvalid();
imagePos.setInvalid();
@Override public PixelPos getPixelPos(GeoPos geoPos, PixelPos pixelPos) { if (pixelPos == null) { pixelPos = new PixelPos(); } try { DirectPosition directGeoPos = new DirectPosition2D(geoPos.getLon(), geoPos.getLat()); DirectPosition directPixelPos = geoToImage.transform(directGeoPos, null); pixelPos.setLocation((float) directPixelPos.getOrdinate(0), (float) directPixelPos.getOrdinate(1)); } catch (Exception ignored) { pixelPos.setInvalid(); } return pixelPos; }
/** * Returns the pixel co-ordinates as x/y for a given geographical position given as lat/lon. * * @param geoPos the geographical position as lat/lon. * @param pixelPos an instance of <code>Point</code> to be used as retun value. If this parameter is * <code>null</code>, the method creates a new instance which it then returns. * * @return the pixel co-ordinates as x/y */ @Override public PixelPos getPixelPos(final GeoPos geoPos, PixelPos pixelPos) { if (pixelPos == null) { pixelPos = new PixelPos(); } pixelPos.setInvalid(); final double x = _pixelXFunction.computeZ(geoPos.getLat(), geoPos.getLon()); final double y = _pixelYFunction.computeZ(geoPos.getLat(), geoPos.getLon()); pixelPos.setLocation((x - _pixelOffsetX) / _pixelSizeX, (y - _pixelOffsetY) / _pixelSizeY); return pixelPos; }
public void testInvalidState() { PixelPos pixelPos = new PixelPos(); assertTrue(pixelPos.isValid()); pixelPos.setInvalid(); assertFalse(pixelPos.isValid()); } }
pixelPos.y = (float) approximation.getFY().computeZ(lat, lon); } else { pixelPos.setInvalid(); pixelPos.setInvalid();