svn commit: r1804863 - in /sis/branches/JDK8/core/sis-utility/src: main/java/org/apache/sis/measure/ main/resources/org/apache/sis/measure/ test/java/org/apache/sis/measure/
Author: desruisseaux Date: Sat Aug 12 09:56:14 2017 New Revision: 1804863 URL: http://svn.apache.org/viewvc?rev=1804863=rev Log: Add RADIANS_PER_SECOND unit and the corresponding AngularVelocity quantity. Add also a Salinity quantity. Added: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/measure/AngularVelocity.java (with props) sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/measure/Salinity.java (with props) sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/measure/ScaleRateOfChange.java (with props) Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/measure/UnitRegistry.java sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/measure/Units.java sis/branches/JDK8/core/sis-utility/src/main/resources/org/apache/sis/measure/UnitNames.properties sis/branches/JDK8/core/sis-utility/src/main/resources/org/apache/sis/measure/UnitNames_fr.properties sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/measure/UnitFormatTest.java Added: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/measure/AngularVelocity.java URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/measure/AngularVelocity.java?rev=1804863=auto == --- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/measure/AngularVelocity.java (added) +++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/measure/AngularVelocity.java [UTF-8] Sat Aug 12 09:56:14 2017 @@ -0,0 +1,41 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.sis.measure; + +import javax.measure.Quantity; + + +/** + * The rate of change of an angular displacement with respect to time. + * The SI unit is radians per second (rad/s) and the EPSG code is 1035. + * This quantity is used for describing the rate of changes of {@code rX}, {@code rY} and {@code rZ} terms in + * {@linkplain org.apache.sis.referencing.datum.BursaWolfParameters Bursa-Wolf parameters}, under the effect + * of plate tectonics. + * + * Most quantity types are defined in the {@link javax.measure.quantity}. + * This {@code AngularVelocity} type is an extension to the standard types. + * + * @author Martin Desruisseaux (Geomatys) + * @version 0.8 + * @since 0.8 + * @module + * + * @see Units#RADIANS_PER_SECOND + * @see org.apache.sis.referencing.datum.TimeDependentBWP + */ +public interface AngularVelocity extends Quantity { +} Propchange: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/measure/AngularVelocity.java -- svn:eol-style = native Propchange: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/measure/AngularVelocity.java -- svn:mime-type = text/plain;charset=UTF-8 Added: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/measure/Salinity.java URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/measure/Salinity.java?rev=1804863=auto == --- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/measure/Salinity.java (added) +++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/measure/Salinity.java [UTF-8] Sat Aug 12 09:56:14 2017 @@ -0,0 +1,39 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT
svn commit: r1804862 - in /sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation: projection/ transform/
Author: desruisseaux Date: Sat Aug 12 09:54:04 2017 New Revision: 1804862 URL: http://svn.apache.org/viewvc?rev=1804862=rev Log: Remove some optimization in map projections for which benchmarking has show that it made no measurable difference. Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/CylindricalEqualArea.java sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/LambertConicConformal.java sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/Mercator.java sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/NormalizedProjection.java sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/AbstractMathTransform.java Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/CylindricalEqualArea.java URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/CylindricalEqualArea.java?rev=1804862=1804861=1804862=diff == --- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/CylindricalEqualArea.java [UTF-8] (original) +++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/CylindricalEqualArea.java [UTF-8] Sat Aug 12 09:54:04 2017 @@ -228,23 +228,23 @@ public class CylindricalEqualArea extend } /** - * Converts a list of coordinate point ordinal values. - * - * Note: - * We override the super-class method only as an optimization in the special case where the target coordinates - * are written at the same locations than the source coordinates. In such case, we can take advantage of the - * fact that the λ values are not modified by the normalized Cylindrical Equal Area projection. + * Converts a list of coordinate points. This method performs the same calculation than above + * {@link #transform(double[], int, double[], int, boolean)} method, but is overridden for efficiency. * * @throws TransformException if a point can not be converted. */ @Override public void transform(final double[] srcPts, int srcOff, - final double[] dstPts, int dstOff, int numPts) -throws TransformException + final double[] dstPts, int dstOff, int numPts) throws TransformException { if (srcPts != dstPts || srcOff != dstOff || getClass() != CylindricalEqualArea.class) { super.transform(srcPts, srcOff, dstPts, dstOff, numPts); } else { +/* + * Override the super-class method only as an optimization in the special case where the target coordinates + * are written at the same locations than the source coordinates. In such case, we can take advantage of + * the fact that the λ values are not modified by the normalized Cylindrical Equal Area projection. + */ dstOff--; while (--numPts >= 0) { final double φ = dstPts[dstOff += DIMENSION]; // Same as srcPts[srcOff + 1]. @@ -322,8 +322,8 @@ public class CylindricalEqualArea extend * {@inheritDoc} * * Note: - * This method must be overridden because the {@link Mercator} class overrides the {@link NormalizedProjection} - * default implementation. + * This method must be overridden because the {@link CylindricalEqualArea} class + * overrides the {@link NormalizedProjection} default implementation. */ @Override public void transform(final double[] srcPts, int srcOff, Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/LambertConicConformal.java URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/LambertConicConformal.java?rev=1804862=1804861=1804862=diff == --- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/LambertConicConformal.java [UTF-8] (original) +++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/LambertConicConformal.java [UTF-8] Sat Aug 12 09:54:04 2017 @@ -21,7 +21,6 @@ import org.opengis.util.FactoryException import org.opengis.parameter.ParameterDescriptor; import org.opengis.referencing.operation.MathTransform; import org.opengis.referencing.operation.MathTransformFactory; -import
svn commit: r1804866 - in /sis/branches/JDK8/core/sis-referencing/src: main/java/org/apache/sis/referencing/factory/ main/java/org/apache/sis/referencing/operation/ test/java/org/apache/sis/referencin
Author: desruisseaux Date: Sat Aug 12 13:59:38 2017 New Revision: 1804866 URL: http://svn.apache.org/viewvc?rev=1804866=rev Log: Fix a bug that prevented CoordinateOperationRegistry registry to find an operation in the EPSG geodetic dataset when EPSG defines two versions of the same CRS with different axis order. Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/IdentifiedObjectFinder.java sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/CoordinateOperationRegistry.java sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/CoordinateOperationRegistryTest.java Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/IdentifiedObjectFinder.java URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/IdentifiedObjectFinder.java?rev=1804866=1804865=1804866=diff == --- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/IdentifiedObjectFinder.java [UTF-8] (original) +++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/IdentifiedObjectFinder.java [UTF-8] Sat Aug 12 13:59:38 2017 @@ -58,7 +58,7 @@ import org.apache.sis.util.Utilities; * is thread-safe. If concurrent searches are desired, then a new instance should be created for each thread. * * @author Martin Desruisseaux (IRD, Geomatys) - * @version 0.7 + * @version 0.8 * * @see GeodeticAuthorityFactory#newIdentifiedObjectFinder() * @see IdentifiedObjects#newFinder(String) @@ -302,7 +302,7 @@ public class IdentifiedObjectFinder { final AuthorityFactoryProxy previous = proxy; proxy = AuthorityFactoryProxy.getInstance(object.getClass()); try { -if (!ignoreIdentifiers) { +if (!ignoreIdentifiers && !ignoreAxes) { /* * First check if one of the identifiers can be used to find directly an identified object. * Verify that the object that we found is actually equal to given one; we do not blindly Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/CoordinateOperationRegistry.java URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/CoordinateOperationRegistry.java?rev=1804866=1804865=1804866=diff == --- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/CoordinateOperationRegistry.java [UTF-8] (original) +++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/CoordinateOperationRegistry.java [UTF-8] Sat Aug 12 13:59:38 2017 @@ -257,19 +257,27 @@ class CoordinateOperationRegistry { } /** - * Finds the authority code for the given coordinate reference system. + * Finds the authority codes for the given coordinate reference system. * This method does not trust the code given by the user in its CRS - we verify it. - * This method may return a code even if the axis order does not match; + * This method may return codes even if the axis order does not match; * it will be caller's responsibility to make necessary adjustments. */ -private String findCode(final CoordinateReferenceSystem crs) throws FactoryException { +private List findCode(final CoordinateReferenceSystem crs) throws FactoryException { +final List codes = new ArrayList<>(); if (codeFinder != null) { -final Identifier identifier = IdentifiedObjects.getIdentifier(codeFinder.findSingleton(crs), null); -if (identifier != null) { -return identifier.getCode(); +for (final IdentifiedObject candidate : codeFinder.find(crs)) { +final Identifier identifier = IdentifiedObjects.getIdentifier(candidate, registry.getAuthority()); +if (identifier != null) { +final String code = identifier.getCode(); +if (Utilities.deepEquals(candidate, crs, ComparisonMode.APPROXIMATIVE)) { +codes.add(0, code); // If axis order match, give precedence to that CRS. +} else { +codes.add(code); +} +} } } -return null; +return codes; } /** @@ -366,56 +374,58 @@ class CoordinateOperationRegistry { final CoordinateReferenceSystem targetCRS) throws IllegalArgumentException, IncommensurableException, FactoryException