/** * Creates a new UTM projection instance. * * @param name the projection name, e.g. "UTM Zone 32" * @param zoneIndex the zne as zero-based index, e.g. 31 for zone 32 * @param south false, if the zone is on the northern hemisphere * * @return the new projection */ public static UTMProjection create(final String name, int zoneIndex, boolean south) { final double[] params = UTM.getProjectionParams(zoneIndex, south); final MapTransform mapTransform = MapTransformFactory.createTransform("Transverse_Mercator", params); final UTMProjection mapProjection = new UTMProjection(name, mapTransform, zoneIndex, south); return mapProjection; }
public void testForwardTransform() { final MapTransform transform = MapTransformFactory.createTransform(StereographicDescriptor.TYPE_ID, DEFAULT_PARAMS); final float lat = 90.0f, lon = 25.0f; GeoPos geoPos = new GeoPos(lat, lon); Point2D mapPoint = transform.forward(geoPos, null); assertEquals(0.0, mapPoint.getX(), EPSILON); assertEquals(0.0, mapPoint.getY(), EPSILON); }
private MapInfo createMapInfo() { MapTransform transform = MapTransformFactory.createTransform("Identity", null); MapProjection projection = new MapProjection("pro_name", transform); Datum datum = new Datum("datumName", new Ellipsoid("ellipsoidName", 7d, 8d), 0, 0, 0); MapInfo mapInfo = new MapInfo(projection, 1f, 2f, 3f, 4f, 5f, 6f, datum); mapInfo.setSceneWidth(123); mapInfo.setSceneHeight(234); return mapInfo; } }
public void testForwarAndInverseTransform() { // values for this test are from Frank Fell! double[] params = new double[]{Ellipsoid.WGS_84.getSemiMajor(), Ellipsoid.WGS_84.getSemiMinor(), 0.0, 9.0, 0.9996, 500000.0, 0.0}; MapTransform transform = MapTransformFactory.createTransform("Transverse_Mercator", params); float lat = 53.786666666f, lon = 11.87305555f; GeoPos geoPos = new GeoPos(lat, lon); Point2D mapPoint = transform.forward(geoPos, null); assertEquals(689265.13, mapPoint.getX(), _metricDelta); assertEquals(5963616.5, mapPoint.getY(), _metricDelta); GeoPos testPos = transform.inverse(mapPoint, null); assertEquals(lon, testPos.getLon(), _geodeticDelta); assertEquals(lat, testPos.getLat(), _geodeticDelta); }
MapTransform mapTransform = MapTransformFactory.createTransform("Identity", null); Dimension size = ProductUtils.getOutputRasterSize(product, null, mapTransform, 0.05F, 0.05F); 0.0 }; mapTransform = MapTransformFactory.createTransform("Transverse_Mercator", params); size = ProductUtils.getOutputRasterSize(product, null, mapTransform, 0.05, 0.05);
public void testForwardAndInverseTransform() { final MapTransform transform = MapTransformFactory.createTransform(StereographicDescriptor.TYPE_ID, DEFAULT_PARAMS); float lat = 90f, lon = 11.87305555f; GeoPos geoPos = new GeoPos(lat, lon); Point2D mapPoint = transform.forward(geoPos, null); GeoPos testPos = transform.inverse(mapPoint, null); assertEquals(90.0, testPos.getLat(), EPSILON); assertEquals(0, testPos.getLon(), EPSILON); lat = 53.786666666f; lon = 11.87305555f; geoPos = new GeoPos(lat, lon); mapPoint = transform.forward(geoPos, null); testPos = transform.inverse(mapPoint, null); assertEquals(lat, testPos.getLat(), EPSILON); assertEquals(lon, testPos.getLon(), EPSILON); }
public void testCartographicMapTransformParameterSettings() { double[] params = new double[]{Ellipsoid.WGS_84.getSemiMajor(), Ellipsoid.WGS_84.getSemiMinor(), 1.0, 2.0, 3.0, 4.0, 5.0}; MapTransform mt = MapTransformFactory.createTransform("Transverse_Mercator", params); assertTrue(mt instanceof CartographicMapTransform); CartographicMapTransform amt = (CartographicMapTransform) mt; assertEquals(2.0, amt.getCentralMeridian(), 1e-10); assertEquals(4.0, amt.getFalseEasting(), 1e-10); assertEquals(5.0, amt.getFalseNorthing(), 1e-10); assertEquals(1.0 * Ellipsoid.WGS_84.getSemiMajor(), amt.getSemiMajor(), 1e-10); assertEquals(1.0 / Ellipsoid.WGS_84.getSemiMajor(), amt.getInverseSemiMajor(), 1e-10); } }
final MapTransform transform = MapTransformFactory.createTransform(StereographicDescriptor.TYPE_ID, parameterValues); final MapProjection projection = new MapProjection(StereographicDescriptor.NAME, transform);
final MapTransform transform = MapTransformFactory.createTransform(StereographicDescriptor.TYPE_ID, parameterValues); final MapProjection projection = new MapProjection(StereographicDescriptor.NAME, transform);