svn commit: r1813110 - in /sis/branches/JDK8/core/sis-referencing/src: main/java/org/apache/sis/referencing/operation/ test/java/org/apache/sis/geometry/

2017-10-23 Thread desruisseaux
Author: desruisseaux
Date: Mon Oct 23 22:46:16 2017
New Revision: 1813110

URL: http://svn.apache.org/viewvc?rev=1813110&view=rev
Log:
Fix change of longitude range when there is also a change of ellipsoid.

Modified:

sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/AbstractCoordinateOperation.java

sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/AbstractSingleOperation.java

sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultConcatenatedOperation.java

sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultCoordinateOperationFactory.java

sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/geometry/EnvelopesTest.java

Modified: 
sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/AbstractCoordinateOperation.java
URL: 
http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/AbstractCoordinateOperation.java?rev=1813110&r1=1813109&r2=1813110&view=diff
==
--- 
sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/AbstractCoordinateOperation.java
 [UTF-8] (original)
+++ 
sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/AbstractCoordinateOperation.java
 [UTF-8] Mon Oct 23 22:46:16 2017
@@ -1037,7 +1037,7 @@ check:  for (int isTarget=0; ; isTar
 private void setSource(final CoordinateReferenceSystem crs) {
 if (sourceCRS == null) {
 sourceCRS = crs;
-} else {
+} else if (!sourceCRS.equals(crs)) {// Could be 
defined by ConcatenatedOperation.
 
MetadataUtilities.propertyAlreadySet(AbstractCoordinateOperation.class, 
"setSource", "sourceCRS");
 }
 }
@@ -1056,7 +1056,7 @@ check:  for (int isTarget=0; ; isTar
 private void setTarget(final CoordinateReferenceSystem crs) {
 if (targetCRS == null) {
 targetCRS = crs;
-} else {
+} else if (!targetCRS.equals(crs)) {// Could be 
defined by ConcatenatedOperation.
 
MetadataUtilities.propertyAlreadySet(AbstractCoordinateOperation.class, 
"setTarget", "targetCRS");
 }
 }
@@ -1120,4 +1120,11 @@ check:  for (int isTarget=0; ; isTar
 
MetadataUtilities.propertyAlreadySet(AbstractCoordinateOperation.class, 
"setScope", "scope");
 }
 }
+
+/**
+ * Invoked by JAXB after unmarshalling.
+ */
+void afterUnmarshal(Unmarshaller unmarshaller, Object parent) {
+computeTransientFields();
+}
 }

Modified: 
sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/AbstractSingleOperation.java
URL: 
http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/AbstractSingleOperation.java?rev=1813110&r1=1813109&r2=1813110&view=diff
==
--- 
sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/AbstractSingleOperation.java
 [UTF-8] (original)
+++ 
sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/AbstractSingleOperation.java
 [UTF-8] Mon Oct 23 22:46:16 2017
@@ -70,7 +70,7 @@ import static org.apache.sis.util.Utilit
  * {@link DefaultPassThroughOperation}.
  *
  * @author  Martin Desruisseaux (IRD, Geomatys)
- * @version 0.7
+ * @version 0.8
  * @since   0.6
  * @module
  */
@@ -513,7 +513,9 @@ class AbstractSingleOperation extends Ab
  *
  * @see http://issues.apache.org/jira/browse/SIS-291";>SIS-291
  */
-private void afterUnmarshal(Unmarshaller unmarshaller, Object parent) {
+@Override
+final void afterUnmarshal(Unmarshaller unmarshaller, Object parent) {
+super.afterUnmarshal(unmarshaller, parent);
 final CoordinateReferenceSystem sourceCRS = super.getSourceCRS();
 final CoordinateReferenceSystem targetCRS = super.getTargetCRS();
 if (transform == null && sourceCRS != null && targetCRS != null && 
parameters != null) try {

Modified: 
sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultConcatenatedOperation.java
URL: 
http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultConcatenatedOperation.java?rev=1813110&r1=1813109&r2=1813110&view=diff
==
--- 
sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultConcatenatedOperation.java
 [UTF-8] (original)
+++ 
sis/branches/JDK8/core/sis-referenc

svn commit: r1813016 - in /sis/branches/JDK8/core/sis-referencing/src: main/java/org/apache/sis/internal/referencing/ main/java/org/apache/sis/referencing/operation/ test/java/org/apache/sis/geometry/

2017-10-23 Thread desruisseaux
Author: desruisseaux
Date: Mon Oct 23 13:05:13 2017
New Revision: 1813016

URL: http://svn.apache.org/viewvc?rev=1813016&view=rev
Log:
Bug fix the [0 … 360]° when a source or target CRS is of kind CompoundCRS.

Modified:

sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/CoordinateOperations.java

sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/CoordinateOperationFinder.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/geometry/EnvelopesTest.java

sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/geometry/Shapes2DTest.java

sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/geometry/TransformTestCase.java

sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/test/ReferencingAssert.java

Modified: 
sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/CoordinateOperations.java
URL: 
http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/CoordinateOperations.java?rev=1813016&r1=1813015&r2=1813016&view=diff
==
--- 
sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/CoordinateOperations.java
 [UTF-8] (original)
+++ 
sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/CoordinateOperations.java
 [UTF-8] Mon Oct 23 13:05:13 2017
@@ -18,6 +18,7 @@ package org.apache.sis.internal.referenc
 
 import java.util.List;
 import java.util.Objects;
+import java.util.Collections;
 import javax.measure.UnitConverter;
 import javax.measure.IncommensurableException;
 import org.opengis.referencing.cs.RangeMeaning;
@@ -25,9 +26,11 @@ import org.opengis.referencing.cs.Coordi
 import org.opengis.referencing.cs.CoordinateSystemAxis;
 import org.opengis.referencing.crs.CoordinateReferenceSystem;
 import org.opengis.referencing.crs.GeneralDerivedCRS;
-import org.apache.sis.internal.metadata.AxisDirections;
+import org.opengis.referencing.operation.CoordinateOperation;
 import org.opengis.referencing.operation.CoordinateOperationFactory;
 import org.apache.sis.referencing.operation.DefaultCoordinateOperationFactory;
+import org.apache.sis.referencing.operation.AbstractCoordinateOperation;
+import org.apache.sis.internal.metadata.AxisDirections;
 import org.apache.sis.internal.system.DefaultFactories;
 import org.apache.sis.internal.system.Modules;
 import org.apache.sis.internal.system.SystemListener;
@@ -115,6 +118,30 @@ public final class CoordinateOperations
 }
 
 /**
+ * Returns indices of target dimensions where "wrap around" may happen as 
a result of a coordinate operation.
+ * This is usually the longitude axis when the source CRS uses the [-180 … 
+180]° range and the target CRS
+ * uses the [0 … 360]° range, or the converse.
+ *
+ * @param  op  the coordinate operation for which to get "wrap around" 
target dimensions.
+ * @return list of target dimensions where "wrap around" may happen, or an 
empty list if none.
+ *
+ * @see AbstractCoordinateOperation#getWrapAroundChanges()
+ */
+public static List wrapAroundChanges(final CoordinateOperation 
op) {
+if (op instanceof AbstractCoordinateOperation) {
+return ((AbstractCoordinateOperation) op).getWrapAroundChanges();
+} else if (op != null) {
+final CoordinateReferenceSystem source, target;
+if ((source = op.getSourceCRS()) != null &&
+(target = op.getTargetCRS()) != null)
+{
+return wrapAroundChanges(source, target.getCoordinateSystem());
+}
+}
+return Collections.emptyList();
+}
+
+/**
  * Computes indices of target dimensions where "wrap around" may happen as 
a result of a coordinate operation.
  * This is usually the longitude axis when the source CRS uses the [-180 … 
+180]° range and the target CRS uses
  * the [0 … 360]° range, or the converse.

Modified: 
sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/CoordinateOperationFinder.java
URL: 
http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/CoordinateOperationFinder.java?rev=1813016&r1=1813015&r2=1813016&view=diff
==
--- 
sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/CoordinateOperationFinder.java
 [UTF-8] (original)
+++ 
sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/CoordinateOperationFinder.java
 [UTF-8] Mon Oct 2

[jira] [Updated] (SIS-316) NetCDF: build CRS and GridToCRS Transform from netcdf variables and attributes

2017-10-23 Thread Martin Desruisseaux (JIRA)

 [ 
https://issues.apache.org/jira/browse/SIS-316?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Martin Desruisseaux updated SIS-316:

Affects Version/s: 0.8
Fix Version/s: (was: 0.8)
   1.0

> NetCDF: build CRS and GridToCRS Transform from netcdf variables and attributes
> --
>
> Key: SIS-316
> URL: https://issues.apache.org/jira/browse/SIS-316
> Project: Spatial Information Systems
>  Issue Type: Improvement
>  Components: Storage
>Affects Versions: 0.6, 0.7, 0.8
>Reporter: Johann Sorel
>Assignee: Martin Desruisseaux
>Priority: Minor
>  Labels: NetCDF
> Fix For: 1.0
>
> Attachments: netcdfgridgeom.patch
>
>
> Patch include :
> - CRS reconstruction for GeographicCRS N dimensions.
> - MathTransform reconstruction from variable grid to CRS



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (SIS-315) NetCDF: convention interface and parsing utilities

2017-10-23 Thread Martin Desruisseaux (JIRA)

 [ 
https://issues.apache.org/jira/browse/SIS-315?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Martin Desruisseaux updated SIS-315:

Attachment: Conventions (version 2).patch

Attached a refactored version of the patch. This new version replaces JSR-275 
dependency by JSR-363, omits the attribute name declarations (since this is the 
purpose of {{AttributeNames}}, {{CF}} or {{ACDD}} classes), adds javadoc and 
some refactoring.

> NetCDF: convention interface and parsing utilities
> --
>
> Key: SIS-315
> URL: https://issues.apache.org/jira/browse/SIS-315
> Project: Spatial Information Systems
>  Issue Type: Improvement
>  Components: Storage
>Affects Versions: 0.6, 0.7, 0.8
>Reporter: Johann Sorel
>Assignee: Martin Desruisseaux
>Priority: Minor
>  Labels: NetCDF
> Fix For: 1.0
>
> Attachments: Conventions (version 2).patch, netcdfconvention.patch
>
>
> NetCDF has a wide range of conventions, this patch include a start of api and 
> utility methods the most used NetCDF-CF convention.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (SIS-315) NetCDF: convention interface and parsing utilities

2017-10-23 Thread Martin Desruisseaux (JIRA)

 [ 
https://issues.apache.org/jira/browse/SIS-315?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Martin Desruisseaux updated SIS-315:

Affects Version/s: 0.8
Fix Version/s: (was: 0.8)
   1.0

> NetCDF: convention interface and parsing utilities
> --
>
> Key: SIS-315
> URL: https://issues.apache.org/jira/browse/SIS-315
> Project: Spatial Information Systems
>  Issue Type: Improvement
>  Components: Storage
>Affects Versions: 0.6, 0.7, 0.8
>Reporter: Johann Sorel
>Assignee: Martin Desruisseaux
>Priority: Minor
>  Labels: NetCDF
> Fix For: 1.0
>
> Attachments: netcdfconvention.patch
>
>
> NetCDF has a wide range of conventions, this patch include a start of api and 
> utility methods the most used NetCDF-CF convention.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)