/** * Creates an automatic-zone UTM map projection. * * @return an automatic-zone UTM map projection */ public static UTMProjection createAutoZoneProjection() { return createProjection(AUTO_PROJECTION_NAME, 0, false); }
/** * Creates an UTM map projection for the specified parameters. * * @param zoneIndex the zone index in the range 0 to {@link #MAX_UTM_ZONE} - 1. * @param south whether or not the projection is defined for the southern hemispere * * @return an UTM map projection * * @see #getProjectionName */ public static UTMProjection createProjection(int zoneIndex, boolean south) { return createProjection(getProjectionName(zoneIndex, south), zoneIndex, south); }
private static void registerProjections(boolean south) { for (int zoneIndex = 0; zoneIndex < MAX_UTM_ZONE; zoneIndex++) { MapProjection mapProjection = createProjection(zoneIndex, south); MapProjectionRegistry.registerProjection(mapProjection); } }
/** * Creates the UTM MapGeocoding */ private void setMapGeoCoding() { final LandsatHeader landsatHeader = landsatTM.getHeader(); final GeometricData geoData = landsatHeader.getGeoData(); final float pixelSize = landsatHeader.getPixelSize(); GeoPoint projCenter = geoData.getGeoPointAt(LandsatConstants.Points.CENTER); float pcX = projCenter.getPixelX(); float pcY = projCenter.getPixelY(); final MapProjection mappro = UTM.createProjection(geoData.getMapZoneNumber() - 1, !projCenter.isNorthernHemisphere()); final int width = landsatHeader.getImageWidth(); final int height = landsatHeader.getImageHeight(); MapInfo map = new MapInfo(mappro, pcX, pcY, (float) projCenter.getEasting(), (float) projCenter.getNorthing(), pixelSize, pixelSize, Datum.WGS_84); map.setSceneWidth(width); map.setSceneHeight(height); map.setOrientation(geoData.getLookAngle() * -1); final MapGeoCoding mapGeocoding = new MapGeoCoding(map); product.setGeoCoding(mapGeocoding); }
@Test public void testDecodeQualificationForTIFFWithGeoInformation() throws IOException { final Product product = new Product("p", "t", 20, 10); final Band band = product.addBand("band1", ProductData.TYPE_INT8); band.ensureRasterData(); final MapInfo mapInfo = new MapInfo(UTM.createProjection(26, true), 0, 0, 0, 0, 1, 1, Datum.WGS_84); mapInfo.setSceneWidth(product.getSceneRasterWidth()); mapInfo.setSceneHeight(product.getSceneRasterHeight()); product.setGeoCoding(new MapGeoCoding(mapInfo)); final ImageInputStream inputStream = writeToInputStream(product); final DecodeQualification decodeQualification = GeoTiffProductReaderPlugIn.getDecodeQualificationImpl(inputStream); assertEquals(DecodeQualification.SUITABLE, decodeQualification); }
final float orientationAngle = (float) leaderFile.getUTMOrientationAngle(); final MapInfo mapInfo = new MapInfo(UTM.createProjection(zoneIndex - 1, isSouth), sceneWidth * 0.5f, sceneHeight * 0.5f, (float) easting, (float) northing,
final float orientationAngle = (float) leaderFile.getUTMOrientationAngle(); final MapInfo mapInfo = new MapInfo(UTM.createProjection(zoneIndex - 1, isSouth), sceneWidth * 0.5f, sceneHeight * 0.5f, (float) easting, (float) northing,