@Test public void getCRS() throws Exception { CoordinateReferenceSystem crs; UTMAutomaticCrsProvider autoUtmCrsProvider = new UTMAutomaticCrsProvider(DefaultGeodeticDatum.WGS84); crs = autoUtmCrsProvider.getCRS(new GeoPos(31.0, 33.0), null, DefaultGeodeticDatum.WGS84); assertEquals("UTM Zone 36 / WGS84", crs.getName().getCode()); crs = autoUtmCrsProvider.getCRS(new GeoPos(-31.0, 33.0), null, DefaultGeodeticDatum.WGS84); assertEquals("UTM Zone 36, South / WGS84", crs.getName().getCode()); crs = autoUtmCrsProvider.getCRS(new GeoPos(54.0, 10.0), null, DefaultGeodeticDatum.WGS84); assertEquals("UTM Zone 32 / WGS84", crs.getName().getCode()); crs = autoUtmCrsProvider.getCRS(new GeoPos(36.0, -100.0), null, DefaultGeodeticDatum.WGS84); assertEquals("UTM Zone 14 / WGS84", crs.getName().getCode()); }
@Override public CoordinateReferenceSystem getCRS(final GeoPos referencePos, ParameterValueGroup parameters, GeodeticDatum datum) throws FactoryException { int zoneIndex = getZoneIndex(referencePos.getLon()); final boolean south = referencePos.getLat() < 0.0; ParameterValueGroup tmParameters = createTransverseMercatorParameters(zoneIndex, south, datum); final String projName = getProjectionName(zoneIndex, south); return createCrs(projName, new TransverseMercator.Provider(), tmParameters, datum); }
UTMAutomaticCrsProvider extends AbstractUTMCrsProvider { @Override public CoordinateReferenceSystem getCRS(final GeoPos referencePos, ParameterValueGroup parameters, GeodeticDatum datum) throws FactoryException { int zoneIndex = getZoneIndex(referencePos.getLon()); final boolean south = referencePos.getLat() < 0.0; ParameterValueGroup tmParameters = createTransverseMercatorParameters(zoneIndex, south, datum); final String projName = getProjectionName(zoneIndex, south); return createCrs(projName, new TransverseMercator.Provider(), tmParameters, datum); } }
UTMAutomaticCrsProvider extends AbstractUTMCrsProvider { @Override public CoordinateReferenceSystem getCRS(final GeoPos referencePos, ParameterValueGroup parameters, GeodeticDatum datum) throws FactoryException { int zoneIndex = getZoneIndex(referencePos.getLon()); final boolean south = referencePos.getLat() < 0.0; ParameterValueGroup tmParameters = createTransverseMercatorParameters(zoneIndex, south, datum); final String projName = getProjectionName(zoneIndex, south); return createCrs(projName, new TransverseMercator.Provider(), tmParameters, datum); } UTMAutomaticCrsProvider(GeodeticDatum wgs84Datum); }
UTMAutomaticCrsProvider extends AbstractUTMCrsProvider { @Override public CoordinateReferenceSystem getCRS(final GeoPos referencePos, ParameterValueGroup parameters, GeodeticDatum datum) throws FactoryException { int zoneIndex = getZoneIndex(referencePos.getLon()); final boolean south = referencePos.getLat() < 0.0; ParameterValueGroup tmParameters = createTransverseMercatorParameters(zoneIndex, south, datum); final String projName = getProjectionName(zoneIndex, south); return createCrs(projName, new TransverseMercator.Provider(), tmParameters, datum); } UTMAutomaticCrsProvider(GeodeticDatum wgs84Datum); @Override ParameterValueGroup getParameter(); @Override CoordinateReferenceSystem getCRS(final GeoPos referencePos, ParameterValueGroup parameters,
                                            GeodeticDatum datum); }
UTMAutomaticCrsProvider extends AbstractUTMCrsProvider { @Override public CoordinateReferenceSystem getCRS(final GeoPos referencePos, ParameterValueGroup parameters, GeodeticDatum datum) throws FactoryException { int zoneIndex = getZoneIndex(referencePos.getLon()); final boolean south = referencePos.getLat() < 0.0; ParameterValueGroup tmParameters = createTransverseMercatorParameters(zoneIndex, south, datum); final String projName = getProjectionName(zoneIndex, south); return createCrs(projName, new TransverseMercator.Provider(), tmParameters, datum); } UTMAutomaticCrsProvider(GeodeticDatum wgs84Datum); @Override ParameterValueGroup getParameter(); @Override CoordinateReferenceSystem getCRS(final GeoPos referencePos, ParameterValueGroup parameters,
                                            GeodeticDatum datum);  }