@Override
 public boolean getGeoLocation(double x, double y, Point2D g) {
   if (geoCoding.canGetGeoPos()) {
     pp.setLocation(x, y);
     geoCoding.getGeoPos(pp, gp);
     if (gp.isValid()) {
       g.setLocation(gp.getLon(), gp.getLat());
       return true;
     }
   }
   return false;
 }
Пример #2
0
    private void syncLatLonWithXYParams() {
      final PixelPos pixelPos1 =
          new PixelPos(
              ((Number) paramX1.getValue()).intValue(), ((Number) paramY1.getValue()).intValue());
      final PixelPos pixelPos2 =
          new PixelPos(
              ((Number) paramX2.getValue()).intValue(), ((Number) paramY2.getValue()).intValue());

      final GeoCoding geoCoding = product.getGeoCoding();
      final GeoPos geoPos1 = geoCoding.getGeoPos(pixelPos1, null);
      final GeoPos geoPos2 = geoCoding.getGeoPos(pixelPos2, null);
      paramNorthLat1.setValue(geoPos1.getLat(), null);
      paramWestLon1.setValue(geoPos1.getLon(), null);
      paramSouthLat2.setValue(geoPos2.getLat(), null);
      paramEastLon2.setValue(geoPos2.getLon(), null);
    }