org.esa.snap.core.datamodel.GeoCoding.getMapCRS()方法的使用及代码示例

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

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

GeoCoding.getMapCRS介绍

暂无

代码示例

代码示例来源:origin: senbox-org/snap-desktop

private CoordinateReferenceSystem getMapCrs() {
  return product.getSceneGeoCoding().getMapCRS();
}

代码示例来源:origin: senbox-org/snap-desktop

@Override
public CoordinateReferenceSystem getCRS(GeoPos referencePos) {
  Product collocationProduct = collocateProductSelector.getSelectedProduct();
  if (collocationProduct != null) {
    return collocationProduct.getSceneGeoCoding().getMapCRS();
  }
  return null;
}

代码示例来源:origin: senbox-org/snap-desktop

void setUpdateProduct(Product product) {
  setPropertyValue(PROPERTY_UPDATE_PRODUCT, product);
  if (product != null && product.getSceneGeoCoding() != null && product.getSceneGeoCoding().getMapCRS() != null) {
    setTargetCRS(product.getSceneGeoCoding().getMapCRS().toWKT());
  }
}

代码示例来源:origin: senbox-org/s2tbx

private void processLandWaterMask() {
  boolean isHigherResolutionInput = sourceProduct.getBand("B2") != null
      && sourceProduct.getBand("B2").getGeoCoding().getMapCRS().getName().toString().contains("UTM")
      && sourceProduct.getBand("B2").getImageToModelTransform().getScaleX() < LAND_WATER_MASK_RESOLUTION;
  HashMap<String, Object> waterMaskParameters = new HashMap<>();
  waterMaskParameters.put("resolution", LAND_WATER_MASK_RESOLUTION);
  if (isHigherResolutionInput) {
    System.out.println("No subsampling of " + sourceProduct.getBand("B2").getImageToModelTransform().getScaleX() + " m product necessary to access " + LAND_WATER_MASK_RESOLUTION + " m water mask");
    waterMaskParameters.put("subSamplingFactorX", 1);
    waterMaskParameters.put("subSamplingFactorY", 1);
  } else {
    waterMaskParameters.put("subSamplingFactorX", OVERSAMPLING_FACTOR_X);
    waterMaskParameters.put("subSamplingFactorY", OVERSAMPLING_FACTOR_Y);
  }
  waterMaskProduct = GPF.createProduct("LandWaterMask", waterMaskParameters, sourceProduct);
}

代码示例来源:origin: senbox-org/s2tbx

return collocationProduct.getSceneGeoCoding().getMapCRS();

代码示例来源:origin: senbox-org/snap-desktop

private boolean isGeographicLatLon(GeoCoding geoCoding) {
  if (geoCoding instanceof MapGeoCoding) {
    MapGeoCoding mapGeoCoding = (MapGeoCoding) geoCoding;
    MapTransformDescriptor transformDescriptor = mapGeoCoding.getMapInfo()
        .getMapProjection().getMapTransform().getDescriptor();
    String typeID = transformDescriptor.getTypeID();
    if (typeID.equals(IdentityTransformDescriptor.TYPE_ID)) {
      return true;
    }
  } else if (geoCoding instanceof CrsGeoCoding) {
    return CRS.equalsIgnoreMetadata(geoCoding.getMapCRS(), DefaultGeographicCRS.WGS84);
  }
  return false;
}

代码示例来源:origin: senbox-org/snap-desktop

final CoordinateReferenceSystem mapCRS = geoCoding.getMapCRS();
if (!mapCRS.equals(DefaultGeographicCRS.WGS84)) {
  try {

代码示例来源:origin: senbox-org/s2tbx

double y = pol.getCoordinates()[index].y;
try {
  DirectPosition pos = CRS.findMathTransform(product.getSceneGeoCoding().getMapCRS(), product.getSceneGeoCoding().getImageCRS()).transform(new DirectPosition2D(x, y), null);
  double[] values = pos.getCoordinate();
  xCoordinates[index] = (int) values[0];

代码示例来源:origin: senbox-org/s2tbx

/**
 * Utility methods
 */
private double[] getPixelSize(GeoCoding sourceGeoCoding, CoordinateReferenceSystem targetCRS) {
  double[] size = null;
  try {
    size = new double[2];
    DirectPosition geoPos1 = sourceGeoCoding.getImageToMapTransform()
        .transform(new DirectPosition2D(0, 0), null);
    Coordinate c1 = new Coordinate(geoPos1.getOrdinate(0), geoPos1.getOrdinate(1));
    DirectPosition geoPos2 = sourceGeoCoding.getImageToMapTransform()
        .transform(new DirectPosition2D(0, 1), null);
    Coordinate c2 = new Coordinate(geoPos2.getOrdinate(0), geoPos2.getOrdinate(1));
    DirectPosition geoPos3 = sourceGeoCoding.getImageToMapTransform()
        .transform(new DirectPosition2D(1, 0), null);
    Coordinate c3 = new Coordinate(geoPos3.getOrdinate(0), geoPos3.getOrdinate(1));
    final CoordinateReferenceSystem sourceCRS = sourceGeoCoding.getMapCRS();
    size[0] = distance(sourceCRS, targetCRS, c3, c1);
    size[1] = distance(sourceCRS, targetCRS, c2, c1);
  } catch (TransformException tex) {
    tex.printStackTrace();
  }
  return size;
}

代码示例来源:origin: senbox-org/snap-desktop

@Override
public void actionPerformed(ActionEvent e) {
  ProductSceneView view = SnapApp.getDefault().getSelectedProductSceneView();
  final GeoCoding geoCoding = view.getProduct().getSceneGeoCoding();
  boolean isGeographic = false;
  if (geoCoding instanceof MapGeoCoding) {
    MapGeoCoding mapGeoCoding = (MapGeoCoding) geoCoding;
    MapTransformDescriptor transformDescriptor = mapGeoCoding.getMapInfo()
        .getMapProjection().getMapTransform().getDescriptor();
    String typeID = transformDescriptor.getTypeID();
    if (typeID.equals(IdentityTransformDescriptor.TYPE_ID)) {
      isGeographic = true;
    }
  } else if (geoCoding instanceof CrsGeoCoding) {
    isGeographic = CRS.equalsIgnoreMetadata(geoCoding.getMapCRS(), DefaultGeographicCRS.WGS84);
  }
  if (isGeographic) {
    exportImage(view);
  } else {
    String message = "Product must be in ''Geographic Lat/Lon'' projection.";
    Dialogs.showInformation(message, null);
  }
}

代码示例来源:origin: senbox-org/snap-desktop

private void resetPositionTableModel() {
  positionModel.clear();
  if (currentRaster != null) {
    final GeoCoding geoCoding = currentRaster.getGeoCoding();
    positionModel.addRow("Image-X", "", "pixel");
    positionModel.addRow("Image-Y", "", "pixel");
    //todo [Multisize_products] ask for something else than multisize (scenetomodeltransform)
    if (getCurrentProduct().isMultiSize()) {
      positionModel.addRow("Scene-X", "", "pixel");
      positionModel.addRow("Scene-Y", "", "pixel");
    }
    if (geoCoding != null) {
      positionModel.addRow("Longitude", "", "degree");
      positionModel.addRow("Latitude", "", "degree");
      if (geoCoding instanceof MapGeoCoding) {
        final MapGeoCoding mapGeoCoding = (MapGeoCoding) geoCoding;
        final String mapUnit = mapGeoCoding.getMapInfo().getMapProjection().getMapUnit();
        positionModel.addRow("Map-X", "", mapUnit);
        positionModel.addRow("Map-Y", "", mapUnit);
      } else if (geoCoding instanceof CrsGeoCoding) {
        String xAxisUnit = geoCoding.getMapCRS().getCoordinateSystem().getAxis(0).getUnit().toString();
        String yAxisUnit = geoCoding.getMapCRS().getCoordinateSystem().getAxis(1).getUnit().toString();
        positionModel.addRow("Map-X", "", xAxisUnit);
        positionModel.addRow("Map-Y", "", yAxisUnit);
      }
    }
  }
}

代码示例来源:origin: senbox-org/s2tbx

if (geoCoding instanceof CrsGeoCoding) {
  try {
    final Integer epsgCode = CRS.lookupEpsgCode(geoCoding.getMapCRS(), true);
    GmlRectifiedGrid rectifiedGrid = new GmlRectifiedGrid();
    rectifiedGrid.setEpsgNumber(epsgCode);

相关文章