org.esa.beam.framework.datamodel.GeoCoding.canGetGeoPos()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(7.6k)|赞(0)|评价(0)|浏览(112)

本文整理了Java中org.esa.beam.framework.datamodel.GeoCoding.canGetGeoPos()方法的一些代码示例,展示了GeoCoding.canGetGeoPos()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。GeoCoding.canGetGeoPos()方法的具体详情如下:
包路径:org.esa.beam.framework.datamodel.GeoCoding
类名称:GeoCoding
方法名:canGetGeoPos

GeoCoding.canGetGeoPos介绍

[英]Checks whether or not this geo-coding can determine the geodetic position from a pixel position.
[中]检查此地理编码是否可以从像素位置确定大地坐标位置。

代码示例

代码示例来源:origin: bcdev/beam

/**
 * Checks whether or not this geo-coding can determine the geodetic position from a pixel position.
 *
 * @return <code>true</code>, if so
 */
@Override
public boolean canGetGeoPos() {
  return getGeoCoding().canGetGeoPos();
}

代码示例来源:origin: bcdev/beam

@Override
  @Deprecated
  public GeoPos updateGeoPos(GeoCoding geoCoding, PixelPos pixelPos, GeoPos geoPos) {
    if (geoCoding == null || !geoCoding.canGetGeoPos()) {
      return geoPos;
    }
    return geoCoding.getGeoPos(pixelPos, geoPos);
  }
}

代码示例来源:origin: bcdev/beam

@Override
  @Deprecated
  public GeoPos updateGeoPos(GeoCoding geoCoding, PixelPos pixelPos, GeoPos geoPos) {
    if (geoCoding == null || !geoCoding.canGetGeoPos()) {
      return geoPos;
    }
    return geoCoding.getGeoPos(pixelPos, geoPos);
  }
}

代码示例来源:origin: bcdev/beam

@Override
  public boolean accept(Product product) {
    final GeoCoding geoCoding = product.getGeoCoding();
    return geoCoding != null && geoCoding.canGetGeoPos() && geoCoding.canGetPixelPos();
  }
}

代码示例来源:origin: bcdev/beam

private boolean canUseGeoCoordinates(Product product) {
  final GeoCoding geoCoding = product.getGeoCoding();
  return geoCoding != null && geoCoding.canGetPixelPos() && geoCoding.canGetGeoPos();
}

代码示例来源:origin: bcdev/beam

@Override
  protected boolean acceptForBinning(Product product) {
    final GeoCoding geoCoding = product.getGeoCoding();
    if (geoCoding != null && geoCoding.canGetGeoPos()) {
      return true;
    }
    setReason("Rejected because it does not contain a proper geo coding.");
    return false;
  }
}

代码示例来源:origin: bcdev/beam

private static boolean intersectsWith(Product sourceProduct, Product targetProduct) {
    final GeoCoding srcGC = sourceProduct.getGeoCoding();
    final GeoCoding targetGC = targetProduct.getGeoCoding();
    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;
  }
}

代码示例来源:origin: bcdev/beam

@Test
public void testAcceptProduct_WithProperGeoCoding() throws Exception {
  when(product.getGeoCoding()).thenReturn(geoCoding);
  when(geoCoding.canGetGeoPos()).thenReturn(true);
  assertThat(filter.accept(product), is(true));
  assertThat(filter.getReason(), is(nullValue()));
}

代码示例来源:origin: bcdev/beam

@Test
public void testRejectProduct_WhenGeoCodingCanNotGetGeoPos() throws Exception {
  when(product.getGeoCoding()).thenReturn(geoCoding);
  when(geoCoding.canGetGeoPos()).thenReturn(false); // reject condition
  assertThat(filter.accept(product), is(false));
  assertThat(filter.getReason(), is("Rejected because it does not contain a proper geo coding."));
}

代码示例来源:origin: bcdev/beam

private boolean productsIntersect(Product timeSeriesSourceProduct, Product collocationProduct) {
    if (collocationProduct.getGeoCoding() == null) {
      return false;
    }
    final GeoCoding geoCoding = collocationProduct.getGeoCoding();
    if (geoCoding.canGetGeoPos() && geoCoding.canGetPixelPos()
      && ((geoCoding instanceof CrsGeoCoding)||(geoCoding instanceof MapGeoCoding))) {
      final GeneralPath[] sourcePaths = ProductUtils.createGeoBoundaryPaths(timeSeriesSourceProduct);
      final GeneralPath[] collocationPaths = ProductUtils.createGeoBoundaryPaths(collocationProduct);
      for (GeneralPath sourcePath : sourcePaths) {
        for (GeneralPath collocationPath : collocationPaths) {
          final Area sourceArea = new Area(sourcePath);
          final Area collocationArea = new Area(collocationPath);
          collocationArea.intersect(sourceArea);
          if (!collocationArea.isEmpty()) {
            return true;
          }
        }
      }
    }
    return false;
  }
}

代码示例来源:origin: bcdev/beam

@Override
public void updateState(CommandEvent event) {
  final Product product = VisatApp.getApp().getSelectedProduct();
  setEnabled(product != null && product.getGeoCoding() != null && product.getGeoCoding().canGetGeoPos() && product.getGeoCoding().canGetPixelPos());
}

代码示例来源:origin: bcdev/beam

Guardian.assertNotNull("shape", shape);
Guardian.assertNotNull("geoCoding", geoCoding);
if (!geoCoding.canGetGeoPos()) {
  throw new IllegalArgumentException("invalid 'geoCoding'"); /*I18N*/

代码示例来源:origin: bcdev/beam

@Override
  public boolean accept(Product collocationProduct) {
    final Product referenceProduct = getReferenceProduct();
    if (referenceProduct == collocationProduct ||
      collocationProduct.getGeoCoding() == null) {
      return false;
    }
    if (referenceProduct == null) {
      return true;
    }
    final GeoCoding geoCoding = collocationProduct.getGeoCoding();
    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;
  }
}

代码示例来源:origin: bcdev/beam

if (geoCoding != null && geoCoding.canGetGeoPos()) {
  geoPos = geoCoding.getGeoPos(imagePos, geoPos);

代码示例来源:origin: bcdev/beam

if (geoCoding.canGetGeoPos()) {
  final PixelPos pixelPos = new PixelPos(imagePosX, imagePosY);
  geoCoding.getGeoPos(pixelPos, geoPos);

代码示例来源:origin: bcdev/beam

if (formerGeocoding != null && formerGeocoding.canGetGeoPos()) {
  formerGeocoding.getGeoPos(pixelPos, geoPos);
} else {

代码示例来源:origin: bcdev/beam

final GeoCoding thisGeoCoding = thisRaster.getGeoCoding();
final GeoCoding thatGeoCoding = thatRaster.getGeoCoding();
if (thisGeoCoding != null && thatGeoCoding != null && thisGeoCoding.canGetGeoPos() && thatGeoCoding.canGetPixelPos()) {
  final Viewport thisViewport = layerCanvas.getViewport();
  final Viewport thatViewport = thatView.layerCanvas.getViewport();

代码示例来源:origin: bcdev/beam

private void assertEquality(final GeoCoding gc1, final GeoCoding gc2, float accuracy) {
  assertNotNull(gc2);
  assertEquals(gc1.canGetGeoPos(), gc2.canGetGeoPos());
  assertEquals(gc1.canGetPixelPos(), gc2.canGetPixelPos());
  assertEquals(gc1.isCrossingMeridianAt180(), gc2.isCrossingMeridianAt180());
  if (gc1 instanceof CrsGeoCoding) {
    assertEquals(CrsGeoCoding.class, gc2.getClass());
    CRS.equalsIgnoreMetadata(gc1, gc2);
  } else if (gc1 instanceof TiePointGeoCoding) {
    assertEquals(TiePointGeoCoding.class, gc2.getClass());
  }
  final int width = outProduct.getSceneRasterWidth();
  final int height = outProduct.getSceneRasterHeight();
  GeoPos geoPos1 = null;
  GeoPos geoPos2 = null;
  final String msgPattern = "%s at [%d,%d] is not equal:";
  for (int i = 0; i < width; i++) {
    for (int j = 0; j < height; j++) {
      final PixelPos pixelPos = new PixelPos(i, j);
      geoPos1 = gc1.getGeoPos(pixelPos, geoPos1);
      geoPos2 = gc2.getGeoPos(pixelPos, geoPos2);
      assertEquals(String.format(msgPattern, "Latitude", i, j), geoPos1.lat, geoPos2.lat, accuracy);
      assertEquals(String.format(msgPattern, "Longitude", i, j), geoPos1.lon, geoPos2.lon, accuracy);
    }
  }
}

代码示例来源:origin: bcdev/beam

Guardian.assertEquals("sourceGeoCoding.canGetPixelPos()", sourceGeoCoding.canGetPixelPos(), true);
Guardian.assertNotNull("destGeoCoding", destGeoCoding);
Guardian.assertEquals("destGeoCoding.canGetGeoPos()", destGeoCoding.canGetGeoPos(), true);
Guardian.assertNotNull("destArea", destArea);

代码示例来源:origin: bcdev/beam

final boolean hasGeoCoding = geoCoding != null;
canGetPixelPos = hasGeoCoding && geoCoding.canGetPixelPos();
canGetGeoPos = hasGeoCoding && geoCoding.canGetGeoPos();

相关文章