svn commit: r1783350 - in /sis/branches/JDK8: core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/ core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/ c
Author: desruisseaux Date: Fri Feb 17 08:50:39 2017 New Revision: 1783350 URL: http://svn.apache.org/viewvc?rev=1783350=rev Log: Initial implementation of a CommonCRS.universal(φ,λ) method in replacement of CommonCRS.UTM(φ,λ) for handling the UPS cases. https://issues.apache.org/jira/browse/SIS-353 Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/GeodeticObjectBuilder.java sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/PolarStereographicA.java sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/TransverseMercator.java sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/CRS.java sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/CommonCRS.java sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/EPSGFactoryFallback.java sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/StandardDefinitions.java sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/CommonAuthorityFactory.java sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/gazetteer/MGRSEncoder.java sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/geometry/TransformTestCase.java sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/TransverseMercatorTest.java sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/CommonCRSTest.java sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/StandardDefinitionsTest.java sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/factory/sql/EPSGInstallerTest.java sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/gazetteer/MGRSEncoderTest.java sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/gazetteer/MilitaryGridReferenceSystemTest.java sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/CoordinateOperationFinderTest.java sis/branches/JDK8/storage/sis-earth-observation/src/main/java/org/apache/sis/storage/earthobservation/LandsatReader.java Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/GeodeticObjectBuilder.java URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/GeodeticObjectBuilder.java?rev=1783350=1783349=1783350=diff == --- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/GeodeticObjectBuilder.java [UTF-8] (original) +++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/GeodeticObjectBuilder.java [UTF-8] Fri Feb 17 08:50:39 2017 @@ -45,6 +45,7 @@ import org.apache.sis.util.ArgumentCheck import org.apache.sis.util.resources.Errors; import org.apache.sis.internal.system.DefaultFactories; import org.apache.sis.internal.referencing.provider.TransverseMercator; +import org.apache.sis.internal.referencing.provider.PolarStereographicA; import org.apache.sis.measure.Latitude; import org.apache.sis.referencing.Builder; import org.apache.sis.referencing.CommonCRS; @@ -230,18 +231,22 @@ public class GeodeticObjectBuilder exten * * * Transverse Mercator parameters - * Parameter name Value + * Parameter name Parameter value * Latitude of natural origin Given latitude, snapped to 0° in the UTM case * Longitude of natural originGiven longitude, optionally snapped to a UTM zone - * Scale factor at natural origin 0.9996 - * False easting 50 metres + * Scale factor at natural origin 0.9996 in UTM case + * False easting 50 metres in UTM case * False northing 0 (North hemisphere) or 1000 (South hemisphere) metres * * * Note that calculation of UTM zone contains special cases for Norway and Svalbard. * If not desired, those exceptions can be avoided by making sure that the given latitude is below 56°N. * - * @param isUTM if {@code true}, the given central meridian will be snapped to the central meridian of a UTM zone. + * If the given {@code zoner} is {@link TransverseMercator.Zoner#ANY ANY}, then this method will use the given + * latitude and longitude verbatim (without snapping them to a zone) but will still use the UTM scale factor, + * false easting and false northing. + * + * @param zoner whether to use UTM or MTM zones, or {@code ANY} for
svn commit: r1783399 - in /sis/branches/JDK8/core/sis-referencing/src: main/java/org/apache/sis/referencing/ main/java/org/apache/sis/referencing/factory/ test/java/org/apache/sis/referencing/
Author: desruisseaux Date: Fri Feb 17 13:21:18 2017 New Revision: 1783399 URL: http://svn.apache.org/viewvc?rev=1783399=rev Log: Add tests. Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/EPSGFactoryFallback.java sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/StandardDefinitions.java sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/CommonAuthorityFactory.java sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/CRSTest.java sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/CommonCRSTest.java sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/EPSGFactoryFallbackTest.java sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/StandardDefinitionsTest.java Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/EPSGFactoryFallback.java URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/EPSGFactoryFallback.java?rev=1783399=1783398=1783399=diff == --- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/EPSGFactoryFallback.java [UTF-8] (original) +++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/EPSGFactoryFallback.java [UTF-8] Fri Feb 17 13:21:18 2017 @@ -95,8 +95,8 @@ final class EPSGFactoryFallback extends } /** - * Returns the EPSG authority with only a modification in the title of emphasing that this is a subset - * of EPSG dataset. + * Returns the EPSG authority with only a modification in the title + * for emphasing that this is a subset of EPSG dataset. */ @Override public synchronized Citation getAuthority() { Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/StandardDefinitions.java URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/StandardDefinitions.java?rev=1783399=1783398=1783399=diff == --- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/StandardDefinitions.java [UTF-8] (original) +++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/StandardDefinitions.java [UTF-8] Fri Feb 17 13:21:18 2017 @@ -74,6 +74,7 @@ import static org.apache.sis.internal.me /** * Definitions of referencing objects identified by the {@link CommonCRS} enumeration values. * This class is used only as a fallback if the objects can not be fetched from the EPSG database. + * This class should not be loaded when a connection to an EPSG geodetic dataset is available. * * @author Martin Desruisseaux (Geomatys) * @since 0.4 @@ -109,7 +110,7 @@ final class StandardDefinitions { map.put(IDENTIFIERS_KEY, new NamedIdentifier(Citations.EPSG, String.valueOf(code))); } map.put(NAME_KEY, new NamedIdentifier(Citations.EPSG, name)); -map.put(ALIAS_KEY, alias); // May be null, which is okay. +map.put(ALIAS_KEY, alias); // May be null, which is okay. if (world) { map.put(DOMAIN_OF_VALIDITY_KEY, Extents.WORLD); } @@ -146,7 +147,7 @@ final class StandardDefinitions { final OperationMethod method; try { method = DefaultFactories.forBuildin(MathTransformFactory.class, DefaultMathTransformFactory.class) -.getOperationMethod(isUTM ? TransverseMercator.NAME : PolarStereographicA.NAME); +.getOperationMethod(isUTM ? TransverseMercator.NAME : PolarStereographicA.NAME); } catch (NoSuchIdentifierException e) { throw new IllegalStateException(e); // Should not happen with SIS implementation. } @@ -169,17 +170,17 @@ final class StandardDefinitions { */ static GeographicCRS createGeographicCRS(final short code, final GeodeticDatum datum, final EllipsoidalCS cs) { final String name; -String alias = null; -String scope = null; +String alias = null; +String scope = null; boolean world = false; switch (code) { -case 4326: name = "WGS 84"; world = true; scope = "Horizontal component of 3D system."; break; -case 4322: name = "WGS 72"; world = true; break; -case 4258: name = "ETRS89"; alias = "ETRS89-GRS80"; break; -case 4269: name = "NAD83"; break; -case 4267: name = "NAD27"; break; -case 4230: name = "ED50"; break; -case 4047: name = "Unspecified