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 2015/05/15 21:42:43 UTC
svn commit: r1679636 [1/5] - in /sis/trunk: ./
application/sis-console/src/main/java/org/apache/sis/console/
application/sis-console/src/test/java/org/apache/sis/console/
core/sis-feature/src/main/java/org/apache/sis/feature/
core/sis-metadata/src/main...
Author: desruisseaux
Date: Fri May 15 19:42:41 2015
New Revision: 1679636
URL: http://svn.apache.org/r1679636
Log:
Merge from the JDK6 branch.
This complete WKT formatting (not yet parsing).
Added:
sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/WKTKeywords.java
- copied unchanged from r1679633, sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/WKTKeywords.java
sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/internal/metadata/WKTKeywordsTest.java
- copied unchanged from r1679633, sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/internal/metadata/WKTKeywordsTest.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/GeodeticObjectFactory.java
- copied unchanged from r1679633, sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/GeodeticObjectFactory.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/MismatchedDatumException.java
- copied unchanged from r1679633, sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/MismatchedDatumException.java
sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultDerivedCRSTest.java
- copied unchanged from r1679633, sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultDerivedCRSTest.java
sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/DefaultConversionTest.java
- copied unchanged from r1679633, sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/DefaultConversionTest.java
sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/DefaultTransformationTest.java
- copied unchanged from r1679633, sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/DefaultTransformationTest.java
sis/trunk/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/SQLShapefileNotFoundException.java
- copied unchanged from r1679633, sis/branches/JDK6/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/SQLShapefileNotFoundException.java
sis/trunk/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/SQLDbaseFileNotFoundException.java
- copied unchanged from r1679633, sis/branches/JDK6/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/SQLDbaseFileNotFoundException.java
sis/trunk/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/SQLInvalidDbaseFileFormatException.java
- copied unchanged from r1679633, sis/branches/JDK6/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/SQLInvalidDbaseFileFormatException.java
sis/trunk/storage/sis-shapefile/src/main/java/org/apache/sis/storage/shapefile/DataStoreQueryException.java
- copied unchanged from r1679633, sis/branches/JDK6/storage/sis-shapefile/src/main/java/org/apache/sis/storage/shapefile/DataStoreQueryException.java
sis/trunk/storage/sis-shapefile/src/main/java/org/apache/sis/storage/shapefile/DataStoreQueryResultException.java
- copied unchanged from r1679633, sis/branches/JDK6/storage/sis-shapefile/src/main/java/org/apache/sis/storage/shapefile/DataStoreQueryResultException.java
sis/trunk/storage/sis-shapefile/src/main/java/org/apache/sis/storage/shapefile/DbaseFileNotFoundException.java
- copied unchanged from r1679633, sis/branches/JDK6/storage/sis-shapefile/src/main/java/org/apache/sis/storage/shapefile/DbaseFileNotFoundException.java
sis/trunk/storage/sis-shapefile/src/main/java/org/apache/sis/storage/shapefile/InvalidDbaseFileFormatException.java
- copied unchanged from r1679633, sis/branches/JDK6/storage/sis-shapefile/src/main/java/org/apache/sis/storage/shapefile/InvalidDbaseFileFormatException.java
sis/trunk/storage/sis-shapefile/src/main/java/org/apache/sis/storage/shapefile/InvalidShapefileFormatException.java
- copied unchanged from r1679633, sis/branches/JDK6/storage/sis-shapefile/src/main/java/org/apache/sis/storage/shapefile/InvalidShapefileFormatException.java
sis/trunk/storage/sis-shapefile/src/main/java/org/apache/sis/storage/shapefile/ShapefileNotFoundException.java
- copied unchanged from r1679633, sis/branches/JDK6/storage/sis-shapefile/src/main/java/org/apache/sis/storage/shapefile/ShapefileNotFoundException.java
sis/trunk/storage/sis-storage/src/main/java/org/apache/sis/storage/DataStoreClosedException.java
- copied unchanged from r1679633, sis/branches/JDK6/storage/sis-storage/src/main/java/org/apache/sis/storage/DataStoreClosedException.java
Removed:
sis/trunk/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/InvalidShapefileFormatException.java
sis/trunk/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/ShapefileNotFoundException.java
sis/trunk/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/DbaseFileNotFoundException.java
sis/trunk/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/InvalidDbaseFileFormatException.java
Modified:
sis/trunk/ (props changed)
sis/trunk/application/sis-console/src/main/java/org/apache/sis/console/AboutSC.java
sis/trunk/application/sis-console/src/test/java/org/apache/sis/console/AboutSCTest.java
sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/CharacteristicTypeMap.java
sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Convention.java
sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/FormattableObject.java
sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Formatter.java
sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/WKTFormat.java
sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/package-info.java
sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ImmutableIdentifier.java
sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultGeographicBoundingBox.java
sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/metadata/SpecialCasesTest.java
sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/extent/DefaultGeographicBoundingBoxTest.java
sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/test/suite/MetadataTestSuite.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/geometry/AbstractEnvelope.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/geometry/GeneralEnvelope.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/OperationMethods.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/ReferencingUtilities.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/ServicesForMetadata.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/j2d/ParameterizedAffine.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/LongitudeRotation.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/AbstractParameterDescriptor.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterValue.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/TensorValues.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/AbstractIdentifiedObject.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/AbstractReferenceSystem.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/Builder.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/CRS.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/AbstractCRS.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/AbstractDerivedCRS.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultCompoundCRS.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultDerivedCRS.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultEngineeringCRS.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultGeocentricCRS.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultGeodeticCRS.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultGeographicCRS.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultImageCRS.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultProjectedCRS.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultTemporalCRS.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultVerticalCRS.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/AbstractCS.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/CoordinateSystems.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultCartesianCS.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultCoordinateSystemAxis.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultEllipsoidalCS.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultSphericalCS.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultVerticalCS.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DirectionAlongMeridian.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/BursaWolfParameters.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultEllipsoid.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultEngineeringDatum.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultGeodeticDatum.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultImageDatum.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultPrimeMeridian.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultTemporalDatum.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultVerticalDatum.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/AbstractCoordinateOperation.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/AbstractSingleOperation.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultConcatenatedOperation.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultConicProjection.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultConversion.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultCylindricalProjection.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultFormula.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultOperationMethod.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultPlanarProjection.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultProjection.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultTransformation.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/SubTypes.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/package-info.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/AbstractMathTransform.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/ConcatenatedTransform.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/ContextualParameters.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/DefaultMathTransformFactory.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/MathTransforms.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/PassThroughTransform.java
sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/geometry/AbstractEnvelopeTest.java
sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/geometry/Envelope2DTest.java
sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/geometry/GeneralEnvelopeTest.java
sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/geometry/SubEnvelopeTest.java
sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/ReferencingUtilitiesTest.java
sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/ServicesForMetadataTest.java
sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/parameter/DefaultParameterDescriptorTest.java
sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/parameter/DefaultParameterValueTest.java
sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/parameter/UnmodifiableParameterValueTest.java
sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/AbstractReferenceSystemTest.java
sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/CRSTest.java
sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/GeodeticObjectBuilder.java
sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/StandardDefinitionsTest.java
sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultCompoundCRSTest.java
sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultGeographicCRSTest.java
sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultProjectedCRSTest.java
sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/HardCodedCRS.java
sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/AbstractCSTest.java
sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/CoordinateSystemsTest.java
sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultCoordinateSystemAxisTest.java
sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DefaultEllipsoidalCSTest.java
sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/cs/DirectionAlongMeridianTest.java
sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/HardCodedDatum.java
sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/AbstractSingleOperationTest.java
sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/DefaultOperationMethodTest.java
sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/builder/LinearTransformBuilderTest.java
sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/matrix/MatrixTestCase.java
sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/ContextualParametersTest.java
sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/MathTransformsTest.java
sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/TransferFunctionTest.java
sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/test/ReferencingAssert.java
sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/test/integration/ReferencingInMetadataTest.java
sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/test/suite/ReferencingTestSuite.java
sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/TypeRegistration.java
sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/system/DefaultFactories.java
sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/system/Semaphores.java
sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/util/AbstractMap.java
sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/Classes.java
sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/ObjectConverters.java
sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/collection/Containers.java
sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java
sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.properties
sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties
sis/trunk/core/sis-utility/src/main/java/org/apache/sis/xml/XML.java
sis/trunk/core/sis-utility/src/test/java/org/apache/sis/internal/util/AbstractMapTest.java
sis/trunk/core/sis-utility/src/test/java/org/apache/sis/internal/util/DoubleDoubleTest.java
sis/trunk/core/sis-utility/src/test/java/org/apache/sis/math/DecimalFunctionsTest.java
sis/trunk/core/sis-utility/src/test/java/org/apache/sis/math/MathFunctionsTest.java
sis/trunk/core/sis-utility/src/test/java/org/apache/sis/math/StatisticsTest.java
sis/trunk/core/sis-utility/src/test/java/org/apache/sis/test/TestCase.java
sis/trunk/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/ShapefileByteReader.java
sis/trunk/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/AbstractDbase3ByteReader.java
sis/trunk/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/DBFDriver.java
sis/trunk/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/MappedByteReader.java
sis/trunk/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/connection/DBFConnection.java
sis/trunk/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/resultset/DBFRecordBasedResultSet.java
sis/trunk/storage/sis-shapefile/src/main/java/org/apache/sis/storage/shapefile/InputFeatureStream.java
sis/trunk/storage/sis-shapefile/src/main/java/org/apache/sis/storage/shapefile/ShapeFile.java
sis/trunk/storage/sis-shapefile/src/main/resources/org/apache/sis/internal/shapefile/jdbc/resultset/DBFRecordBasedResultSet.properties
sis/trunk/storage/sis-shapefile/src/main/resources/org/apache/sis/internal/shapefile/jdbc/resultset/DBFRecordBasedResultSet_fr.properties
sis/trunk/storage/sis-shapefile/src/test/java/org/apache/sis/storage/shapefile/ShapeFileTest.java
Propchange: sis/trunk/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri May 15 19:42:41 2015
@@ -1,4 +1,4 @@
/sis/branches/Android:1430670-1480699
-/sis/branches/JDK6:1394364-1677828
-/sis/branches/JDK7:1394913-1677827
-/sis/branches/JDK8:1584960-1677787
+/sis/branches/JDK6:1394364-1679633
+/sis/branches/JDK7:1394913-1679630
+/sis/branches/JDK8:1584960-1679629
Modified: sis/trunk/application/sis-console/src/main/java/org/apache/sis/console/AboutSC.java
URL: http://svn.apache.org/viewvc/sis/trunk/application/sis-console/src/main/java/org/apache/sis/console/AboutSC.java?rev=1679636&r1=1679635&r2=1679636&view=diff
==============================================================================
--- sis/trunk/application/sis-console/src/main/java/org/apache/sis/console/AboutSC.java [UTF-8] (original)
+++ sis/trunk/application/sis-console/src/main/java/org/apache/sis/console/AboutSC.java [UTF-8] Fri May 15 19:42:41 2015
@@ -98,7 +98,7 @@ final class AboutSC extends SubCommand {
*
* Tutorial: http://docs.oracle.com/javase/tutorial/jmx/remote/custom.html
*/
- final String path = toRemoveURL(files.get(0));
+ final String path = toRemoteURL(files.get(0));
try {
final JMXServiceURL url = new JMXServiceURL(path);
final JMXConnector jmxc = JMXConnectorFactory.connect(url);
@@ -124,7 +124,7 @@ final class AboutSC extends SubCommand {
* Creates a {@code "service:jmx:rmi:///jndi/rmi://host:port/jmxrmi"} URL for the given host name.
* The host name can optionally be followed by a port number.
*/
- static String toRemoveURL(final String host) {
+ static String toRemoteURL(final String host) {
final StringBuilder buffer = new StringBuilder(60).append("service:jmx:rmi:///jndi/rmi://")
.append(host, host.regionMatches(true, 0, "localhost", 0, 9) ? 9 : 0, host.length());
if (host.lastIndexOf(':') < 0) {
Modified: sis/trunk/application/sis-console/src/test/java/org/apache/sis/console/AboutSCTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/application/sis-console/src/test/java/org/apache/sis/console/AboutSCTest.java?rev=1679636&r1=1679635&r2=1679636&view=diff
==============================================================================
--- sis/trunk/application/sis-console/src/test/java/org/apache/sis/console/AboutSCTest.java [UTF-8] (original)
+++ sis/trunk/application/sis-console/src/test/java/org/apache/sis/console/AboutSCTest.java [UTF-8] Fri May 15 19:42:41 2015
@@ -95,15 +95,15 @@ public final strictfp class AboutSCTest
}
/**
- * Tests the {@link AboutSC#toRemoveURL(String)} method.
+ * Tests the {@link AboutSC#toRemoteURL(String)} method.
*/
@Test
- public void testToRemoveURL() {
- assertEquals("service:jmx:rmi:///jndi/rmi://myhost:9999/jmxrmi", AboutSC.toRemoveURL("myhost:9999"));
- assertEquals("service:jmx:rmi:///jndi/rmi://myhost:1099/jmxrmi", AboutSC.toRemoveURL("myhost"));
- assertEquals("service:jmx:rmi:///jndi/rmi://:9999/jmxrmi", AboutSC.toRemoveURL("localhost:9999"));
- assertEquals("service:jmx:rmi:///jndi/rmi://:1099/jmxrmi", AboutSC.toRemoveURL("localhost"));
- assertEquals("service:jmx:rmi:///jndi/rmi://:9999/jmxrmi", AboutSC.toRemoveURL(":9999"));
- assertEquals("service:jmx:rmi:///jndi/rmi://localhosx:1099/jmxrmi", AboutSC.toRemoveURL("localhosx"));
+ public void testToRemoteURL() {
+ assertEquals("service:jmx:rmi:///jndi/rmi://myhost:9999/jmxrmi", AboutSC.toRemoteURL("myhost:9999"));
+ assertEquals("service:jmx:rmi:///jndi/rmi://myhost:1099/jmxrmi", AboutSC.toRemoteURL("myhost"));
+ assertEquals("service:jmx:rmi:///jndi/rmi://:9999/jmxrmi", AboutSC.toRemoteURL("localhost:9999"));
+ assertEquals("service:jmx:rmi:///jndi/rmi://:1099/jmxrmi", AboutSC.toRemoteURL("localhost"));
+ assertEquals("service:jmx:rmi:///jndi/rmi://:9999/jmxrmi", AboutSC.toRemoteURL(":9999"));
+ assertEquals("service:jmx:rmi:///jndi/rmi://localhosx:1099/jmxrmi", AboutSC.toRemoteURL("localhosx"));
}
}
Modified: sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/CharacteristicTypeMap.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/CharacteristicTypeMap.java?rev=1679636&r1=1679635&r2=1679636&view=diff
==============================================================================
--- sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/CharacteristicTypeMap.java [UTF-8] (original)
+++ sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/CharacteristicTypeMap.java [UTF-8] Fri May 15 19:42:41 2015
@@ -121,6 +121,14 @@ final class CharacteristicTypeMap extend
}
/**
+ * Returns {@code true} if there is no attribute characteristics.
+ */
+ @Override
+ public boolean isEmpty() {
+ return characterizedBy.length == 0;
+ }
+
+ /**
* Returns the number of attribute characteristics.
*/
@Override
Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Convention.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Convention.java?rev=1679636&r1=1679635&r2=1679636&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Convention.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Convention.java [UTF-8] Fri May 15 19:42:41 2015
@@ -63,6 +63,8 @@ public enum Convention {
*
* <p>This is the default convention used by {@link FormattableObject#toWKT()}
* and for new {@link WKTFormat} instances.</p>
+ *
+ * @see <a href="http://docs.opengeospatial.org/is/12-063r5/12-063r5.html">WKT 2 specification</a>
*/
WKT2(false),
@@ -114,6 +116,8 @@ public enum Convention {
* <tr><td>Geocentric Y</td> <td>Easting</td> <td>Toward 90°E longitude</td></tr>
* <tr><td>Geocentric Z</td> <td>Northing</td> <td>Toward north pole</td></tr>
* </table>
+ *
+ * @see <a href="http://www.geoapi.org/3.0/javadoc/org/opengis/referencing/doc-files/WKT.html">Legacy WKT 1</a>
*/
WKT1(true),
Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/FormattableObject.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/FormattableObject.java?rev=1679636&r1=1679635&r2=1679636&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/FormattableObject.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/FormattableObject.java [UTF-8] Fri May 15 19:42:41 2015
@@ -35,7 +35,7 @@ import org.apache.sis.internal.util.X364
* representation of this object:</p>
*
* <ul>
- * <li>{@link #toWKT()} returns a strictly compliant WKT or throws {@link UnformattableObjectException}
+ * <li>{@link #toWKT()} tries to return a strictly compliant WKT or throws {@link UnformattableObjectException}
* if this object contains elements not defined by the ISO 19162 standard.</li>
* <li>{@link #toString()} returns a WKT with some redundant information omitted and some constraints relaxed.
* This method never throw {@code UnformattableObjectException};
@@ -59,8 +59,11 @@ import org.apache.sis.internal.util.X364
*
* @author Martin Desruisseaux (IRD, Geomatys)
* @since 0.4
- * @version 0.4
+ * @version 0.6
* @module
+ *
+ * @see <a href="http://docs.opengeospatial.org/is/12-063r5/12-063r5.html">WKT 2 specification</a>
+ * @see <a href="http://www.geoapi.org/3.0/javadoc/org/opengis/referencing/doc-files/WKT.html">Legacy WKT 1</a>
*/
@XmlTransient
public abstract class FormattableObject {
@@ -108,7 +111,8 @@ public abstract class FormattableObject
* If this object can not be represented in a standard way, then this method fallbacks on a non-standard
* representation.
*
- * <p>By default this method formats this object according the {@link Convention#WKT2_SIMPLIFIED} rules.</p>
+ * <p>By default this method formats this object according the {@link Convention#WKT2_SIMPLIFIED} rules,
+ * except that Unicode characters are kept <i>as-is</i> (they are not converted to ASCII).</p>
*
* @return The Well Known Text (WKT) or an alternative representation of this object.
*/
@@ -119,6 +123,7 @@ public abstract class FormattableObject
/**
* Returns a <cite>Well Known Text</cite> (WKT) for this object using the specified convention.
+ * Unicode characters are kept <i>as-is</i> (they are not converted to ASCII).
*
* @param convention The WKT convention to use.
* @return The Well Known Text (WKT) or a pseudo-WKT representation of this object.
@@ -159,7 +164,7 @@ public abstract class FormattableObject
* @return The Well Known Text (WKT) or a pseudo-WKT representation of this object.
* @throws UnformattableObjectException If {@code strict} is {@code true} and this object can not be formatted.
*/
- final String formatWKT(final Convention convention, final boolean colorize, final boolean strict)
+ private String formatWKT(final Convention convention, final boolean colorize, final boolean strict)
throws UnformattableObjectException
{
Formatter formatter = FORMATTER.getAndSet(null);
@@ -168,6 +173,9 @@ public abstract class FormattableObject
}
formatter.configure(convention, null, colorize ? Colors.DEFAULT : null,
convention.majorVersion() == 1, WKTFormat.DEFAULT_INDENTATION);
+ if (!strict) {
+ formatter.encoding = CharEncoding.UNICODE;
+ }
final String wkt;
try {
formatter.append(this);
Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Formatter.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Formatter.java?rev=1679636&r1=1679635&r2=1679636&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Formatter.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Formatter.java [UTF-8] Fri May 15 19:42:41 2015
@@ -67,6 +67,7 @@ import org.apache.sis.util.ArgumentCheck
import org.apache.sis.util.resources.Errors;
import org.apache.sis.internal.util.Citations;
import org.apache.sis.internal.simple.SimpleExtent;
+import org.apache.sis.internal.metadata.WKTKeywords;
import org.apache.sis.internal.metadata.ReferencingServices;
import org.apache.sis.measure.Range;
import org.apache.sis.measure.MeasurementRange;
@@ -92,6 +93,9 @@ import org.apache.sis.metadata.iso.exten
* @since 0.4
* @version 0.6
* @module
+ *
+ * @see <a href="http://docs.opengeospatial.org/is/12-063r5/12-063r5.html">WKT 2 specification</a>
+ * @see <a href="http://www.geoapi.org/3.0/javadoc/org/opengis/referencing/doc-files/WKT.html">Legacy WKT 1</a>
*/
public class Formatter implements Localized {
/**
@@ -671,8 +675,8 @@ public class Formatter implements Locali
* }
*
* For non-internal conventions, all elements other than {@code ID[…]} are formatted
- * only for {@link CoordinateOperation} and {@link ReferenceSystem} types.
- * In the later case, we also require that the CRS is not the base of a derived CRS.
+ * only for {@link CoordinateOperation} and root {@link ReferenceSystem} instances,
+ * with an exception for remarks of {@code ReferenceSystem} embedded inside {@code CoordinateOperation}.
* Those restrictions are our interpretation of the following ISO 19162 requirement:
*
* <blockquote>(…snip…) {@code <scope extent identifier remark>} is a collection of four optional attributes
@@ -686,11 +690,13 @@ public class Formatter implements Locali
isComplement = true;
final boolean showIDs; // Whether to format ID[…] elements.
final boolean filterID; // Whether we shall limit to a single ID[…] element.
- final boolean showOthers; // Whether to format any element other than ID[…].
+ final boolean showOthers; // Whether to format any element other than ID[…] and Remarks[…].
+ final boolean showRemarks; // Whether to format Remarks[…].
if (convention == Convention.INTERNAL) {
- showIDs = true;
- filterID = false;
- showOthers = true;
+ showIDs = true;
+ filterID = false;
+ showOthers = true;
+ showRemarks = true;
} else {
if (convention == Convention.WKT2_SIMPLIFIED) {
showIDs = isRoot;
@@ -698,16 +704,20 @@ public class Formatter implements Locali
showIDs = isRoot || (object instanceof OperationMethod) || (object instanceof GeneralParameterDescriptor);
}
if (convention.majorVersion() == 1) {
- filterID = true;
- showOthers = false;
+ filterID = true;
+ showOthers = false;
+ showRemarks = false;
} else {
filterID = !isRoot;
if (object instanceof CoordinateOperation) {
- showOthers = true;
+ showOthers = true;
+ showRemarks = true;
} else if (object instanceof ReferenceSystem) {
- showOthers = !(getEnclosingElement(1) instanceof ReferenceSystem);
+ showOthers = isRoot;
+ showRemarks = isRoot || (getEnclosingElement(2) instanceof CoordinateOperation);
} else {
- showOthers = false; // Mandated by ISO 19162.
+ showOthers = false; // Mandated by ISO 19162.
+ showRemarks = false;
}
}
}
@@ -716,7 +726,7 @@ public class Formatter implements Locali
}
if (showIDs) {
Collection<ReferenceIdentifier> identifiers = object.getIdentifiers();
- if (identifiers != null) { // Paranoiac check
+ if (identifiers != null) { // Paranoiac check
if (filterID) {
for (final ReferenceIdentifier id : identifiers) {
if (Citations.identifierMatches(authority, id.getAuthority())) {
@@ -734,8 +744,8 @@ public class Formatter implements Locali
}
}
}
- if (showOthers) {
- appendOnNewLine("Remarks", object.getRemarks(), ElementKind.REMARKS);
+ if (showRemarks) {
+ appendOnNewLine(WKTKeywords.Remarks, object.getRemarks(), ElementKind.REMARKS);
}
isComplement = false;
}
@@ -762,10 +772,10 @@ public class Formatter implements Locali
} else {
return;
}
- appendOnNewLine("Anchor", anchor, null);
- appendOnNewLine("Scope", scope, ElementKind.SCOPE);
+ appendOnNewLine(WKTKeywords.Anchor, anchor, null);
+ appendOnNewLine(WKTKeywords.Scope, scope, ElementKind.SCOPE);
if (area != null) {
- appendOnNewLine("Area", area.getDescription(), ElementKind.EXTENT);
+ appendOnNewLine(WKTKeywords.Area, area.getDescription(), ElementKind.EXTENT);
append(Extents.getGeographicBoundingBox(area), BBOX_ACCURACY);
appendVerticalExtent(Extents.getVerticalRange(area));
appendTemporalExtent(Extents.getTimeRange(area));
@@ -788,7 +798,7 @@ public class Formatter implements Locali
*/
public void append(final GeographicBoundingBox bbox, final int fractionDigits) {
if (bbox != null) {
- openElement(isComplement, "BBox");
+ openElement(isComplement, WKTKeywords.BBox);
setColor(ElementKind.EXTENT);
numberFormat.setMinimumFractionDigits(fractionDigits);
numberFormat.setMaximumFractionDigits(fractionDigits);
@@ -823,7 +833,7 @@ public class Formatter implements Locali
maximumFractionDigits = VERTICAL_ACCURACY;
minimumFractionDigits = 0;
}
- openElement(true, "VerticalExtent");
+ openElement(true, WKTKeywords.VerticalExtent);
setColor(ElementKind.EXTENT);
numberFormat.setMinimumFractionDigits(minimumFractionDigits);
numberFormat.setMaximumFractionDigits(maximumFractionDigits);
@@ -863,7 +873,7 @@ public class Formatter implements Locali
((SimpleDateFormat) dateFormat).applyPattern(WKTFormat.SHORT_DATE_PATTERN);
}
}
- openElement(true, "TimeExtent");
+ openElement(true, WKTKeywords.TimeExtent);
setColor(ElementKind.EXTENT);
try {
append(min);
Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/WKTFormat.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/WKTFormat.java?rev=1679636&r1=1679635&r2=1679636&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/WKTFormat.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/WKTFormat.java [UTF-8] Fri May 15 19:42:41 2015
@@ -81,6 +81,9 @@ import org.apache.sis.util.resources.Err
* @since 0.4
* @version 0.6
* @module
+ *
+ * @see <a href="http://docs.opengeospatial.org/is/12-063r5/12-063r5.html">WKT 2 specification</a>
+ * @see <a href="http://www.geoapi.org/3.0/javadoc/org/opengis/referencing/doc-files/WKT.html">Legacy WKT 1</a>
*/
public class WKTFormat extends CompoundFormat<Object> {
/**
Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/package-info.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/package-info.java?rev=1679636&r1=1679635&r2=1679636&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/package-info.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/package-info.java [UTF-8] Fri May 15 19:42:41 2015
@@ -37,7 +37,8 @@
* <div class="section">Referencing WKT</div>
* Referencing WKT is defined using Extended Backus Naur Form (EBNF) in two versions:
* <ul>
- * <li>ISO 19162 defines the current format, also known as “WKT 2”.</li>
+ * <li>ISO 19162 defines the current format, also known as “WKT 2”. The specification is also made
+ * <a href="http://docs.opengeospatial.org/is/12-063r5/12-063r5.html">available online</a> by OGC.</li>
* <li>The previous format — “WKT 1” — was defined in the <a href="http://www.opengeospatial.org/standards/ct">OGC
* document 01-009</a>. This definition is
* <a href="http://www.geoapi.org/3.0/javadoc/org/opengis/referencing/doc-files/WKT.html">shown on GeoAPI</a>.</li>
@@ -61,5 +62,8 @@
* @since 0.4
* @version 0.4
* @module
+ *
+ * @see <a href="http://docs.opengeospatial.org/is/12-063r5/12-063r5.html">WKT 2 specification</a>
+ * @see <a href="http://www.geoapi.org/3.0/javadoc/org/opengis/referencing/doc-files/WKT.html">Legacy WKT 1</a>
*/
package org.apache.sis.io.wkt;
Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ImmutableIdentifier.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ImmutableIdentifier.java?rev=1679636&r1=1679635&r2=1679636&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ImmutableIdentifier.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ImmutableIdentifier.java [UTF-8] Fri May 15 19:42:41 2015
@@ -30,6 +30,7 @@ import org.apache.sis.util.iso.Types;
import org.apache.sis.metadata.iso.citation.Citations;
import org.apache.sis.internal.util.DefinitionURI;
import org.apache.sis.internal.metadata.NameMeaning;
+import org.apache.sis.internal.metadata.WKTKeywords;
import org.apache.sis.io.wkt.FormattableObject;
import org.apache.sis.io.wkt.Formatter;
import org.apache.sis.io.wkt.Convention;
@@ -546,6 +547,8 @@ public class ImmutableIdentifier extends
*
* @param formatter The formatter where to format the inner content of this WKT element.
* @return {@code "Id"} (WKT 2) or {@code "Authority"} (WKT 1).
+ *
+ * @see <a href="http://docs.opengeospatial.org/is/12-063r5/12-063r5.html#33">WKT 2 specification</a>
*/
@Override
protected String formatTo(final Formatter formatter) {
@@ -566,11 +569,11 @@ public class ImmutableIdentifier extends
if (cs != null) {
final Convention convention = formatter.getConvention();
if (convention.majorVersion() == 1) {
- keyword = "Authority";
+ keyword = WKTKeywords.Authority;
formatter.append(cs, ElementKind.IDENTIFIER);
formatter.append(code, ElementKind.IDENTIFIER);
} else {
- keyword = "Id";
+ keyword = WKTKeywords.Id;
formatter.append(cs, ElementKind.IDENTIFIER);
appendCode(formatter, code);
final String version = getVersion();
@@ -653,7 +656,7 @@ public class ImmutableIdentifier extends
@Override
protected String formatTo(final Formatter formatter) {
formatter.append(identifier, ElementKind.CITATION);
- return "Citation";
+ return WKTKeywords.Citation;
}
}
@@ -684,7 +687,7 @@ public class ImmutableIdentifier extends
}
buffer.append(DefinitionURI.SEPARATOR).append(code);
formatter.append(buffer.toString(), null);
- return "URI";
+ return WKTKeywords.URI;
}
}
}
Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultGeographicBoundingBox.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultGeographicBoundingBox.java?rev=1679636&r1=1679635&r2=1679636&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultGeographicBoundingBox.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultGeographicBoundingBox.java [UTF-8] Fri May 15 19:42:41 2015
@@ -602,7 +602,16 @@ public class DefaultGeographicBoundingBo
* In both cases, if either this box or the specified box has {@linkplain Double#NaN NaN} bounds,
* then the corresponding bounds of the result will bet set to NaN.
*
+ * <div class="note"><b>Rational:</b>
+ * this class is stricter about NaN values than other classes like {@link org.apache.sis.geometry.GeneralEnvelope}.
+ * The reason is that computations on {@code GeographicBoundingBox} instances are rare ({@code Envelope} instances
+ * are preferred for this purpose). Usually, {@code GeographicBoundingBox} values come directly from some metadata
+ * structure. Consequently NaN values in {@code GeographicBoundingBox} means <cite>"information is unknown"</cite>
+ * more often than <cite>"not yet calculated"</cite>.</div>
+ *
* @param box The geographic bounding box to add to this box.
+ *
+ * @see org.apache.sis.geometry.GeneralEnvelope#add(Envelope)
*/
public void add(final GeographicBoundingBox box) {
checkWritePermission();
@@ -659,6 +668,7 @@ public class DefaultGeographicBoundingBo
* @throws IllegalArgumentException If the inclusion status is not the same for both boxes.
*
* @see Extents#intersection(GeographicBoundingBox, GeographicBoundingBox)
+ * @see org.apache.sis.geometry.GeneralEnvelope#intersect(Envelope)
*/
public void intersect(final GeographicBoundingBox box) throws IllegalArgumentException {
checkWritePermission();
Modified: sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/metadata/SpecialCasesTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/metadata/SpecialCasesTest.java?rev=1679636&r1=1679635&r2=1679636&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/metadata/SpecialCasesTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/metadata/SpecialCasesTest.java [UTF-8] Fri May 15 19:42:41 2015
@@ -43,11 +43,6 @@ import static org.apache.sis.test.Assert
@DependsOn(PropertyAccessorTest.class)
public final strictfp class SpecialCasesTest extends TestCase {
/**
- * The tolerance factor for strict comparisons of floating point values.
- */
- private static final double STRICT = 0.0;
-
- /**
* The accessor instance to be tested.
*/
private final PropertyAccessor accessor;
Modified: sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/extent/DefaultGeographicBoundingBoxTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/extent/DefaultGeographicBoundingBoxTest.java?rev=1679636&r1=1679635&r2=1679636&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/extent/DefaultGeographicBoundingBoxTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/extent/DefaultGeographicBoundingBoxTest.java [UTF-8] Fri May 15 19:42:41 2015
@@ -38,11 +38,6 @@ import static org.junit.Assert.*;
*/
public final strictfp class DefaultGeographicBoundingBoxTest extends TestCase {
/**
- * The tolerance factor for strict comparisons of floating point values.
- */
- private static final double STRICT = 0.0;
-
- /**
* Asserts that the given geographic bounding box is strictly equals to the given values.
* The {@link GeographicBoundingBox#getInclusion()} is expected to be {@code true}.
*/
Modified: sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/test/suite/MetadataTestSuite.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/test/suite/MetadataTestSuite.java?rev=1679636&r1=1679635&r2=1679636&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/test/suite/MetadataTestSuite.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/test/suite/MetadataTestSuite.java [UTF-8] Fri May 15 19:42:41 2015
@@ -26,10 +26,11 @@ import org.junit.BeforeClass;
*
* @author Martin Desruisseaux (Geomatys)
* @since 0.3
- * @version 0.5
+ * @version 0.6
* @module
*/
@Suite.SuiteClasses({
+ org.apache.sis.internal.metadata.WKTKeywordsTest.class,
org.apache.sis.internal.metadata.NameMeaningTest.class,
org.apache.sis.internal.metadata.MetadataUtilitiesTest.class,
org.apache.sis.internal.metadata.OtherLocalesTest.class,
Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/geometry/AbstractEnvelope.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/geometry/AbstractEnvelope.java?rev=1679636&r1=1679635&r2=1679636&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/geometry/AbstractEnvelope.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/geometry/AbstractEnvelope.java [UTF-8] Fri May 15 19:42:41 2015
@@ -195,7 +195,7 @@ public abstract class AbstractEnvelope i
static CoordinateSystemAxis getAxis(final CoordinateReferenceSystem crs, final int dimension) {
if (crs != null) {
final CoordinateSystem cs = crs.getCoordinateSystem();
- if (cs != null) {
+ if (cs != null) { // Paranoiac check (should never be null).
return cs.getAxis(dimension);
}
}
Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/geometry/GeneralEnvelope.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/geometry/GeneralEnvelope.java?rev=1679636&r1=1679635&r2=1679636&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/geometry/GeneralEnvelope.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/geometry/GeneralEnvelope.java [UTF-8] Fri May 15 19:42:41 2015
@@ -506,7 +506,7 @@ public class GeneralEnvelope extends Arr
* The default implementation moves only the border which is closest to the given point.
*
* @param position The point to add.
- * @throws MismatchedDimensionException if the specified point doesn't have the expected dimension.
+ * @throws MismatchedDimensionException If the given point does not have the expected number of dimensions.
* @throws AssertionError If assertions are enabled and the envelopes have mismatched CRS.
*/
public void add(final DirectPosition position) throws MismatchedDimensionException {
@@ -580,9 +580,10 @@ public class GeneralEnvelope extends Arr
* whatever the original range span the anti-meridian or not.
*
* @param envelope the {@code Envelope} to add to this envelope.
- * @throws MismatchedDimensionException if the specified envelope doesn't
- * have the expected dimension.
+ * @throws MismatchedDimensionException If the given envelope does not have the expected number of dimensions.
* @throws AssertionError If assertions are enabled and the envelopes have mismatched CRS.
+ *
+ * @see org.apache.sis.metadata.iso.extent.DefaultGeographicBoundingBox#add(GeographicBoundingBox)
*/
public void add(final Envelope envelope) throws MismatchedDimensionException {
ensureNonNull("envelope", envelope);
@@ -704,9 +705,10 @@ public class GeneralEnvelope extends Arr
* This method supports envelopes spanning the anti-meridian.
*
* @param envelope the {@code Envelope} to intersect to this envelope.
- * @throws MismatchedDimensionException if the specified envelope doesn't
- * have the expected dimension.
+ * @throws MismatchedDimensionException If the given envelope does not have the expected number of dimensions.
* @throws AssertionError If assertions are enabled and the envelopes have mismatched CRS.
+ *
+ * @see org.apache.sis.metadata.iso.extent.DefaultGeographicBoundingBox#intersect(GeographicBoundingBox)
*/
public void intersect(final Envelope envelope) throws MismatchedDimensionException {
ensureNonNull("envelope", envelope);
Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/OperationMethods.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/OperationMethods.java?rev=1679636&r1=1679635&r2=1679636&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/OperationMethods.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/OperationMethods.java [UTF-8] Fri May 15 19:42:41 2015
@@ -17,10 +17,10 @@
package org.apache.sis.internal.referencing;
import java.util.Collection;
-import org.opengis.util.Record;
import javax.measure.unit.SI;
import javax.measure.unit.Unit;
import javax.measure.quantity.Length;
+import org.opengis.util.Record;
import org.opengis.metadata.quality.Result;
import org.opengis.metadata.quality.PositionalAccuracy;
import org.opengis.metadata.quality.QuantitativeResult;
@@ -41,7 +41,7 @@ import org.apache.sis.measure.Units;
public final class OperationMethods extends Static {
/**
* The key for specifying explicitely the value to be returned by
- * {@link org.apache.sis.referencing.operation.DefaultSingleOperation#getParameterValues()}.
+ * {@link org.apache.sis.referencing.operation.DefaultConversion#getParameterValues()}.
* It is usually not necessary to specify those parameters because they are inferred either from
* the {@link MathTransform}, or specified explicitely in a {@code DefiningConversion}. However
* there is a few cases, for example the Molodenski transform, where none of the above can apply,
@@ -51,6 +51,13 @@ public final class OperationMethods exte
public static final String PARAMETERS_KEY = "parameters";
/**
+ * The key for specifying a {@linkplain org.opengis.referencing.operation.MathTransformFactory}
+ * instance to use for the construction of a geodetic object. This is usually not needed for CRS
+ * construction, except in the special case of a derived CRS created from a defining conversion.
+ */
+ public static final String MT_FACTORY = "mtFactory";
+
+ /**
* Do not allow instantiation of this class.
*/
private OperationMethods() {
@@ -120,12 +127,12 @@ public final class OperationMethods exte
* about the return values chosen.
*/
if (operation instanceof Transformation) {
- if (!accuracies.contains(PositionalAccuracyConstant.DATUM_SHIFT_OMITTED)) {
- if (accuracies.contains(PositionalAccuracyConstant.DATUM_SHIFT_APPLIED)) {
- return PositionalAccuracyConstant.DATUM_SHIFT_ACCURACY;
- }
+ if (accuracies.contains(PositionalAccuracyConstant.DATUM_SHIFT_APPLIED)) {
+ return PositionalAccuracyConstant.DATUM_SHIFT_ACCURACY;
+ }
+ if (accuracies.contains(PositionalAccuracyConstant.DATUM_SHIFT_OMITTED)) {
+ return PositionalAccuracyConstant.UNKNOWN_ACCURACY;
}
- return PositionalAccuracyConstant.UNKNOWN_ACCURACY;
}
/*
* If the coordinate operation is a compound of other coordinate operations, returns the sum of their accuracy,
Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/ReferencingUtilities.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/ReferencingUtilities.java?rev=1679636&r1=1679635&r2=1679636&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/ReferencingUtilities.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/ReferencingUtilities.java [UTF-8] Fri May 15 19:42:41 2015
@@ -121,11 +121,13 @@ public final class ReferencingUtilities
if (cs != null) {
for (int i = cs.getDimension(); --i>=0;) {
final CoordinateSystemAxis axis = cs.getAxis(i);
- final Unit<?> candidate = axis.getUnit();
- if (Units.isAngular(candidate)) {
- unit = candidate.asType(Angle.class);
- if (AxisDirection.EAST.equals(AxisDirections.absolute(axis.getDirection()))) {
- break; // Found the longitude axis.
+ if (axis != null) { // Paranoiac check.
+ final Unit<?> candidate = axis.getUnit();
+ if (Units.isAngular(candidate)) {
+ unit = candidate.asType(Angle.class);
+ if (AxisDirection.EAST.equals(AxisDirections.absolute(axis.getDirection()))) {
+ break; // Found the longitude axis.
+ }
}
}
}
@@ -149,7 +151,7 @@ public final class ReferencingUtilities
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 (candidate != null) {
if (unit == null) {
@@ -165,6 +167,24 @@ public final class ReferencingUtilities
}
/**
+ * Returns the number of dimensions of the given CRS, or 0 if {@code null}.
+ *
+ * @param crs The CRS from which to get the number of dimensions, or {@code null}.
+ * @return The number of dimensions, or 0 if the given CRS or its coordinate system is null.
+ *
+ * @since 0.6
+ */
+ public static int getDimension(final CoordinateReferenceSystem crs) {
+ if (crs != null) {
+ final CoordinateSystem cs = crs.getCoordinateSystem();
+ if (cs != null) { // Paranoiac check.
+ return cs.getDimension();
+ }
+ }
+ return 0;
+ }
+
+ /**
* Copies all {@link SingleCRS} components from the given source to the given collection.
* For each {@link CompoundCRS} element found in the iteration, this method replaces the
* {@code CompoundCRS} by its {@linkplain CompoundCRS#getComponents() components}, which
Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/ServicesForMetadata.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/ServicesForMetadata.java?rev=1679636&r1=1679635&r2=1679636&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/ServicesForMetadata.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/ServicesForMetadata.java [UTF-8] Fri May 15 19:42:41 2015
@@ -16,6 +16,7 @@
*/
package org.apache.sis.internal.referencing;
+import org.apache.sis.internal.metadata.WKTKeywords;
import java.util.Iterator;
import java.util.Collection;
@@ -128,7 +129,7 @@ public final class ServicesForMetadata e
@Override
protected String formatTo(final Formatter formatter) {
WKTUtilities.appendParamMT(parameters, formatter);
- return "Param_MT";
+ return WKTKeywords.Param_MT;
}
};
}
Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/j2d/ParameterizedAffine.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/j2d/ParameterizedAffine.java?rev=1679636&r1=1679635&r2=1679636&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/j2d/ParameterizedAffine.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/j2d/ParameterizedAffine.java [UTF-8] Fri May 15 19:42:41 2015
@@ -106,7 +106,7 @@ public final class ParameterizedAffine e
*/
@Override
public ParameterDescriptorGroup getParameterDescriptors() {
- return isDefinitive || Semaphores.query(Semaphores.PROJCS) // See comment in getParameterValues().
+ return isDefinitive || Semaphores.query(Semaphores.ENCLOSED_IN_OPERATION) // See comment in getParameterValues().
? parameters.getDescriptor() : super.getParameterDescriptors();
}
@@ -114,9 +114,9 @@ public final class ParameterizedAffine e
* Returns the parameter values for this map projection.
*
* <p><b>Hack:</b> this method normally returns the matrix parameters in case of doubt. However if
- * {@link Semaphores#PROJCS} is set, then this method returns the map projection parameters even
- * if they are not a complete description of this math transform. This internal hack shall be used
- * only by {@link org.apache.sis.referencing.operation.DefaultSingleOperation}.</p>
+ * {@link Semaphores#ENCLOSED_IN_OPERATION} is set, then this method returns the map projection parameters
+ * even if they are not a complete description of this math transform. This internal hack shall be used
+ * only by {@link org.apache.sis.referencing.operation.AbstractCoordinateOperation}.</p>
*
* <p><b>Use case of above hack:</b> consider an "Equidistant Cylindrical (Spherical)" map projection
* from a {@code GeographiCRS} base using (latitude, longitude) axis order. We need to concatenate an
@@ -134,14 +134,16 @@ public final class ParameterizedAffine e
* has been applied.</li>
* </ul>
*
- * The {@code Semaphores.PROJCS} flag is SIS internal mechanism for distinguish the two above-cited cases.
+ * The {@code Semaphores.ENCLOSED_IN_OPERATION} flag is SIS internal mechanism for distinguish the two above-cited
+ * cases.
*
* @return The map projection parameters if they are an accurate description of this transform,
* or the generic affine parameters in case of doubt.
*/
@Override
public ParameterValueGroup getParameterValues() {
- return isDefinitive || Semaphores.query(Semaphores.PROJCS) ? parameters : super.getParameterValues();
+ return isDefinitive || Semaphores.query(Semaphores.ENCLOSED_IN_OPERATION)
+ ? parameters : super.getParameterValues();
}
/**
Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/LongitudeRotation.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/LongitudeRotation.java?rev=1679636&r1=1679635&r2=1679636&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/LongitudeRotation.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/LongitudeRotation.java [UTF-8] Fri May 15 19:42:41 2015
@@ -20,7 +20,7 @@ import org.opengis.parameter.ParameterVa
import org.opengis.parameter.ParameterDescriptor;
import org.opengis.parameter.ParameterDescriptorGroup;
import org.opengis.parameter.ParameterNotFoundException;
-import org.opengis.referencing.operation.Conversion;
+import org.opengis.referencing.operation.Transformation;
import org.opengis.referencing.operation.MathTransform;
import org.opengis.referencing.operation.MathTransformFactory;
import org.apache.sis.internal.referencing.j2d.AffineTransform2D;
@@ -88,8 +88,8 @@ public final class LongitudeRotation ext
* @return Interface implemented by all coordinate operations that use this method.
*/
@Override
- public Class<Conversion> getOperationType() {
- return Conversion.class;
+ public Class<Transformation> getOperationType() {
+ return Transformation.class;
}
/**
Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/AbstractParameterDescriptor.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/AbstractParameterDescriptor.java?rev=1679636&r1=1679635&r2=1679636&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/AbstractParameterDescriptor.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/AbstractParameterDescriptor.java [UTF-8] Fri May 15 19:42:41 2015
@@ -23,6 +23,7 @@ import org.opengis.parameter.ParameterDe
import org.opengis.parameter.ParameterDescriptorGroup;
import org.opengis.parameter.GeneralParameterDescriptor;
import org.apache.sis.referencing.AbstractIdentifiedObject;
+import org.apache.sis.internal.metadata.WKTKeywords;
import org.apache.sis.io.wkt.FormattableObject;
import org.apache.sis.io.wkt.Formatter;
import org.apache.sis.util.resources.Errors;
@@ -330,7 +331,7 @@ public abstract class AbstractParameterD
formatter.newLine();
formatter.append((FormattableObject) parameter);
}
- return "ParameterGroup";
+ return WKTKeywords.ParameterGroup;
} else if (this instanceof ParameterDescriptor<?>) {
final Object defaultValue = ((ParameterDescriptor<?>) this).getDefaultValue();
if (defaultValue != null) {
@@ -343,6 +344,6 @@ public abstract class AbstractParameterD
}
}
}
- return "Parameter";
+ return WKTKeywords.Parameter;
}
}
Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterValue.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterValue.java?rev=1679636&r1=1679635&r2=1679636&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterValue.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterValue.java [UTF-8] Fri May 15 19:42:41 2015
@@ -34,6 +34,7 @@ import org.apache.sis.io.wkt.Formatter;
import org.apache.sis.io.wkt.Convention;
import org.apache.sis.io.wkt.ElementKind;
import org.apache.sis.internal.referencing.WKTUtilities;
+import org.apache.sis.internal.metadata.WKTKeywords;
import org.apache.sis.internal.util.Numerics;
import org.apache.sis.util.Numbers;
import org.apache.sis.util.ComparisonMode;
@@ -819,7 +820,9 @@ public class DefaultParameterValue<T> ex
* Instead, the unit was inherited from the enclosing element.</div>
*
* @param formatter The formatter where to format the inner content of this WKT element.
- * @return {@code "Parameter"}.
+ * @return {@code "Parameter"} or {@code "ParameterFile"}.
+ *
+ * @see <a href="http://docs.opengeospatial.org/is/12-063r5/12-063r5.html#119">WKT 2 specification</a>
*/
@Override
protected String formatTo(final Formatter formatter) {
@@ -849,7 +852,7 @@ public class DefaultParameterValue<T> ex
final T value = getValue(); // Gives to users a chance to override this property.
if (!isWKT1 && (unit == null) && (value instanceof URI || value instanceof URL || value instanceof File)) {
formatter.append(value.toString(), null);
- return "ParameterFile";
+ return WKTKeywords.ParameterFile;
}
formatter.appendAny(value);
}
@@ -863,6 +866,6 @@ public class DefaultParameterValue<T> ex
formatter.append(unit);
// ID will be added by the Formatter itself.
}
- return "Parameter";
+ return WKTKeywords.Parameter;
}
}
Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/TensorValues.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/TensorValues.java?rev=1679636&r1=1679635&r2=1679636&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/TensorValues.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/TensorValues.java [UTF-8] Fri May 15 19:42:41 2015
@@ -33,6 +33,7 @@ import org.opengis.parameter.ParameterNo
import org.apache.sis.referencing.IdentifiedObjects;
import org.apache.sis.referencing.operation.matrix.Matrices;
import org.apache.sis.internal.referencing.WKTUtilities;
+import org.apache.sis.internal.metadata.WKTKeywords;
import org.apache.sis.internal.util.Numerics;
import org.apache.sis.internal.util.UnmodifiableArrayList;
import org.apache.sis.io.wkt.Formatter;
@@ -465,6 +466,6 @@ final class TensorValues<E> extends Abst
@Override
protected String formatTo(final Formatter formatter) {
WKTUtilities.appendParamMT(this, formatter);
- return "ParameterGroup";
+ return WKTKeywords.ParameterGroup;
}
}
Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/AbstractIdentifiedObject.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/AbstractIdentifiedObject.java?rev=1679636&r1=1679635&r2=1679636&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/AbstractIdentifiedObject.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/AbstractIdentifiedObject.java [UTF-8] Fri May 15 19:42:41 2015
@@ -1034,6 +1034,8 @@ public class AbstractIdentifiedObject ex
* @param formatter The formatter where to format the inner content of this WKT element.
* @return The {@linkplain org.apache.sis.io.wkt.KeywordCase#CAMEL_CASE CamelCase} keyword
* for the WKT element, or {@code null} if unknown.
+ *
+ * @see <a href="http://docs.opengeospatial.org/is/12-063r5/12-063r5.html#21">WKT 2 specification</a>
*/
@Override
protected String formatTo(final Formatter formatter) {
Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/AbstractReferenceSystem.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/AbstractReferenceSystem.java?rev=1679636&r1=1679635&r2=1679636&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/AbstractReferenceSystem.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/AbstractReferenceSystem.java [UTF-8] Fri May 15 19:42:41 2015
@@ -119,7 +119,7 @@ public class AbstractReferenceSystem ext
* <tr>
* <td>{@value org.opengis.referencing.ReferenceSystem#SCOPE_KEY}</td>
* <td>{@link String} or {@link InternationalString}</td>
- * <td>{@link #getScope}</td>
+ * <td>{@link #getScope()}</td>
* </tr>
* <tr>
* <th colspan="3" class="hsep">Defined in parent class (reminder)</th>
Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/Builder.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/Builder.java?rev=1679636&r1=1679635&r2=1679636&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/Builder.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/Builder.java [UTF-8] Fri May 15 19:42:41 2015
@@ -331,7 +331,8 @@ public abstract class Builder<B extends
return false;
}
if (properties.get(IdentifiedObject.NAME_KEY) != null) {
- throw new IllegalStateException(Errors.format(Errors.Keys.ValueAlreadyDefined_1, key));
+ throw new IllegalStateException(Errors.getResources(properties)
+ .getString(Errors.Keys.ValueAlreadyDefined_1, key));
}
properties.put(key, value);
}
Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/CRS.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/CRS.java?rev=1679636&r1=1679635&r2=1679636&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/CRS.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/CRS.java [UTF-8] Fri May 15 19:42:41 2015
@@ -433,15 +433,14 @@ public final class CRS extends Static {
*
* <ul>
* <li>If the given {@code crs} is {@code null}, then this method returns {@code null}.</li>
- * <li>Otherwise if {@code lower} is 0 and {@code upper} if the number of CRS dimensions,
+ * <li>Otherwise if {@code lower} is 0 and {@code upper} is the number of CRS dimensions,
* then this method returns the given CRS unchanged.</li>
* <li>Otherwise if the given CRS is an instance of {@link CompoundCRS}, then this method
* searches for a {@linkplain CompoundCRS#getComponents() component} where:
* <ul>
- * <li>The {@linkplain CoordinateSystem#getDimension() number of dimensions} is
- * equals to {@code upper - lower};</li>
- * <li>The sum of the number of dimensions of all previous CRS is equals to
- * {@code lower}.</li>
+ * <li>The {@linkplain org.apache.sis.referencing.cs.AbstractCS#getDimension() number of dimensions}
+ * is equals to {@code upper - lower};</li>
+ * <li>The sum of the number of dimensions of all previous CRS is equals to {@code lower}.</li>
* </ul>
* If such component is found, then it is returned.</li>
* <li>Otherwise (i.e. no component match), this method returns {@code null}.</li>
@@ -462,28 +461,26 @@ public final class CRS extends Static {
* @see org.apache.sis.geometry.GeneralEnvelope#subEnvelope(int, int)
*/
public static CoordinateReferenceSystem getComponentAt(CoordinateReferenceSystem crs, int lower, int upper) {
- if (crs != null) {
- int dimension = crs.getCoordinateSystem().getDimension();
- ArgumentChecks.ensureValidIndexRange(dimension, lower, upper);
-check: while (lower != 0 || upper != dimension) {
- if (crs instanceof CompoundCRS) {
- final List<CoordinateReferenceSystem> components = ((CompoundCRS) crs).getComponents();
- final int size = components.size();
- for (int i=0; i<size; i++) {
- crs = components.get(i);
- dimension = crs.getCoordinateSystem().getDimension();
- if (lower < dimension) {
- // The requested dimensions may intersect the dimension of this CRS.
- // The outer loop will perform the verification, and eventually go
- // down again in the tree of sub-components.
- continue check;
- }
- lower -= dimension;
- upper -= dimension;
+ int dimension = ReferencingUtilities.getDimension(crs);
+ ArgumentChecks.ensureValidIndexRange(dimension, lower, upper);
+check: while (lower != 0 || upper != dimension) {
+ if (crs instanceof CompoundCRS) {
+ final List<CoordinateReferenceSystem> components = ((CompoundCRS) crs).getComponents();
+ final int size = components.size();
+ for (int i=0; i<size; i++) {
+ crs = components.get(i);
+ dimension = crs.getCoordinateSystem().getDimension();
+ if (lower < dimension) {
+ // The requested dimensions may intersect the dimension of this CRS.
+ // The outer loop will perform the verification, and eventually go
+ // down again in the tree of sub-components.
+ continue check;
}
+ lower -= dimension;
+ upper -= dimension;
}
- return null;
}
+ return null;
}
return crs;
}
Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/AbstractCRS.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/AbstractCRS.java?rev=1679636&r1=1679635&r2=1679636&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/AbstractCRS.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/AbstractCRS.java [UTF-8] Fri May 15 19:42:41 2015
@@ -456,10 +456,13 @@ public class AbstractCRS extends Abstrac
* </ul>
*
* @return {@inheritDoc}
+ *
+ * @see <a href="http://docs.opengeospatial.org/is/12-063r5/12-063r5.html">WKT 2 specification</a>
+ * @see <a href="http://www.geoapi.org/3.0/javadoc/org/opengis/referencing/doc-files/WKT.html">Legacy WKT 1</a>
*/
@Override
protected String formatTo(final Formatter formatter) {
- final String keyword = super.formatTo(formatter);
+ final String keyword = super.formatTo(formatter);
formatter.newLine();
formatter.append(toFormattable(getDatum()));
formatter.newLine();
Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/AbstractDerivedCRS.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/AbstractDerivedCRS.java?rev=1679636&r1=1679635&r2=1679636&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/AbstractDerivedCRS.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/AbstractDerivedCRS.java [UTF-8] Fri May 15 19:42:41 2015
@@ -21,15 +21,20 @@ import javax.xml.bind.annotation.XmlType
import javax.xml.bind.annotation.XmlSeeAlso;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
+import org.opengis.util.FactoryException;
import org.opengis.referencing.datum.Datum;
import org.opengis.referencing.crs.SingleCRS;
import org.opengis.referencing.crs.GeneralDerivedCRS;
import org.opengis.referencing.cs.CoordinateSystem;
import org.opengis.referencing.operation.Conversion;
import org.opengis.referencing.operation.MathTransform;
+import org.opengis.referencing.operation.MathTransformFactory;
import org.opengis.geometry.MismatchedDimensionException;
import org.apache.sis.referencing.operation.DefaultConversion;
+import org.apache.sis.internal.referencing.OperationMethods;
+import org.apache.sis.internal.system.DefaultFactories;
import org.apache.sis.internal.system.Semaphores;
+import org.apache.sis.util.resources.Errors;
import org.apache.sis.util.ArgumentChecks;
import org.apache.sis.util.ComparisonMode;
@@ -82,14 +87,13 @@ abstract class AbstractDerivedCRS<C exte
*
* @param properties The properties to be given to the new derived CRS object.
* @param baseCRS Coordinate reference system to base the derived CRS on.
- * @param conversion The conversion from the base CRS to this derived CRS.
+ * @param conversion The defining conversion from a normalized base to a normalized derived CRS.
* @param derivedCS The coordinate system for the derived CRS. The number of axes
* must match the target dimension of the {@code baseToDerived} transform.
* @throws MismatchedDimensionException if the source and target dimension of {@code baseToDerived}
* do not match the dimension of {@code base} and {@code derivedCS} respectively.
*/
AbstractDerivedCRS(final Map<String,?> properties,
- final Class<C> baseType,
final SingleCRS baseCRS,
final Conversion conversion,
final CoordinateSystem derivedCS)
@@ -97,13 +101,13 @@ abstract class AbstractDerivedCRS<C exte
{
super(properties, derivedCS);
ArgumentChecks.ensureNonNull("baseCRS", baseCRS);
- ArgumentChecks.ensureNonNull("conversionFromBase", conversion); // "conversionFromBase" is the name used by subclass constructors.
+ ArgumentChecks.ensureNonNull("conversion", conversion);
final MathTransform baseToDerived = conversion.getMathTransform();
if (baseToDerived != null) {
ArgumentChecks.ensureDimensionMatches("baseCRS", baseToDerived.getSourceDimensions(), baseCRS);
ArgumentChecks.ensureDimensionMatches("derivedCS", baseToDerived.getTargetDimensions(), derivedCS);
}
- conversionFromBase = DefaultConversion.castOrCopy(conversion).specialize(baseType, baseCRS, this);
+ conversionFromBase = createConversionFromBase(properties, baseCRS, conversion);
}
/**
@@ -115,13 +119,46 @@ abstract class AbstractDerivedCRS<C exte
*
* @param crs The coordinate reference system to copy.
*/
- AbstractDerivedCRS(final GeneralDerivedCRS crs, final Class<C> baseType) {
+ AbstractDerivedCRS(final GeneralDerivedCRS crs) {
super(crs);
- conversionFromBase = DefaultConversion.castOrCopy(crs.getConversionFromBase())
- .specialize(baseType, crs.getBaseCRS(), this);
+ conversionFromBase = createConversionFromBase(null, (SingleCRS) crs.getBaseCRS(), crs.getConversionFromBase());
}
/**
+ * Creates the conversion instance to associate with this {@code AbstractDerivedCRS}.
+ *
+ * <p><b>WARNING:</b> this method is invoked at construction time and will invoke indirectly
+ * (through {@link DefaultConversion}) the {@link #getCoordinateSystem()} method on {@code this}.
+ * Consequently this method shall be invoked only after the construction of this {@code AbstractDerivedCRS}
+ * instance is advanced enough for allowing the {@code getCoordinateSystem()} method to execute.
+ * Subclasses may consider to make the {@code getCoordinateSystem()} method final for better guarantees.</p>
+ */
+ private C createConversionFromBase(final Map<String,?> properties, final SingleCRS baseCRS, final Conversion conversion) {
+ MathTransformFactory factory = null;
+ if (properties != null) {
+ factory = (MathTransformFactory) properties.get(OperationMethods.MT_FACTORY);
+ }
+ if (factory == null) {
+ factory = DefaultFactories.forBuildin(MathTransformFactory.class);
+ }
+ try {
+ return DefaultConversion.castOrCopy(conversion).specialize(getConversionType(), baseCRS, this, factory);
+ } catch (FactoryException e) {
+ throw new IllegalArgumentException(Errors.getResources(properties).getString(
+ Errors.Keys.IllegalArgumentValue_2, "conversion", conversion.getName()), e);
+ }
+ }
+
+ /**
+ * Returns the type of conversion associated to this {@code AbstractDerivedCRS}.
+ *
+ * <p><b>WARNING:</b> this method is invoked (indirectly) at construction time.
+ * Consequently it shall return a constant value - this method is not allowed to
+ * depend on the object state.</p>
+ */
+ abstract Class<C> getConversionType();
+
+ /**
* Returns the GeoAPI interface implemented by this class.
*/
@Override
Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultCompoundCRS.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultCompoundCRS.java?rev=1679636&r1=1679635&r2=1679636&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultCompoundCRS.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultCompoundCRS.java [UTF-8] Fri May 15 19:42:41 2015
@@ -33,6 +33,7 @@ import org.apache.sis.referencing.cs.Axe
import org.apache.sis.referencing.cs.DefaultCompoundCS;
import org.apache.sis.referencing.AbstractReferenceSystem;
import org.apache.sis.referencing.IdentifiedObjects;
+import org.apache.sis.internal.metadata.WKTKeywords;
import org.apache.sis.internal.referencing.WKTUtilities;
import org.apache.sis.internal.referencing.ReferencingUtilities;
import org.apache.sis.internal.util.UnmodifiableArrayList;
@@ -75,6 +76,23 @@ import static org.apache.sis.internal.re
* part (e.g. the EPSG identifier) that would otherwise been lost. Users can obtain the list of their
* choice by invoking {@link #getSingleComponents()} or {@link #getComponents()} respectively.
*
+ * <div class="section">Component order</div>
+ * ISO 19162 restricts compound CRS to the following components in that order:
+ * <ul>
+ * <li>A mandatory horizontal CRS (only one of two-dimensional {@code GeographicCRS} or {@code ProjectedCRS} or {@code EngineeringCRS}).</li>
+ * <li>Optionally followed by a {@code VerticalCRS} or a {@code ParametricCRS} (but not both).</li>
+ * <li>Optionally followed by a {@code TemporalCRS}.</li>
+ * </ul>
+ *
+ * SIS currently does not enforce those restrictions. In particular:
+ * <ul>
+ * <li>Components may appear in different order.
+ * <li>{@code VerticalCRS} + {@code TemporalCRS} (without horizontal component) is accepted.</li>
+ * <li>{@code GeocentricCRS} or three-dimensional {@code GeographicCRS} can be combined with {@code TemporalCRS}.</li>
+ * </ul>
+ *
+ * However users are encouraged to follow ISO 19162 restriction for better portability.
+ *
* <div class="section">Immutability and thread safety</div>
* This class is immutable and thus thread-safe if the property <em>values</em> (not necessarily the map itself)
* and all {@link CoordinateReferenceSystem} instances given to the constructor are also immutable.
@@ -164,7 +182,7 @@ public class DefaultCompoundCRS extends
* @param components The sequence of coordinate reference systems making this compound CRS.
*/
public DefaultCompoundCRS(final Map<String,?> properties, final CoordinateReferenceSystem... components) {
- super(properties, createCoordinateSystem(components));
+ super(properties, createCoordinateSystem(properties, components));
this.components = copy(Arrays.asList(components));
// 'singles' is computed by the above method call.
}
@@ -175,10 +193,13 @@ public class DefaultCompoundCRS extends
* ("Relax constraint on placement of this()/super() call in constructors").
*/
@Workaround(library="JDK", version="1.7")
- private static CoordinateSystem createCoordinateSystem(final CoordinateReferenceSystem[] components) {
+ private static CoordinateSystem createCoordinateSystem(final Map<String,?> properties,
+ final CoordinateReferenceSystem[] components)
+ {
ensureNonNull("components", components);
if (components.length < 2) {
- throw new IllegalArgumentException(Errors.format(Errors.Keys.TooFewArguments_2, 2, components.length));
+ throw new IllegalArgumentException(Errors.getResources(properties).getString(
+ Errors.Keys.TooFewArguments_2, 2, components.length));
}
final CoordinateSystem[] cs = new CoordinateSystem[components.length];
for (int i=0; i<components.length; i++) {
@@ -365,6 +386,14 @@ public class DefaultCompoundCRS extends
}
/**
+ * Should never be invoked since we override {@link AbstractCRS#forConvention(AxesConvention)}.
+ */
+ @Override
+ final AbstractCRS createSameType(final Map<String,?> properties, final CoordinateSystem cs) {
+ throw new AssertionError();
+ }
+
+ /**
* Compares this coordinate reference system with the specified object for equality.
*
* @param object The object to compare to {@code this}.
@@ -417,6 +446,8 @@ public class DefaultCompoundCRS extends
* SIS does not check if this CRS is compliant with the above-cited restrictions.
*
* @return {@code "CompoundCRS"} (WKT 2) or {@code "Compd_CS"} (WKT 1).
+ *
+ * @see <a href="http://docs.opengeospatial.org/is/12-063r5/12-063r5.html#110">WKT 2 specification</a>
*/
@Override
protected String formatTo(final Formatter formatter) {
@@ -430,6 +461,6 @@ public class DefaultCompoundCRS extends
formatter.append(toFormattable(element));
}
formatter.newLine(); // For writing the ID[…] element on its own line.
- return isWKT1 ? "Compd_CS" : "CompoundCRS";
+ return isWKT1 ? WKTKeywords.Compd_CS : WKTKeywords.CompoundCRS;
}
}