/** * Creates a new map transformation for the specified type ID, e.g. "Transverse_Mercator", and the array of * parameter values. * * @param typeID the map transform type ID, e.g. "Transverse_Mercator", must not be null * @param parameterValues an array of parameter values * * @return a new map transformation instance of the specified type, or <code>null</code> if the given type is not * registered */ public static MapTransform createTransform(String typeID, double[] parameterValues) { Guardian.assertNotNullOrEmpty("typeID", typeID); MapTransformDescriptor transformDescriptor = MapProjectionRegistry.getDescriptor(typeID); if (transformDescriptor != null) { return transformDescriptor.createTransform(parameterValues); } return null; } }
private static void registerProjections(boolean south) { for (int zoneIndex = 0; zoneIndex < MAX_UTM_ZONE; zoneIndex++) { MapProjection mapProjection = createProjection(zoneIndex, south); MapProjectionRegistry.registerProjection(mapProjection); } }
public void testCoordinateReferenceSystems() throws FactoryException { final MapProjection gp = MapProjectionRegistry.getProjection(new IdentityTransformDescriptor().getName()); assertSame(DefaultGeographicCRS.WGS84, CoordinateReferenceSystems.getCRS(gp, Datum.WGS_84)); for (final MapProjection projection : MapProjectionRegistry.getProjections()) { if (!(projection.getMapTransform().getDescriptor() instanceof IdentityTransformDescriptor)) { assertTrue(CoordinateReferenceSystems.getCRS(projection, Datum.ITRF_97) instanceof ProjectedCRS); assertTrue(CoordinateReferenceSystems.getCRS(projection, Datum.WGS_72) instanceof ProjectedCRS); assertTrue(CoordinateReferenceSystems.getCRS(projection, Datum.WGS_84) instanceof ProjectedCRS); } } }
/** * Gets the UTM projection suitable for the given geodetic coordinate. * * @param geoPos a geodetic coordinate * * @return a suitable UTM projection */ public static MapProjection getSuitableProjection(final GeoPos geoPos) { int zoneIndex = getZoneIndex(geoPos.getLon()); final boolean south = geoPos.getLat() < 0.0; final String projName = getProjectionName(zoneIndex, south); MapProjection projection = MapProjectionRegistry.getProjection(projName); return projection; }
final String datumName = strings[7]; final MapProjection projection; // new MapProjection(projectionName, transform); projection = MapProjectionRegistry.getProjection(projectionName); if (projection != null) { if (Datum.WGS_84.getName().equalsIgnoreCase(datumName)) {
private void initProduct(final String productName) { final int width = _fileInfo.getWidth(); final int height = _fileInfo.getHeight(); _product = new Product(productName, GETASSE30ReaderPlugIn.FORMAT_NAME, width, height, this); final MapInfo mapInfo = new MapInfo(MapProjectionRegistry.getProjection(IdentityTransformDescriptor.NAME), 0.5F, 0.5F, _fileInfo.getEasting(), _fileInfo.getNorthing() + height * _fileInfo.getPixelSizeY(), _fileInfo.getPixelSizeX(), _fileInfo.getPixelSizeY(), Datum.WGS_84); mapInfo.setSceneWidth(width); mapInfo.setSceneHeight(height); _product.setGeoCoding(new MapGeoCoding(mapInfo)); _product.setDescription("GETASSE30 DEM"); Band elevationBand = new Band("elevation", ProductData.TYPE_INT16, width, height); elevationBand.setUnit("m"); elevationBand.setDescription("GETASSE30 Elevation"); // setting geo-physical no-data value to prevent for scaling elevationBand.setGeophysicalNoDataValue(_fileInfo.getNoDataValue()); _product.addBand(elevationBand); }
final MapTransformDescriptor descriptor = MapProjectionRegistry.getDescriptor(projectionTypeID); final MapTransform mapTransform = descriptor.createTransform(parameterValues); final MapProjection projection = new MapProjection(projectionName, mapTransform, mapUnit);
/** * This method is called within the <code>{@link org.esa.beam.framework.dataop.maptransf.MapProjectionRegistry#registerDescriptor}</code> * method after an instance of this <code>MapTransformDescriptor</code> has been successfully registered. * <p/> */ @Override public void registerProjections() { MapProjectionRegistry.registerProjection(new MapProjection(getName(), createTransform(PARAMETER_DEFAULT_VALUES), false)); MapProjectionRegistry.registerProjection(new MapProjection(UPS_NORTH_NAME, createTransform(UPS_NORTH_PARAMETER_VALUES), true)); MapProjectionRegistry.registerProjection(new MapProjection(UPS_SOUTH_NAME, createTransform(UPS_SOUTH_PARAMETER_VALUES), true)); }
private static void setLambertConformalConicGeoCoding_MapGeoCoding(final Product product) { final MapTransformDescriptor descriptor = MapProjectionRegistry.getDescriptor( LambertConformalConicDescriptor.TYPE_ID); final double[] values = descriptor.getParameterDefaultValues(); for (int i = 0; i < values.length; i++) { values[i] = values[i] - 0.001; } final MapTransform transform = descriptor.createTransform(values); final MapProjection mapProjection = new MapProjection(descriptor.getTypeID(), transform); final MapInfo mapInfo = new MapInfo(mapProjection, .5f, .6f, .7f, .8f, .09f, .08f, Datum.WGS_84); mapInfo.setSceneWidth(product.getSceneRasterWidth()); mapInfo.setSceneHeight(product.getSceneRasterHeight()); product.setGeoCoding(new MapGeoCoding(mapInfo)); }
public void registerProjections() { MapProjectionRegistry.registerProjection(new MapProjection(getName(), createTransform(null), true)); }
public void registerProjections() { MapProjectionRegistry.registerProjection(new MapProjection(getName(), createTransform(null), false)); }
/** * Registers all possible UTM projections in the <code>{@link MapProjectionRegistry}</code>. The projection names * have the form "UTM Zone 1" to "UTM Zone 64" for the northern hemisphere and "UTM Zone 1, South" to "UTM Zone 64, * South" for the southern. Also contained is the special auto-UTM projection with the name <code>{@link * #AUTO_PROJECTION_NAME}</code>. */ public static void registerProjections() { if (!_projectionsRegistered) { MapProjectionRegistry.registerProjection(createAutoZoneProjection()); registerProjections(false); registerProjections(true); } _projectionsRegistered = true; }
/** * This method is called within the <code>{@link org.esa.beam.framework.dataop.maptransf.MapProjectionRegistry#registerDescriptor}</code> * method after an instance of this <code>MapTransformDescriptor</code> has been successfully registered. * <p/> * The method delegates the call to <code>{@link org.esa.beam.framework.dataop.maptransf.UTM#registerProjections}</code> * in order to register all frequently used UTM projections. */ @Override public void registerProjections() { UTM.registerProjections(); MapProjectionRegistry.registerProjection(new MapProjection(getName(), createTransform(null), false)); }
/** * This method is called within the <code>{@link MapProjectionRegistry#registerDescriptor}</code> method after an * instance of this <code>MapTransformDescriptor</code> has been successfully registered. The method can and should * be used to register projections that are based on the type of <code>{@link MapTransform}</code> described by this * <code>MapTransformDescriptor</code>. Registering projection instances is done using the using the <code>{@link * MapProjectionRegistry#registerProjection}</code> method. * <p/> * <p/> * A typical implementation of this method would be: * <pre> * public void registerProjections() { * MapProjectionRegistry.registerProjection(new MapProjection("my-projection-name-1", new * MyMapTransform(param_1))); * MapProjectionRegistry.registerProjection(new MapProjection("my-projection-name-2", new * MyMapTransform(param_2))); * MapProjectionRegistry.registerProjection(new MapProjection("my-projection-name-3", new * MyMapTransform(param_3))); * ... * } * </pre> */ public void registerProjections() { MapProjectionRegistry.registerProjection(new MapProjection(getName(), createTransform(null), false)); }
/** * This method is called within the <code>{@link MapProjectionRegistry#registerDescriptor}</code> method after an * instance of this <code>MapTransformDescriptor</code> has been successfully registered. The method can and should * be used to register projections that are based on the type of <code>{@link MapTransform}</code> described by this * <code>MapTransformDescriptor</code>. Registering projection instances is done using the using the <code>{@link * MapProjectionRegistry#registerProjection}</code> method. * <p/> * <p/> * A typical implementation of this method would be: * <pre> * public void registerProjections() { * MapProjectionRegistry.registerProjection(new MapProjection("my-projection-name-1", new * MyMapTransform(param_1))); * MapProjectionRegistry.registerProjection(new MapProjection("my-projection-name-2", new * MyMapTransform(param_2))); * MapProjectionRegistry.registerProjection(new MapProjection("my-projection-name-3", new * MyMapTransform(param_3))); * ... * } * </pre> */ public void registerProjections() { MapProjectionRegistry.registerProjection( new MapProjection(getName(), createTransform(null), getMapUnit(), false)); }