本文整理了Java中org.esa.snap.core.datamodel.GeoCoding.getImageToMapTransform()
方法的一些代码示例,展示了GeoCoding.getImageToMapTransform()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。GeoCoding.getImageToMapTransform()
方法的具体详情如下:
包路径:org.esa.snap.core.datamodel.GeoCoding
类名称:GeoCoding
方法名:getImageToMapTransform
暂无
代码示例来源:origin: senbox-org/s2tbx
private double determineSourceResolution() throws OperatorException {
final GeoCoding sceneGeoCoding = getSourceProduct().getSceneGeoCoding();
if (sceneGeoCoding instanceof CrsGeoCoding) {
final MathTransform imageToMapTransform = sceneGeoCoding.getImageToMapTransform();
if (imageToMapTransform instanceof AffineTransform) {
return ((AffineTransform) imageToMapTransform).getScaleX();
}
}
throw new OperatorException("Invalid product: ");
}
代码示例来源: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/s2tbx
double scaleY = (double) sourceProduct.getSceneRasterHeight() / referenceHeight;
GeoCoding sceneGeoCoding = sourceProduct.getSceneGeoCoding();
if (sceneGeoCoding != null && sceneGeoCoding.getImageToMapTransform() instanceof AffineTransform) {
AffineTransform mapTransform = (AffineTransform) sceneGeoCoding.getImageToMapTransform();
referenceImageToModelTransform =
new AffineTransform(scaleX * mapTransform.getScaleX(), 0, 0, scaleY * mapTransform.getScaleY(),
final MathTransform imageToMapTransform = sourceProduct.getSceneGeoCoding().getImageToMapTransform();
if (imageToMapTransform instanceof AffineTransform) {
AffineTransform mapTransform = (AffineTransform) imageToMapTransform;
代码示例来源:origin: senbox-org/snap-desktop
tmy = String.valueOf(MathUtils.round(mapPoint.getY(), 10000.0));
} else if (geoCoding instanceof CrsGeoCoding) {
MathTransform transform = geoCoding.getImageToMapTransform();
try {
DirectPosition position = transform.transform(new DirectPosition2D(pX, pY), null);
代码示例来源:origin: senbox-org/s2tbx
GeoCoding sceneGeoCoding = sourceProduct.getSceneGeoCoding();
AffineTransform referenceImageToModelTransform = null;
if (sceneGeoCoding != null && sceneGeoCoding.getImageToMapTransform() instanceof AffineTransform) {
AffineTransform mapTransform = (AffineTransform) sceneGeoCoding.getImageToMapTransform();
referenceImageToModelTransform = new AffineTransform(scaleX * mapTransform.getScaleX(), 0, 0, scaleY * mapTransform.getScaleY(),
mapTransform.getTranslateX(), mapTransform.getTranslateY());
代码示例来源:origin: senbox-org/snap-desktop
final GeoCoding sceneGeoCoding = product.getSceneGeoCoding();
if (sceneGeoCoding != null) {
final MathTransform imageToMapTransform = sceneGeoCoding.getImageToMapTransform();
if (imageToMapTransform instanceof AffineTransform) {
final MathTransform modelToImage = imageToMapTransform.inverse();
代码示例来源:origin: senbox-org/s2tbx
@Override
public void initialize() throws OperatorException {
sourceProduct = getSourceProduct();
ensureSingleRasterSize(sourceProduct);
GeoCoding sourceGeoCoding = sourceProduct.getSceneGeoCoding();
if (sourceGeoCoding == null) {
throw new OperatorException("Source product has no geo-coding");
}
if (sourceGeoCoding instanceof CrsGeoCoding) {
final MathTransform i2m = sourceGeoCoding.getImageToMapTransform();
if (i2m instanceof AffineTransform) {
spatialResolution = ((AffineTransform) i2m).getScaleX();
} else {
throw new OperatorException("Could not retrieve spatial resolution from Geo-coding");
}
} else {
throw new OperatorException("Could not retrieve spatial resolution from Geo-coding");
}
elevationBand = sourceProduct.getBand(S2IdepixConstants.ELEVATION_BAND_NAME);
if (elevationBand == null) {
throw new OperatorException("Elevation band required to compute slope or aspect");
}
targetProduct = createTargetProduct();
slopeBand = createBand(SLOPE_BAND_NAME, SLOPE_BAND_DESCRIPTION, SLOPE_BAND_UNIT);
aspectBand = createBand(ASPECT_BAND_NAME, ASPECT_BAND_DESCRIPTION, ASPECT_BAND_UNIT);
orientationBand = createBand(ORIENTATION_BAND_NAME, ORIENTATION_BAND_DESCRIPTION, ORIENTATION_BAND_UNIT);
setTargetProduct(targetProduct);
}
代码示例来源:origin: senbox-org/s2tbx
MathTransform mapTransform = band.getGeoCoding().getImageToMapTransform();
DirectPosition bandOrigin = mapTransform.transform(new DirectPosition2D(0, 0), null);
S2MosaicMultiLevelSource bandSource =
内容来源于网络,如有侵权,请联系作者删除!