You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sis.apache.org by de...@apache.org on 2016/03/30 13:25:07 UTC
svn commit: r1737101 [1/7] - in /sis/branches/JDK6: ./
application/sis-console/src/main/artifact/conf/
core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/
core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/sql/
core/sis-meta...
Author: desruisseaux
Date: Wed Mar 30 11:25:06 2016
New Revision: 1737101
URL: http://svn.apache.org/viewvc?rev=1737101&view=rev
Log:
Merge from the JDK7 branch.
Added:
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/CoordinateOperations.java
- copied unchanged from r1737089, sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/CoordinateOperations.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/CRSPair.java
- copied, changed from r1737089, sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/CRSPair.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/CoordinateOperationContext.java
- copied unchanged from r1737089, sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/CoordinateOperationContext.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/CoordinateOperationInference.java
- copied, changed from r1737089, sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/CoordinateOperationInference.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/InverseOperationMethod.java
- copied, changed from r1737089, sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/InverseOperationMethod.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/MathTransformContext.java
- copied unchanged from r1737089, sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/MathTransformContext.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/CartesianToPolar.java
- copied unchanged from r1737089, sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/CartesianToPolar.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/CartesianToSpherical.java
- copied unchanged from r1737089, sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/CartesianToSpherical.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/CoordinateSystemTransform.java
- copied, changed from r1737089, sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/CoordinateSystemTransform.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/PolarToCartesian.java
- copied unchanged from r1737089, sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/PolarToCartesian.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/SphericalToCartesian.java
- copied unchanged from r1737089, sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/SphericalToCartesian.java
sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultCylindricalCSTest.java
- copied unchanged from r1737089, sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultCylindricalCSTest.java
sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultPolarCSTest.java
- copied unchanged from r1737089, sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultPolarCSTest.java
sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/CoordinateOperationInferenceTest.java
- copied unchanged from r1737089, sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/CoordinateOperationInferenceTest.java
sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/CartesianToPolarTest.java
- copied unchanged from r1737089, sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/CartesianToPolarTest.java
sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/CartesianToSphericalTest.java
- copied unchanged from r1737089, sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/CartesianToSphericalTest.java
sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/CoordinateSystemTransformTest.java
- copied unchanged from r1737089, sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/CoordinateSystemTransformTest.java
sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/PolarToCartesianTest.java
- copied unchanged from r1737089, sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/PolarToCartesianTest.java
sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/SphericalToCartesianTest.java
- copied unchanged from r1737089, sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/SphericalToCartesianTest.java
sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/jdk7/DirectoryStream.java (with props)
sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/jdk8/DateTimeException.java
- copied unchanged from r1737089, sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/jdk8/DateTimeException.java
sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/jdk8/Instant.java
- copied unchanged from r1737089, sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/jdk8/Instant.java
sis/branches/JDK6/src/main/config/
- copied from r1737089, sis/branches/JDK7/src/main/config/
sis/branches/JDK6/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/DataTransfer.java
- copied unchanged from r1737089, sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/DataTransfer.java
sis/branches/JDK6/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/HyperRectangleReader.java
- copied unchanged from r1737089, sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/HyperRectangleReader.java
sis/branches/JDK6/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/MemoryDataTransfer.java
- copied unchanged from r1737089, sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/MemoryDataTransfer.java
sis/branches/JDK6/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/MetadataHelper.java
- copied unchanged from r1737089, sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/MetadataHelper.java
sis/branches/JDK6/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/Region.java
- copied unchanged from r1737089, sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/Region.java
sis/branches/JDK6/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/csv/
- copied from r1737089, sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/csv/
sis/branches/JDK6/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/HyperRectangleReaderTest.java
- copied unchanged from r1737089, sis/branches/JDK7/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/HyperRectangleReaderTest.java
sis/branches/JDK6/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/csv/
- copied from r1737089, sis/branches/JDK7/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/csv/
Removed:
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/OperationPathFinder.java
Modified:
sis/branches/JDK6/ (props changed)
sis/branches/JDK6/application/sis-console/src/main/artifact/conf/logging.properties
sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/AxisDirections.java
sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/AxisNames.java
sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/sql/Initializer.java
sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/AbstractParser.java
sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Element.java
sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/MetadataStandard.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/geometry/Envelopes.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/geometry/GeneralDirectPosition.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/geometry/GeneralEnvelope.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/ExtentSelector.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/GeodeticObjectBuilder.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/Legacy.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/ReferencingUtilities.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/j2d/AffineTransform2D.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/AbstractProvider.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Affine.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/GeocentricAffine.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/GeocentricTranslation3D.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/GeographicOffsets.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/parameter/TensorParameters.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/AuthorityFactories.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/CRS.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/CommonCRS.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/IdentifiedObjects.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/Properties.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/StandardDefinitions.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/AxesConvention.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/AxisFilter.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/CoordinateSystems.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultCoordinateSystemAxis.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultCylindricalCS.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultLinearCS.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/Normalizer.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/BursaWolfParameters.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultGeodeticDatum.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/TimeDependentBWP.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/package-info.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/CommonAuthorityFactory.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/GeodeticObjectFactory.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/MultiAuthoritiesFactory.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/BursaWolfInfo.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/EPSGDataAccess.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/EPSGFactory.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/EPSGInstaller.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/InstallationScriptProvider.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/AbstractCoordinateOperation.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/AbstractSingleOperation.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultConcatenatedOperation.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultConversion.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultCoordinateOperationFactory.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/GeneralMatrix.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/Matrices.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/NonSquareMatrix.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/Solver.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/UnmodifiableMatrix.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/package-info.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/AbstractMathTransform.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/ConcatenatedTransform.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/ContextualParameters.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/DefaultMathTransformFactory.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/EllipsoidToCentricTransform.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/InterpolatedMolodenskyTransform.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/InterpolatedTransform.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/MathTransforms.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/MolodenskyTransform.java
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/ProjectiveTransform.java
sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/internal/metadata/AxisDirectionsTest.java
sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/BuilderTest.java
sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/CommonCRSTest.java
sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/StandardDefinitionsTest.java
sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultEngineeringCRSTest.java
sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultGeocentricCRSTest.java
sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/CoordinateSystemsTest.java
sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultCartesianCSTest.java
sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultSphericalCSTest.java
sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/HardCodedAxes.java
sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/HardCodedCS.java
sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/NormalizerTest.java
sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/BursaWolfParametersTest.java
sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/factory/sql/EPSGInstallerTest.java
sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/MatrixTestCase.java
sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/NonSquareMatrixTest.java
sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/EllipsoidToCentricTransformTest.java
sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/ProjectiveTransformTest.java
sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/TransformResultComparator.java
sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/test/suite/ReferencingTestSuite.java
sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/jdk7/Files.java
sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/jdk8/JDK8.java
sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/system/DataDirectory.java
sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/system/DefaultFactories.java
sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/system/Semaphores.java
sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/system/Shutdown.java
sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/system/Supervisor.java
sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/util/StandardDateFormat.java
sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/setup/About.java
sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/Exceptions.java
sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/Utilities.java
sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/logging/Logging.java
sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/logging/MonolineFormatter.java
sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java
sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.properties
sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties
sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.java
sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.properties
sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary_fr.properties
sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/test/LoggingWatcher.java
sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/test/TestCase.java
sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/test/XMLTestCase.java
sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/util/ExceptionsTest.java
sis/branches/JDK6/pom.xml
sis/branches/JDK6/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/Variable.java
sis/branches/JDK6/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/impl/ChannelDecoder.java
sis/branches/JDK6/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/impl/Dimension.java
sis/branches/JDK6/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/impl/VariableInfo.java
sis/branches/JDK6/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/ucar/VariableWrapper.java
sis/branches/JDK6/storage/sis-netcdf/src/test/java/org/apache/sis/internal/netcdf/DecoderTest.java
sis/branches/JDK6/storage/sis-netcdf/src/test/java/org/apache/sis/internal/netcdf/GridGeometryTest.java
sis/branches/JDK6/storage/sis-netcdf/src/test/java/org/apache/sis/internal/netcdf/TestCase.java
sis/branches/JDK6/storage/sis-netcdf/src/test/java/org/apache/sis/internal/netcdf/VariableTest.java
sis/branches/JDK6/storage/sis-netcdf/src/test/java/org/apache/sis/internal/netcdf/impl/ChannelDecoderTest.java
sis/branches/JDK6/storage/sis-netcdf/src/test/java/org/apache/sis/internal/netcdf/impl/GridGeometryInfoTest.java
sis/branches/JDK6/storage/sis-netcdf/src/test/java/org/apache/sis/internal/netcdf/impl/VariableInfoTest.java
sis/branches/JDK6/storage/sis-netcdf/src/test/java/org/apache/sis/storage/netcdf/MetadataReaderTest.java
sis/branches/JDK6/storage/sis-storage/pom.xml
sis/branches/JDK6/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/ChannelData.java
sis/branches/JDK6/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/ChannelDataInput.java
sis/branches/JDK6/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/csv/Store.java
sis/branches/JDK6/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/wkt/Store.java
sis/branches/JDK6/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/xml/Store.java
sis/branches/JDK6/storage/sis-storage/src/main/java/org/apache/sis/storage/StorageConnector.java
sis/branches/JDK6/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/ByteArrayChannel.java
sis/branches/JDK6/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/ChannelDataOutputTest.java
sis/branches/JDK6/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/ChannelImageOutputStreamTest.java
sis/branches/JDK6/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/csv/StoreTest.java
sis/branches/JDK6/storage/sis-storage/src/test/java/org/apache/sis/test/suite/StorageTestSuite.java
Propchange: sis/branches/JDK6/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Mar 30 11:25:06 2016
@@ -1,4 +1,4 @@
/sis/branches/Android:1430670-1480699
-/sis/branches/JDK7:1394913-1733371
-/sis/branches/JDK8:1584960-1733370
+/sis/branches/JDK7:1394913-1737089
+/sis/branches/JDK8:1584960-1737071
/sis/trunk:1394364-1508466,1519089-1519674
Modified: sis/branches/JDK6/application/sis-console/src/main/artifact/conf/logging.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/application/sis-console/src/main/artifact/conf/logging.properties?rev=1737101&r1=1737100&r2=1737101&view=diff
==============================================================================
--- sis/branches/JDK6/application/sis-console/src/main/artifact/conf/logging.properties [ISO-8859-1] (original)
+++ sis/branches/JDK6/application/sis-console/src/main/artifact/conf/logging.properties [ISO-8859-1] Wed Mar 30 11:25:06 2016
@@ -56,7 +56,7 @@ java.util.logging.ConsoleHandler.level =
# source: If set, writes the source logger or the source class name.
# The argument specifies the type of source to display.
# Valid values are none, logger:short, logger:long,
-# class:short and class:long.
+# "class:short", "class:long" and "class.method".
java.util.logging.ConsoleHandler.formatter = org.apache.sis.util.logging.MonolineFormatter
org.apache.sis.util.logging.MonolineFormatter.source = logger:long
Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/AxisDirections.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/AxisDirections.java?rev=1737101&r1=1737100&r2=1737101&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/AxisDirections.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/AxisDirections.java [UTF-8] Wed Mar 30 11:25:06 2016
@@ -16,8 +16,11 @@
*/
package org.apache.sis.internal.metadata;
+import java.util.Map;
+import java.util.HashMap;
import javax.measure.unit.Unit;
import javax.measure.quantity.Angle;
+import org.opengis.annotation.UML;
import org.opengis.referencing.cs.AxisDirection;
import org.opengis.referencing.cs.CoordinateSystem;
import org.opengis.referencing.cs.CoordinateSystemAxis;
@@ -28,6 +31,8 @@ import org.apache.sis.util.iso.Types;
import org.apache.sis.measure.Units;
import static org.opengis.referencing.cs.AxisDirection.*;
+import static org.opengis.annotation.Obligation.CONDITIONAL;
+import static org.opengis.annotation.Specification.ISO_19162;
import static org.apache.sis.util.CharSequences.*;
@@ -36,7 +41,7 @@ import static org.apache.sis.util.CharSe
*
* @author Martin Desruisseaux (Geomatys)
* @since 0.4
- * @version 0.6
+ * @version 0.7
* @module
*/
public final class AxisDirections extends Static {
@@ -59,40 +64,86 @@ public final class AxisDirections extend
public static final int DISPLAY_COUNT = 4;
/**
+ * Ordinal of the last element in the {@link AxisDirection} code list.
+ * This is used for differentiating the standard codes from the user-defined ones.
+ */
+ private static final int LAST_ORDINAL = DISPLAY_DOWN.ordinal();
+
+ /**
+ * Distance from the origin in a polar coordinate system.
+ * Specified in ISO 19162 but not yet in ISO 19111.
+ *
+ * @since 0.7
+ */
+ @UML(identifier="awayFrom", obligation=CONDITIONAL, specification=ISO_19162)
+ public static final AxisDirection AWAY_FROM = AxisDirection.valueOf("AWAY_FROM");
+
+ /**
+ * Direction of geographic angles (bearing).
+ * Specified in ISO 19162 but not yet in ISO 19111.
+ *
+ * @since 0.7
+ */
+ @UML(identifier="clockwise", obligation=CONDITIONAL, specification=ISO_19162)
+ public static final AxisDirection CLOCKWISE = AxisDirection.valueOf("CLOCKWISE");
+
+ /**
+ * Direction of arithmetic angles. Used in polar coordinate systems.
+ * Specified in ISO 19162 but not yet in ISO 19111.
+ *
+ * @since 0.7
+ */
+ @UML(identifier="counterClockwise", obligation=CONDITIONAL, specification=ISO_19162)
+ public static final AxisDirection COUNTER_CLOCKWISE = AxisDirection.valueOf("COUNTER_CLOCKWISE");
+
+ /**
* For each direction, the opposite direction.
+ * This map shall be immutable after construction.
*/
- private static final AxisDirection[] OPPOSITES = new AxisDirection[DISPLAY_DOWN.ordinal() + 1];
+ private static final Map<AxisDirection,AxisDirection> OPPOSITES = new HashMap<AxisDirection,AxisDirection>(20);
static {
- put(OTHER, OTHER);
- put(NORTH, SOUTH);
- put(NORTH_NORTH_EAST, SOUTH_SOUTH_WEST);
- put(NORTH_EAST, SOUTH_WEST);
- put(EAST_NORTH_EAST, WEST_SOUTH_WEST);
- put(EAST, WEST);
- put(EAST_SOUTH_EAST, WEST_NORTH_WEST);
- put(SOUTH_EAST, NORTH_WEST);
- put(SOUTH_SOUTH_EAST, NORTH_NORTH_WEST);
- put(UP, DOWN);
- put(FUTURE, PAST);
- put(COLUMN_POSITIVE, COLUMN_NEGATIVE);
- put(ROW_POSITIVE, ROW_NEGATIVE);
- put(DISPLAY_RIGHT, DISPLAY_LEFT);
- put(DISPLAY_UP, DISPLAY_DOWN);
+ put(OTHER, OTHER);
+ put(NORTH, SOUTH);
+ put(NORTH_NORTH_EAST, SOUTH_SOUTH_WEST);
+ put(NORTH_EAST, SOUTH_WEST);
+ put(EAST_NORTH_EAST, WEST_SOUTH_WEST);
+ put(EAST, WEST);
+ put(EAST_SOUTH_EAST, WEST_NORTH_WEST);
+ put(SOUTH_EAST, NORTH_WEST);
+ put(SOUTH_SOUTH_EAST, NORTH_NORTH_WEST);
+ put(UP, DOWN);
+ put(FUTURE, PAST);
+ put(COLUMN_POSITIVE, COLUMN_NEGATIVE);
+ put(ROW_POSITIVE, ROW_NEGATIVE);
+ put(DISPLAY_RIGHT, DISPLAY_LEFT);
+ put(DISPLAY_UP, DISPLAY_DOWN);
+ put(COUNTER_CLOCKWISE, CLOCKWISE);
}
/**
* Stores the given directions in the {@link #OPPOSITES} array.
*/
private static void put(final AxisDirection dir, final AxisDirection opposite) {
- OPPOSITES[dir.ordinal()] = opposite;
- OPPOSITES[opposite.ordinal()] = dir;
+ OPPOSITES.put(dir, opposite);
+ OPPOSITES.put(opposite, dir);
}
/**
- * Ordinal of the last element in the {@link AxisDirection} code list.
- * This is used for differentiating the standard codes from the user-defined ones.
+ * Proposed abbreviations for some axis directions.
+ * This map shall be immutable after construction.
*/
- private static final int LAST_ORDINAL = DISPLAY_DOWN.ordinal();
+ private static final Map<AxisDirection,String> ABBREVIATIONS = new HashMap<AxisDirection,String>(12);
+ static {
+ final Map<AxisDirection,String> m = ABBREVIATIONS;
+ m.put(FUTURE, "t");
+ m.put(COLUMN_POSITIVE, "i");
+ m.put(ROW_POSITIVE, "j");
+ m.put(DISPLAY_RIGHT, "x");
+ m.put(DISPLAY_UP, "y");
+ m.put(OTHER, "z"); // Arbitrary abbreviation, may change in any future SIS version.
+ m.put(AWAY_FROM, "r");
+ m.put(COUNTER_CLOCKWISE, "θ");
+ }
/**
* Do not allow instantiation of this class.
@@ -114,24 +165,25 @@ public final class AxisDirections extend
* <th style="width: 50%">Direction</th>
* <th style="width: 50%">Absolute value</th>
* </tr>
- * <tr><td>{@code NORTH}</td> <td>{@code NORTH}</td> </tr>
- * <tr><td>{@code SOUTH}</td> <td>{@code NORTH}</td> </tr>
- * <tr><td>{@code EAST}</td> <td>{@code EAST}</td> </tr>
- * <tr><td>{@code WEST}</td> <td>{@code EAST}</td> </tr>
- * <tr><td>{@code UP}</td> <td>{@code UP}</td> </tr>
- * <tr><td>{@code DOWN}</td> <td>{@code UP}</td> </tr>
+ * <tr><td>{@code NORTH}</td> <td>{@code NORTH}</td></tr>
+ * <tr><td>{@code SOUTH}</td> <td>{@code NORTH}</td></tr>
+ * <tr><td>{@code EAST}</td> <td>{@code EAST}</td></tr>
+ * <tr><td>{@code WEST}</td> <td>{@code EAST}</td></tr>
+ * <tr><td>{@code UP}</td> <td>{@code UP}</td></tr>
+ * <tr><td>{@code DOWN}</td> <td>{@code UP}</td></tr>
* </table></td>
* <td><table class="sis" summary="Other directions">
* <tr>
* <th style="width: 50%">Direction</th>
* <th style="width: 50%">Absolute value</th>
* </tr>
- * <tr><td>{@code DISPLAY_RIGHT}</td> <td>{@code DISPLAY_RIGHT}</td> </tr>
- * <tr><td>{@code DISPLAY_LEFT}</td> <td>{@code DISPLAY_RIGHT}</td> </tr>
- * <tr><td>{@code DISPLAY_UP}</td> <td>{@code DISPLAY_UP}</td> </tr>
- * <tr><td>{@code DISPLAY_DOWN}</td> <td>{@code DISPLAY_UP}</td> </tr>
- * <tr><td>{@code FUTURE}</td> <td>{@code FUTURE}</td> </tr>
- * <tr><td>{@code PAST}</td> <td>{@code FUTURE}</td> </tr>
+ * <tr><td>{@code DISPLAY_RIGHT}</td> <td>{@code DISPLAY_RIGHT}</td></tr>
+ * <tr><td>{@code DISPLAY_LEFT}</td> <td>{@code DISPLAY_RIGHT}</td></tr>
+ * <tr><td>{@code DISPLAY_UP}</td> <td>{@code DISPLAY_UP}</td></tr>
+ * <tr><td>{@code DISPLAY_DOWN}</td> <td>{@code DISPLAY_UP}</td></tr>
+ * <tr><td>{@code FUTURE}</td> <td>{@code FUTURE}</td></tr>
+ * <tr><td>{@code PAST}</td> <td>{@code FUTURE}</td></tr>
+ * <tr><td>{@code CLOCKWISE}</td> <td>{@code COUNTERCLOCKWISE}</td></tr>
* </table></td></tr>
* <tr align="center"><td>{@code OTHER}</td><td>{@code OTHER}</td></tr>
* </table>
@@ -139,11 +191,16 @@ public final class AxisDirections extend
* @param dir The direction for which to return the absolute direction, or {@code null}.
* @return The direction from the above table, or {@code null} if the given direction was null.
*/
- public static AxisDirection absolute(final AxisDirection dir) {
+ public static AxisDirection absolute(AxisDirection dir) {
final AxisDirection opposite = opposite(dir);
if (opposite != null) {
if (opposite.ordinal() < dir.ordinal()) {
- return opposite;
+ dir = opposite;
+ }
+ // Below is a temporary patch pending integration of code list values into GeoAPI.
+ // We need this patch because we can not rely on ordinal() value for custom codes.
+ if (dir == CLOCKWISE) {
+ dir = COUNTER_CLOCKWISE;
}
}
return dir;
@@ -159,13 +216,7 @@ public final class AxisDirections extend
* @return The opposite direction, or {@code null} if none or unknown.
*/
public static AxisDirection opposite(AxisDirection dir) {
- if (dir != null) {
- final int ordinal = dir.ordinal();
- if (ordinal >= 0 && ordinal < OPPOSITES.length) {
- dir = OPPOSITES[ordinal];
- }
- }
- return dir;
+ return OPPOSITES.get(dir);
}
/**
@@ -291,7 +342,7 @@ public final class AxisDirections extend
final int tgt = target.ordinal() - base;
if (tgt >= 0 && tgt < GEOCENTRIC_COUNT) {
int n = (tgt - src);
- n -= GEOCENTRIC_COUNT * (n/2); // If -2 add 3. If +2 subtract 3. Otherwise do nothing.
+ n -= GEOCENTRIC_COUNT * (n/2); // If -2 add 3. If +2 subtract 3. Otherwise do nothing.
return n;
}
}
@@ -376,12 +427,12 @@ public final class AxisDirections extend
if (cs != null) {
for (int i = cs.getDimension(); --i>=0;) {
final CoordinateSystemAxis axis = cs.getAxis(i);
- if (axis != null) { // Paranoiac check.
+ if (axis != null) { // Paranoiac check.
final Unit<?> candidate = axis.getUnit();
if (Units.isAngular(candidate)) {
unit = candidate.asType(Angle.class);
if (AxisDirection.EAST.equals(absolute(axis.getDirection()))) {
- break; // Found the longitude axis.
+ break; // Found the longitude axis.
}
}
}
@@ -434,7 +485,7 @@ public final class AxisDirections extend
if (dim + i > cs.getDimension()) {
return -1;
}
- while (--i > 0) { // Intentionally exclude 0.
+ while (--i > 0) { // Intentionally exclude 0.
if (!absolute(subCS.getAxis(i).getDirection()).equals(
absolute(cs.getAxis(i + dim).getDirection())))
{
@@ -505,12 +556,12 @@ public final class AxisDirections extend
int s = name.indexOf('/', d);
if (s < 0) {
if (equalsIgnoreCase(name, d, length, "north pole")) {
- return GEOCENTRIC_Z; // "Geocentre > north pole"
+ return GEOCENTRIC_Z; // "Geocentre > north pole"
}
} else if (equalsIgnoreCase(name, d, skipTrailingWhitespaces(name, d, s), "equator")) {
s = skipLeadingWhitespaces(name, s+1, length);
if (equalsIgnoreCase(name, s, length, "PM")) {
- return GEOCENTRIC_X; // "Geocentre > equator/PM"
+ return GEOCENTRIC_X; // "Geocentre > equator/PM"
}
/*
* At this point, the name may be "Geocentre > equator/0°E",
@@ -527,8 +578,8 @@ public final class AxisDirections extend
i = skipLeadingWhitespaces(name, i, length);
if (equalsIgnoreCase(name, i, length, "°E") || equalsIgnoreCase(name, i, length, "dE")) {
switch (n) {
- case 0: return GEOCENTRIC_X; // "Geocentre > equator/0°E"
- case 90: return GEOCENTRIC_Y; // "Geocentre > equator/90°E"
+ case 0: return GEOCENTRIC_X; // "Geocentre > equator/0°E"
+ case 90: return GEOCENTRIC_Y; // "Geocentre > equator/90°E"
}
}
break;
@@ -549,10 +600,14 @@ public final class AxisDirections extend
}
/**
- * Returns {@code true} if the given name starts with the given keyword, ignoring case.
+ * Returns {@code true} if the given name starts or ends with the given keyword, ignoring case.
+ *
+ * @param start {@code false} if the given keyword is expected at the beggining of the name,
+ * or {@code end} if expected at the end.
*/
- private static boolean startsWith(final String name, final String keyword) {
- return name.regionMatches(true, 0, keyword, 0, keyword.length());
+ private static boolean contains(final String name, final String keyword, final boolean end) {
+ final int length = keyword.length();
+ return name.regionMatches(true, end ? name.length() - length : 0, keyword, 0, length);
}
/**
@@ -569,7 +624,14 @@ public final class AxisDirections extend
*/
public static String suggestAbbreviation(final String name, final AxisDirection direction, final Unit<?> unit) {
if (name.length() == 1) {
- return name; // Most common cases are "x", "y", "z", "t", "i" and "j".
+ return name; // Most common cases are "x", "y", "z", "t", "i" and "j".
+ }
+ /*
+ * Direction may be both "compass" (e.g. North) or "non-compass" (e.g. away from).
+ * Even if the radius at θ = 0° is oriented toward North, but we do not want the "N" abbreviation.
+ */
+ if (contains(name, "radius", true)) {
+ return contains(name, "Geocentric", false) ? "R" : "r";
}
if (isCompass(direction)) {
/*
@@ -578,7 +640,7 @@ public final class AxisDirections extend
* a longitude or latitude axis. We detect those later cases by the unit of measurement.
*/
if (!isIntercardinal(direction) && Units.isAngular(unit)) {
- if (startsWith(name, "Spherical")) {
+ if (contains(name, "Spherical", false)) {
return NORTH.equals(absolute(direction)) ? "φ′" : "θ";
} else {
return NORTH.equals(absolute(direction)) ? "φ" : "λ";
@@ -592,27 +654,20 @@ public final class AxisDirections extend
* use "h" as the fallback for unknown vertical axis.
*/
if (UP.equals(direction)) {
- return startsWith(name, "Gravity") ? "H" : startsWith(name, "Geocentric") ? "r": "h";
+ if (contains(name, "Gravity", false)) return "H";
+ if (contains(name, "Elevation", false)) return "φ";
+ if (contains(name, "Geocentric", false)) return "r";
+ return "h";
} else if (DOWN.equals(direction)) {
- return "D"; // "Depth"
+ return "D"; // "Depth"
} else if (isGeocentric(direction)) {
// For GEOCENTRIC_X, GEOCENTRIC_Y or GEOCENTRIC_Z, just take the last letter.
final String dir = direction.name();
return dir.substring(dir.length() - 1).trim();
}
- final AxisDirection a = absolute(direction);
- if (FUTURE.equals(a)) {
- return "t";
- } else if (COLUMN_POSITIVE.equals(a)) {
- return "i";
- } else if (ROW_POSITIVE.equals(a)) {
- return "j";
- } else if (DISPLAY_RIGHT.equals(a)) {
- return "x";
- } else if (DISPLAY_UP.equals(a)) {
- return "y";
- } else if (OTHER.equals(a)) {
- return "z"; // Arbitrary abbreviation, may change in any future SIS version.
+ final String abbreviation = ABBREVIATIONS.get(absolute(direction));
+ if (abbreviation != null) {
+ return abbreviation;
}
}
final String id = direction.identifier(); // UML identifier, or null if none.
Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/AxisNames.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/AxisNames.java?rev=1737101&r1=1737100&r2=1737101&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/AxisNames.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/AxisNames.java [UTF-8] Wed Mar 30 11:25:06 2016
@@ -57,7 +57,8 @@ public final class AxisNames {
/**
* The ISO 19111 <cite>"spherical longitude"</cite> name. Abbreviation used by SIS is "θ" (theta)
- * for consistency with the EPSG "long" abbreviation, but some other conventions use "φ" instead.
+ * for consistency with ISO 19162 <cite>Axis name and abbreviation</cite> section,
+ * but some other conventions use φ or Ω instead.
* Direction in the EPSG database is "East", but "counterClockwise" may also be used.
*
* @see <a href="http://en.wikipedia.org/wiki/Spherical_coordinate_system">Spherical coordinate system on Wikipedia</a>
@@ -67,7 +68,8 @@ public final class AxisNames {
/**
* The ISO 19111 <cite>"spherical latitude"</cite> name. Abbreviation used by SIS is "φ′" (phi prime)
- * for consistency with the EPSG "lat" abbreviation, but some other conventions use "θ" instead.
+ * for consistency with ISO 19162 <cite>Axis name and abbreviation</cite> section,
+ * but some other conventions use θ, Ω or Ψ instead.
* Direction in the EPSG database is "North", but the "Up" direction may also be used with a similar
* axis named "elevation".
*/
@@ -104,7 +106,11 @@ public final class AxisNames {
public static final String GEOCENTRIC_Z = "Geocentric Z";
/**
- * The ISO 19111 <cite>"geocentric radius"</cite> name. Abbreviation is lower case <cite>"r"</cite>.
+ * The ISO 19111 <cite>"geocentric radius"</cite> name. Abbreviation is upper case <cite>"R"</cite>
+ * for consistency with EPSG database.
+ *
+ * <div class="note"><b>Note:</b>Lower case <cite>"r"</cite> is used for non-geocentric radius
+ * or axes named "distance" with "awayFrom" direction.</div>
*/
public static final String GEOCENTRIC_RADIUS = "Geocentric radius";
Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/sql/Initializer.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/sql/Initializer.java?rev=1737101&r1=1737100&r2=1737101&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/sql/Initializer.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/sql/Initializer.java [UTF-8] Wed Mar 30 11:25:06 2016
@@ -22,6 +22,8 @@ import java.net.URLClassLoader;
import java.util.ServiceLoader;
import java.util.logging.Level;
import java.util.logging.LogRecord;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
import java.lang.reflect.Method;
import javax.sql.DataSource;
import java.sql.Connection;
@@ -242,7 +244,11 @@ public abstract class Initializer {
* As a fallback, try to open the Derby database located in $SIS_DATA/Databases/SpatialMetadata directory.
*/
final boolean create;
- final String home = System.getProperty(DERBY_HOME_KEY);
+ final String home = AccessController.doPrivileged(new PrivilegedAction<String>() {
+ @Override public String run() {
+ return System.getProperty(DERBY_HOME_KEY);
+ }
+ });
final Path dir = DataDirectory.DATABASES.getDirectory();
if (dir != null) {
Path path = dir.resolve(DATABASE);
@@ -312,7 +318,11 @@ public abstract class Initializer {
*/
public static boolean hasJNDI() {
return NamingManager.hasInitialContextFactoryBuilder() ||
- System.getProperty(Context.INITIAL_CONTEXT_FACTORY) != null;
+ AccessController.doPrivileged(new PrivilegedAction<Boolean>() {
+ @Override public Boolean run() {
+ return System.getProperty(Context.INITIAL_CONTEXT_FACTORY) != null;
+ }
+ });
}
/**
Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/AbstractParser.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/AbstractParser.java?rev=1737101&r1=1737100&r2=1737101&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/AbstractParser.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/AbstractParser.java [UTF-8] Wed Mar 30 11:25:06 2016
@@ -34,10 +34,13 @@ import javax.measure.unit.UnitFormat;
import org.opengis.util.FactoryException;
import org.opengis.util.InternationalString;
import org.apache.sis.internal.system.Loggers;
+import org.apache.sis.internal.util.LocalizedParseException;
import org.apache.sis.internal.util.StandardDateFormat;
import org.apache.sis.measure.Units;
import org.apache.sis.util.ArgumentChecks;
+import org.apache.sis.util.CharSequences;
import org.apache.sis.util.logging.Logging;
+import org.apache.sis.util.resources.Errors;
import static org.apache.sis.util.ArgumentChecks.ensureNonNull;
@@ -55,7 +58,7 @@ import static org.apache.sis.util.Argume
* @author Rémi Eve (IRD)
* @author Martin Desruisseaux (IRD, Geomatys)
* @since 0.6
- * @version 0.6
+ * @version 0.7
* @module
*/
abstract class AbstractParser implements Parser {
@@ -227,6 +230,20 @@ abstract class AbstractParser implements
}
/**
+ * Returns the index after the end of the fragment name starting at the given index.
+ * Current implementation assumes that the fragment name is a Unicode identifier.
+ */
+ static int endOfFragmentName(final String text, int upper) {
+ final int length = text.length();
+ while (upper < length) {
+ final int c = text.codePointAt(upper);
+ if (!Character.isUnicodeIdentifierPart(c)) break;
+ upper += Character.charCount(c);
+ }
+ return upper;
+ }
+
+ /**
* Parses a <cite>Well Know Text</cite> (WKT).
*
* @param text The text to be parsed.
@@ -238,7 +255,22 @@ abstract class AbstractParser implements
warnings = null;
ignoredElements.clear();
ArgumentChecks.ensureNonEmpty("text", text);
- final Element element = new Element("<root>", new Element(this, text, position, null));
+ Element fragment;
+ int lower = CharSequences.skipLeadingWhitespaces(text, position.getIndex(), text.length());
+ if (lower < text.length() && text.charAt(lower) == Symbols.FRAGMENT_VALUE) {
+ final int upper = endOfFragmentName(text, ++lower);
+ final String id = text.substring(lower, upper);
+ fragment = fragments.get(id);
+ if (fragment == null) {
+ position.setErrorIndex(lower);
+ throw new LocalizedParseException(errorLocale, Errors.Keys.NoSuchValue_1, new Object[] {id}, lower);
+ }
+ position.setIndex(upper);
+ fragment = new Element(fragment);
+ } else {
+ fragment = new Element(this, text, position, null);
+ }
+ final Element element = new Element("<root>", fragment);
final Object object = parseObject(element);
element.close(ignoredElements);
return object;
Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Element.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Element.java?rev=1737101&r1=1737100&r2=1737101&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Element.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Element.java [UTF-8] Wed Mar 30 11:25:06 2016
@@ -124,18 +124,18 @@ final class Element implements Serializa
keyword = name;
offset = singleton.offset;
locale = singleton.locale;
- list = new LinkedList<Object>(); // Needs to be a modifiable list.
+ list = new LinkedList<Object>(); // Needs to be a modifiable list.
list.add(singleton);
}
/**
* Creates a modifiable copy of the given element.
*/
- private Element(final Element toCopy) {
+ Element(final Element toCopy) {
keyword = toCopy.keyword;
offset = toCopy.offset;
locale = toCopy.locale;
- list = new LinkedList<Object>(toCopy.list); // Needs to be a modifiable list.
+ list = new LinkedList<Object>(toCopy.list); // Needs to be a modifiable list.
final ListIterator<Object> it = list.listIterator();
while (it.hasNext()) {
final Object value = it.next();
@@ -230,12 +230,7 @@ final class Element implements Serializa
* to environment variables in Unix. If we find the "$" character, get the identifier behind "$"
* and insert the corresponding WKT fragment here.
*/
- int upper = ++lower; // Increment of 1 is okay because FRAGMENT_VALUE is a 'char'.
- while (upper < length) {
- final int c = text.codePointAt(upper);
- if (!Character.isUnicodeIdentifierPart(c)) break;
- upper += Character.charCount(c);
- }
+ final int upper = AbstractParser.endOfFragmentName(text, ++lower);
final String id = text.substring(lower, upper);
Element fragment = parser.fragments.get(id);
if (fragment == null) {
@@ -272,7 +267,7 @@ final class Element implements Serializa
* parsed text.
*/
final int n = Character.charCount(closingQuote);
- lower += Character.charCount(firstChar) - n; // This will usually let 'lower' unchanged.
+ lower += Character.charCount(firstChar) - n; // This will usually let 'lower' unchanged.
CharSequence content = null;
do {
final int upper = text.indexOf(closingQuote, lower += n);
@@ -280,7 +275,7 @@ final class Element implements Serializa
throw missingCharacter(closingQuote, lower, position);
}
if (content == null) {
- content = text.substring(lower, upper); // First text fragment, and usually the only one.
+ content = text.substring(lower, upper); // First text fragment, and usually the only one.
} else {
/*
* We will enter in this block only if we found at least one double quote.
@@ -313,7 +308,7 @@ final class Element implements Serializa
switch (valueType) {
case TEMPORAL: value = parser.parseDate (text, position); break;
case NUMERIC: value = parser.parseNumber(text, position); break;
- default: throw new AssertionError(valueType); // Should never happen.
+ default: throw new AssertionError(valueType); // Should never happen.
}
if (value == null) {
// Do not update the error index; it is already updated by NumberFormat.
Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/MetadataStandard.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/MetadataStandard.java?rev=1737101&r1=1737100&r2=1737101&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/MetadataStandard.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/MetadataStandard.java [UTF-8] Wed Mar 30 11:25:06 2016
@@ -968,7 +968,7 @@ public class MetadataStandard implements
}
/**
- * Assigns an {@link ConcurrentMap} instance to the given field.
+ * Assigns a {@link ConcurrentMap} instance to the given field.
* Used on deserialization only.
*/
@SuppressWarnings("rawtypes")
Modified: sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/geometry/Envelopes.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/geometry/Envelopes.java?rev=1737101&r1=1737100&r2=1737101&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/geometry/Envelopes.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/geometry/Envelopes.java [UTF-8] Wed Mar 30 11:25:06 2016
@@ -269,7 +269,7 @@ public final class Envelopes extends Sta
* ordinate values. This coordinate will be updated in the 'switch' statement inside
* the 'while' loop.
*/
- if (sourceDim >= 20) { // Maximal value supported by Formulas.pow3(int) is 19.
+ if (sourceDim >= 20) { // Maximal value supported by Formulas.pow3(int) is 19.
throw new IllegalArgumentException(Errors.format(Errors.Keys.ExcessiveNumberOfDimensions_1));
}
int pointIndex = 0;
@@ -395,12 +395,12 @@ public final class Envelopes extends Sta
for (int ib3 = pointIndex, dim = sourceDim; --dim >= 0; ib3 /= 3) {
final double ordinate;
if (dim == i) {
- ordinate = x; // Position of the extremum.
+ ordinate = x; // Position of the extremum.
} else switch (ib3 % 3) {
case 0: ordinate = envelope.getMinimum(dim); break;
case 1: ordinate = envelope.getMaximum(dim); break;
case 2: ordinate = envelope.getMedian (dim); break;
- default: throw new AssertionError(ib3); // Should never happen
+ default: throw new AssertionError(ib3); // Should never happen
}
sourcePt[dim] = ordinate;
}
@@ -413,7 +413,7 @@ public final class Envelopes extends Sta
}
}
}
- derivatives[pointIndex] = null; // Let GC do its job earlier.
+ derivatives[pointIndex] = null; // Let GC do its job earlier.
}
}
if (targetPt != null) {
@@ -491,13 +491,13 @@ public final class Envelopes extends Sta
*/
if (sourceCRS != null) {
final CoordinateSystem cs = sourceCRS.getCoordinateSystem();
- if (cs != null) { // Should never be null, but check as a paranoiac safety.
+ if (cs != null) { // Should never be null, but check as a paranoiac safety.
DirectPosition sourcePt = null;
DirectPosition targetPt = null;
final int dimension = cs.getDimension();
for (int i=0; i<dimension; i++) {
final CoordinateSystemAxis axis = cs.getAxis(i);
- if (axis == null) { // Should never be null, but check as a paranoiac safety.
+ if (axis == null) { // Should never be null, but check as a paranoiac safety.
continue;
}
final double min = envelope.getMinimum(i);
@@ -579,17 +579,17 @@ public final class Envelopes extends Sta
AbstractEnvelope generalEnvelope = null;
DirectPosition sourcePt = null;
DirectPosition targetPt = null;
- long includedMinValue = 0; // A bitmask for each dimension.
+ long includedMinValue = 0; // A bitmask for each dimension.
long includedMaxValue = 0;
long isWrapAroundAxis = 0;
long dimensionBitMask = 1;
final int dimension = targetCS.getDimension();
for (int i=0; i<dimension; i++, dimensionBitMask <<= 1) {
final CoordinateSystemAxis axis = targetCS.getAxis(i);
- if (axis == null) { // Should never be null, but check as a paranoiac safety.
+ if (axis == null) { // Should never be null, but check as a paranoiac safety.
continue;
}
- boolean testMax = false; // Tells if we are testing the minimal or maximal value.
+ boolean testMax = false; // Tells if we are testing the minimal or maximal value.
do {
final double extremum = testMax ? axis.getMaximumValue() : axis.getMinimumValue();
if (Double.isInfinite(extremum) || Double.isNaN(extremum)) {
Modified: sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/geometry/GeneralDirectPosition.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/geometry/GeneralDirectPosition.java?rev=1737101&r1=1737100&r2=1737101&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/geometry/GeneralDirectPosition.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/geometry/GeneralDirectPosition.java [UTF-8] Wed Mar 30 11:25:06 2016
@@ -24,6 +24,8 @@ package org.apache.sis.geometry;
import java.util.Arrays;
import java.io.Serializable;
import java.lang.reflect.Field;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
import org.opengis.geometry.DirectPosition;
import org.opengis.geometry.MismatchedDimensionException;
import org.opengis.referencing.crs.CoordinateReferenceSystem;
@@ -65,6 +67,12 @@ public class GeneralDirectPosition exten
private static final long serialVersionUID = -5524426558018300122L;
/**
+ * Used for setting the {@link #ordinates} field during a {@link #clone()} operation only.
+ * Will be fetch when first needed.
+ */
+ private static volatile Field ordinatesField;
+
+ /**
* The ordinates of the direct position. The length of this array is the
* {@linkplain #getDimension() dimension} of this direct position.
*/
@@ -273,6 +281,21 @@ public class GeneralDirectPosition exten
}
/**
+ * Returns the {@code "ordinates"} field of the given class and gives write permission to it.
+ * This method should be invoked only from {@link #clone()} method.
+ */
+ static Field getOrdinatesField(final Class<?> type) throws NoSuchFieldException {
+ final Field field = type.getDeclaredField("ordinates");
+ AccessController.doPrivileged(new PrivilegedAction<Void>() {
+ @Override public Void run() {
+ field.setAccessible(true);
+ return null;
+ }
+ });
+ return field;
+ }
+
+ /**
* Returns a deep copy of this position.
*
* @return A copy of this direct position.
@@ -280,9 +303,11 @@ public class GeneralDirectPosition exten
@Override
public GeneralDirectPosition clone() {
try {
+ Field field = ordinatesField;
+ if (field == null) {
+ ordinatesField = field = getOrdinatesField(GeneralDirectPosition.class);
+ }
GeneralDirectPosition e = (GeneralDirectPosition) super.clone();
- final Field field = GeneralDirectPosition.class.getDeclaredField("ordinates");
- field.setAccessible(true);
field.set(e, ordinates.clone());
return e;
} catch (Exception exception) { // (ReflectiveOperationException | CloneNotSupportedException) on JDK7
Modified: sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/geometry/GeneralEnvelope.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/geometry/GeneralEnvelope.java?rev=1737101&r1=1737100&r2=1737101&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/geometry/GeneralEnvelope.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/geometry/GeneralEnvelope.java [UTF-8] Wed Mar 30 11:25:06 2016
@@ -1034,9 +1034,7 @@ public class GeneralEnvelope extends Arr
try {
Field field = ordinatesField;
if (field == null) {
- field = ArrayEnvelope.class.getDeclaredField("ordinates");
- field.setAccessible(true);
- ordinatesField = field;
+ ordinatesField = field = GeneralDirectPosition.getOrdinatesField(ArrayEnvelope.class);
}
GeneralEnvelope e = (GeneralEnvelope) super.clone();
field.set(e, ordinates.clone());
Modified: sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/ExtentSelector.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/ExtentSelector.java?rev=1737101&r1=1737100&r2=1737101&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/ExtentSelector.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/ExtentSelector.java [UTF-8] Wed Mar 30 11:25:06 2016
@@ -72,7 +72,7 @@ public final class ExtentSelector<T> {
*/
public boolean evaluate(final Extent extent, final T object) {
final double area = Extents.area(Extents.intersection(Extents.getGeographicBoundingBox(extent), areaOfInterest));
- if (best != null && !(area > largestArea)) { // Use '!' for catching NaN.
+ if (best != null && !(area > largestArea)) { // Use '!' for catching NaN.
/*
* At this point, the given extent is not greater than the previous one.
* However if the previous object had no extent information at all (i.e.
Modified: sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/GeodeticObjectBuilder.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/GeodeticObjectBuilder.java?rev=1737101&r1=1737100&r2=1737101&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/GeodeticObjectBuilder.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/GeodeticObjectBuilder.java [UTF-8] Wed Mar 30 11:25:06 2016
@@ -16,24 +16,38 @@
*/
package org.apache.sis.internal.referencing;
+import java.util.Map;
+import java.util.Date;
+import java.util.Collections;
import javax.measure.unit.Unit;
+import javax.measure.quantity.Duration;
import org.opengis.util.FactoryException;
import org.opengis.parameter.ParameterValueGroup;
import org.opengis.parameter.ParameterNotFoundException;
import org.opengis.parameter.InvalidParameterValueException;
+import org.opengis.referencing.IdentifiedObject;
import org.opengis.referencing.crs.CRSFactory;
+import org.opengis.referencing.crs.CoordinateReferenceSystem;
import org.opengis.referencing.crs.GeographicCRS;
import org.opengis.referencing.crs.ProjectedCRS;
+import org.opengis.referencing.crs.TemporalCRS;
+import org.opengis.referencing.cs.AxisDirection;
+import org.opengis.referencing.cs.CSFactory;
import org.opengis.referencing.cs.CartesianCS;
+import org.opengis.referencing.cs.TimeCS;
+import org.opengis.referencing.datum.DatumFactory;
+import org.opengis.referencing.datum.TemporalDatum;
import org.opengis.referencing.operation.CoordinateOperationFactory;
import org.opengis.referencing.operation.OperationMethod;
import org.opengis.referencing.operation.Conversion;
+import org.apache.sis.internal.metadata.ReferencingServices;
import org.apache.sis.util.ArgumentChecks;
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.measure.Latitude;
import org.apache.sis.referencing.Builder;
+import org.apache.sis.referencing.CommonCRS;
/**
@@ -69,12 +83,22 @@ public class GeodeticObjectBuilder exten
private ParameterValueGroup parameters;
/**
- * The factor for Coordinate Reference System objects, fetched when first needed.
+ * The factory for Coordinate Reference System objects, fetched when first needed.
*/
private CRSFactory crsFactory;
/**
- * The factor for Coordinate Operation objects, fetched when first needed.
+ * The factory for Coordinate System objects, fetched when first needed.
+ */
+ private CSFactory csFactory;
+
+ /**
+ * The factory for Datum objects, fetched when first needed.
+ */
+ private DatumFactory datumFactory;
+
+ /**
+ * The factory for Coordinate Operation objects, fetched when first needed.
*/
private CoordinateOperationFactory copFactory;
@@ -95,6 +119,26 @@ public class GeodeticObjectBuilder exten
}
/**
+ * Returns the factory for Coordinate System objects. This method fetches the factory when first needed.
+ */
+ private CSFactory getCSFactory() {
+ if (csFactory == null) {
+ csFactory = DefaultFactories.forBuildin(CSFactory.class);
+ }
+ return csFactory;
+ }
+
+ /**
+ * Returns the factory for Datum objects. This method fetches the factory when first needed.
+ */
+ private DatumFactory getDatumFactory() {
+ if (datumFactory == null) {
+ datumFactory = DefaultFactories.forBuildin(DatumFactory.class);
+ }
+ return datumFactory;
+ }
+
+ /**
* Returns the factory for Coordinate Operation objects. This method fetches the factory when first needed.
*/
private CoordinateOperationFactory getCoordinateOperationFactory() {
@@ -264,4 +308,87 @@ public class GeodeticObjectBuilder exten
onCreate(true);
}
}
+
+ /**
+ * Creates a temporal CRS from the given origin and temporal unit. For this method, the CRS name is optional:
+ * if no {@code addName(…)} method has been invoked, then a default name will be used.
+ *
+ * @param origin The epoch in milliseconds since January 1st, 1970 at midnight UTC.
+ * @param unit The unit of measurement.
+ * @return A temporal CRS using the given origin and units.
+ * @throws FactoryException if an error occurred while building the temporal CRS.
+ */
+ public TemporalCRS createTemporalCRS(final Date origin, final Unit<Duration> unit) throws FactoryException {
+ /*
+ * Try to use one of the pre-defined datum and coordinate system if possible.
+ * This not only saves a little bit of memory, but also provides better names.
+ */
+ TimeCS cs = null;
+ TemporalDatum datum = null;
+ for (final CommonCRS.Temporal c : CommonCRS.Temporal.values()) {
+ if (datum == null) {
+ final TemporalDatum candidate = c.datum();
+ if (origin.equals(candidate.getOrigin())) {
+ datum = candidate;
+ }
+ }
+ if (cs == null) {
+ final TemporalCRS crs = c.crs();
+ final TimeCS candidate = crs.getCoordinateSystem();
+ if (unit.equals(candidate.getAxis(0).getUnit())) {
+ if (datum == candidate && properties.isEmpty()) {
+ return crs;
+ }
+ cs = candidate;
+ }
+ }
+ }
+ /*
+ * Create the datum and coordinate system before the CRS if we were not able to use a pre-defined object.
+ * In the datum case, we will use the same metadata than the CRS (domain of validity, scope, etc.) except
+ * the identifier and the remark.
+ */
+ onCreate(false);
+ try {
+ if (cs == null) {
+ final CSFactory csFactory = getCSFactory();
+ cs = CommonCRS.Temporal.JAVA.crs().getCoordinateSystem(); // To be used as a template, except for units.
+ cs = csFactory.createTimeCS(name(cs),
+ csFactory.createCoordinateSystemAxis(name(cs.getAxis(0)), "t", AxisDirection.FUTURE, unit));
+ }
+ if (properties.get(TemporalCRS.NAME_KEY) == null) {
+ properties.putAll(name(cs));
+ }
+ if (datum == null) {
+ final Object remarks = properties.remove(TemporalCRS.REMARKS_KEY);
+ final Object identifier = properties.remove(TemporalCRS.IDENTIFIERS_KEY);
+ datum = getDatumFactory().createTemporalDatum(properties, origin);
+ properties.put(TemporalCRS.IDENTIFIERS_KEY, identifier);
+ properties.put(TemporalCRS.REMARKS_KEY, remarks);
+ properties.put(TemporalCRS.NAME_KEY, datum.getName()); // Share the Identifier instance.
+ }
+ return getCRSFactory().createTemporalCRS(properties, datum, cs);
+ } finally {
+ onCreate(true);
+ }
+ }
+
+ /**
+ * Creates a compound CRS, but we special processing for (two-dimensional Geographic + ellipsoidal heights) tupples.
+ * If any such tupple is found, a three-dimensional geographic CRS is created instead than the compound CRS.
+ *
+ * @param components ordered array of {@code CoordinateReferenceSystem} objects.
+ * @return The coordinate reference system for the given properties.
+ * @throws FactoryException if the object creation failed.
+ */
+ public CoordinateReferenceSystem createCompoundCRS(final CoordinateReferenceSystem... components) throws FactoryException {
+ return ReferencingServices.getInstance().createCompoundCRS(getCRSFactory(), getCSFactory(), properties, components);
+ }
+
+ /**
+ * Creates a map of properties containing only the name of the given object.
+ */
+ private static Map<String,Object> name(final IdentifiedObject template) {
+ return Collections.<String,Object>singletonMap(IdentifiedObject.NAME_KEY, template.getName());
+ }
}
Modified: sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/Legacy.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/Legacy.java?rev=1737101&r1=1737100&r2=1737101&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/Legacy.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/Legacy.java [UTF-8] Wed Mar 30 11:25:06 2016
@@ -121,7 +121,7 @@ public final class Legacy implements Axi
// -----------------------------------------------------------------
/**
- * The value to be returned by {@link #getUnitReplacement(Unit)},
+ * The value to be returned by {@link #getUnitReplacement(CoordinateSystemAxis, Unit)},
* or {@code null} if no replacement should be done.
*/
private final Unit<?> replacement;
@@ -133,14 +133,21 @@ public final class Legacy implements Axi
replacement = unit;
}
+ @Override
+ @Deprecated
+ public Unit<?> getUnitReplacement(Unit<?> unit) {
+ return getUnitReplacement(null, unit);
+ }
+
/**
* For internal usage by {@link #replaceUnit(CartesianCS, Unit)} only.
*
+ * @param axis ignored.
* @param unit ignored.
* @return The unit of the new coordinate system.
*/
@Override
- public Unit<?> getUnitReplacement(final Unit<?> unit) {
+ public Unit<?> getUnitReplacement(CoordinateSystemAxis axis, final Unit<?> unit) {
return replacement;
}
@@ -156,7 +163,16 @@ public final class Legacy implements Axi
* Returns the given direction unchanged.
*/
@Override
+ @Deprecated
public AxisDirection getDirectionReplacement(final AxisDirection direction) {
return direction;
}
+
+ /**
+ * Returns the given direction unchanged.
+ */
+ @Override
+ public AxisDirection getDirectionReplacement(CoordinateSystemAxis axis, final AxisDirection direction) {
+ return direction;
+ }
}
Modified: sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/ReferencingUtilities.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/ReferencingUtilities.java?rev=1737101&r1=1737100&r2=1737101&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/ReferencingUtilities.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/ReferencingUtilities.java [UTF-8] Wed Mar 30 11:25:06 2016
@@ -37,6 +37,7 @@ import org.apache.sis.referencing.Identi
import org.apache.sis.referencing.datum.DefaultPrimeMeridian;
import org.apache.sis.referencing.crs.DefaultGeographicCRS;
import org.apache.sis.referencing.cs.AxesConvention;
+import org.apache.sis.referencing.operation.transform.DefaultMathTransformFactory.Context;
import static java.util.Collections.singletonMap;
@@ -65,14 +66,16 @@ public final class ReferencingUtilities
* This method provides the same functionality than {@link DefaultPrimeMeridian#getGreenwichLongitude(Unit)},
* but on arbitrary implementation.
*
- * @param primeMeridian The prime meridian from which to get the Greenwich longitude.
+ * @param primeMeridian The prime meridian from which to get the Greenwich longitude, or {@code null}.
* @param unit The unit for the prime meridian to return.
- * @return The prime meridian in the given units.
+ * @return The prime meridian in the given units, or {@code 0} if the given prime meridian was null.
*
* @see DefaultPrimeMeridian#getGreenwichLongitude(Unit)
*/
public static double getGreenwichLongitude(final PrimeMeridian primeMeridian, final Unit<Angle> unit) {
- if (primeMeridian instanceof DefaultPrimeMeridian) { // Maybe the user overrode some methods.
+ if (primeMeridian == null) {
+ return 0;
+ } else if (primeMeridian instanceof DefaultPrimeMeridian) { // Maybe the user overrode some methods.
return ((DefaultPrimeMeridian) primeMeridian).getGreenwichLongitude(unit);
} else {
return primeMeridian.getAngularUnit().getConverterTo(unit).convert(primeMeridian.getGreenwichLongitude());
@@ -319,4 +322,36 @@ public final class ReferencingUtilities
}
return null;
}
+
+ /**
+ * Sets the source and target ellipsoids and coordinate systems to values inferred from the given CRS.
+ * The ellipsoids will be non-null only if the given CRS is geographic (not geocentric).
+ *
+ * @param sourceCRS The CRS from which to get the source coordinate system and ellipsoid.
+ * @param targetCRS The CRS from which to get the target coordinate system and ellipsoid.
+ * @param context A pre-allocated context, or {@code null} for creating a new one.
+ * @return The given context if it was non-null, or a new context otherwise.
+ *
+ * @since 0.7
+ */
+ public static Context createTransformContext(final CoordinateReferenceSystem sourceCRS,
+ final CoordinateReferenceSystem targetCRS, Context context)
+ {
+ if (context == null) {
+ context = new Context();
+ }
+ final CoordinateSystem sourceCS = (sourceCRS != null) ? sourceCRS.getCoordinateSystem() : null;
+ final CoordinateSystem targetCS = (targetCRS != null) ? targetCRS.getCoordinateSystem() : null;
+ if (sourceCRS instanceof GeodeticCRS && sourceCS instanceof EllipsoidalCS) {
+ context.setSource((EllipsoidalCS) sourceCS, ((GeodeticCRS) sourceCRS).getDatum().getEllipsoid());
+ } else {
+ context.setSource(sourceCS);
+ }
+ if (targetCRS instanceof GeodeticCRS && targetCS instanceof EllipsoidalCS) {
+ context.setTarget((EllipsoidalCS) targetCS, ((GeodeticCRS) targetCRS).getDatum().getEllipsoid());
+ } else {
+ context.setTarget(targetCS);
+ }
+ return context;
+ }
}
Modified: sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/j2d/AffineTransform2D.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/j2d/AffineTransform2D.java?rev=1737101&r1=1737100&r2=1737101&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/j2d/AffineTransform2D.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/j2d/AffineTransform2D.java [UTF-8] Wed Mar 30 11:25:06 2016
@@ -312,7 +312,7 @@ public class AffineTransform2D extends I
final AffineTransform2D work = new AffineTransform2D(
((ExtendedPrecisionMatrix) Matrices.inverse(matrix)).getExtendedElements());
work.inverse = this;
- inverse = work; // Set only on success.
+ inverse = work; // Set only on success.
}
}
}
@@ -332,7 +332,7 @@ public class AffineTransform2D extends I
*/
@Override
public boolean equals(final Object object, final ComparisonMode mode) {
- if (object == this) { // Slight optimization
+ if (object == this) { // Slight optimization
return true;
}
if (mode == ComparisonMode.STRICT) {
Modified: sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/AbstractProvider.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/AbstractProvider.java?rev=1737101&r1=1737100&r2=1737101&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/AbstractProvider.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/AbstractProvider.java [UTF-8] Wed Mar 30 11:25:06 2016
@@ -214,4 +214,14 @@ public abstract class AbstractProvider e
public int getEllipsoidsMask() {
return 0;
}
+
+ /**
+ * Returns {@code true} if the inverse of this operation method is the same operation method with some parameter
+ * values changed (typically with sign inverted). The default implementation returns {@code false}.
+ *
+ * @return {@code true} if the inverse of this operation method can be described by the same operation method.
+ */
+ public boolean isInvertible() {
+ return false;
+ }
}
Modified: sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Affine.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Affine.java?rev=1737101&r1=1737100&r2=1737101&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Affine.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Affine.java [UTF-8] Wed Mar 30 11:25:06 2016
@@ -179,6 +179,16 @@ public final class Affine extends Abstra
*/
/**
+ * The inverse of this operation can be described by the same operation with different parameter values.
+ *
+ * @return {@code true} for all {@code Affine}.
+ */
+ @Override
+ public final boolean isInvertible() {
+ return true;
+ }
+
+ /**
* Creates a projective transform from the specified group of parameter values.
*
* @param factory Ignored (can be null).