Author: desruisseaux
Date: Tue Apr 1 03:34:45 2014
New Revision: 1583523
URL: http://svn.apache.org/r1583523
Log:
Merge from the JDK6 branch.
Added:
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/distance/LatLonPointRadius.java
- copied unchanged from r1583522,
sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/distance/LatLonPointRadius.java
sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/distance/
- copied from r1583522,
sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/distance/
Removed:
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/core/
sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/core/
Modified:
sis/trunk/ (props changed)
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/Envelope2D.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/geometry/GeneralEnvelope.java
sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/test/suite/ReferencingTestSuite.java
sis/trunk/core/sis-utility/src/test/java/org/apache/sis/internal/converter/PathConverterTest.java
sis/trunk/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/package-info.java
sis/trunk/storage/sis-storage/src/main/java/org/apache/sis/index/tree/QuadTree.java
Propchange: sis/trunk/
------------------------------------------------------------------------------
Merged /sis/branches/JDK7:r1579487-1583520
Merged /sis/branches/JDK6:r1579489-1583522
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=1583523&r1=1583522&r2=1583523&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] Tue Apr 1 03:34:45 2014
@@ -84,8 +84,8 @@ import org.apache.sis.internal.jdk7.Obje
* <li>{@link #getSpan(int)}</li>
* <li>{@link #toSimpleEnvelopes()}</li>
* <li>{@link #contains(DirectPosition)}</li>
- * <li>{@link #contains(Envelope, boolean)}</li>
- * <li>{@link #intersects(Envelope, boolean)}</li>
+ * <li>{@link #contains(Envelope)}</li>
+ * <li>{@link #intersects(Envelope)}</li>
* </ul>
* </td></tr></table>
*
@@ -108,7 +108,7 @@ import org.apache.sis.internal.jdk7.Obje
*
* @author Martin Desruisseaux (IRD, Geomatys)
* @since 0.3 (derived from geotk-2.4)
- * @version 0.3
+ * @version 0.4
* @module
*/
public abstract class AbstractEnvelope implements Envelope, Emptiable {
@@ -726,9 +726,7 @@ public abstract class AbstractEnvelope i
/**
* Returns {@code true} if this envelope completely encloses the specified
envelope.
- * If one or more edges from the specified envelope coincide with an edge
from this
- * envelope, then this method returns {@code true} only if {@code
edgesInclusive}
- * is {@code true}.
+ * All edges of this envelope are considered inclusive.
*
* {@section Pre-conditions}
* This method assumes that the specified envelope uses the same CRS than
this envelope.
@@ -738,17 +736,38 @@ public abstract class AbstractEnvelope i
* For every cases illustrated below, the yellow box is considered
completely enclosed
* in the blue envelope:
*
- * <center><img src="doc-files/Contains.png"></center>
+ * <img src="doc-files/Contains.png">
+ *
+ * @param envelope The envelope to test for inclusion.
+ * @return {@code true} if this envelope completely encloses the specified
one.
+ * @throws MismatchedDimensionException if the specified envelope doesn't
have the expected dimension.
+ * @throws AssertionError If assertions are enabled and the envelopes have
mismatched CRS.
+ *
+ * @see #intersects(Envelope)
+ * @see #equals(Envelope, double, boolean)
+ *
+ * @since 0.4
+ */
+ public final boolean contains(final Envelope envelope) throws
MismatchedDimensionException {
+ return contains(envelope, true);
+ }
+
+ /**
+ * Returns {@code true} if this envelope completely encloses the specified
envelope.
+ * If one or more edges from the specified envelope coincide with an edge
from this
+ * envelope, then this method returns {@code true} only if {@code
edgesInclusive}
+ * is {@code true}.
+ *
+ * <p>This method is subject to the same pre-conditions than {@link
#contains(Envelope)},
+ * and handles envelopes spanning the anti-meridian in the same way.</p>
*
* @param envelope The envelope to test for inclusion.
* @param edgesInclusive {@code true} if this envelope edges are
inclusive.
* @return {@code true} if this envelope completely encloses the specified
one.
- * @throws MismatchedDimensionException if the specified envelope doesn't
have
- * the expected dimension.
+ * @throws MismatchedDimensionException if the specified envelope doesn't
have the expected dimension.
* @throws AssertionError If assertions are enabled and the envelopes have
mismatched CRS.
*
* @see #intersects(Envelope, boolean)
- * @see #equals(Envelope, double, boolean)
*/
public boolean contains(final Envelope envelope, final boolean
edgesInclusive) throws MismatchedDimensionException {
ensureNonNull("envelope", envelope);
@@ -822,8 +841,7 @@ public abstract class AbstractEnvelope i
/**
* Returns {@code true} if this envelope intersects the specified envelope.
- * If one or more edges from the specified envelope coincide with an edge
from this envelope,
- * then this method returns {@code true} only if {@code edgesInclusive} is
{@code true}.
+ * All edges of this envelope are considered inclusive.
*
* {@section Pre-conditions}
* This method assumes that the specified envelope uses the same CRS than
this envelope.
@@ -833,6 +851,28 @@ public abstract class AbstractEnvelope i
* This method can handle envelopes spanning the anti-meridian.
*
* @param envelope The envelope to test for intersection.
+ * @return {@code true} if this envelope intersects the specified one.
+ * @throws MismatchedDimensionException if the specified envelope doesn't
have the expected dimension.
+ * @throws AssertionError If assertions are enabled and the envelopes have
mismatched CRS.
+ *
+ * @see #contains(Envelope, boolean)
+ * @see #equals(Envelope, double, boolean)
+ *
+ * @since 0.4
+ */
+ public boolean intersects(final Envelope envelope) throws
MismatchedDimensionException {
+ return intersects(envelope, true);
+ }
+
+ /**
+ * Returns {@code true} if this envelope intersects the specified envelope.
+ * If one or more edges from the specified envelope coincide with an edge
from this envelope,
+ * then this method returns {@code true} only if {@code edgesInclusive} is
{@code true}.
+ *
+ * <p>This method is subject to the same pre-conditions than {@link
#intersects(Envelope)},
+ * and handles envelopes spanning the anti-meridian in the same way.</p>
+ *
+ * @param envelope The envelope to test for intersection.
* @param edgesInclusive {@code true} if this envelope edges are
inclusive.
* @return {@code true} if this envelope intersects the specified one.
* @throws MismatchedDimensionException if the specified envelope doesn't
have the expected dimension.
@@ -948,8 +988,8 @@ public abstract class AbstractEnvelope i
* axis length, or {@code false} if it is an absolute value.
* @return {@code true} if the given object is equal to this envelope up
to the given tolerance value.
*
- * @see #contains(Envelope, boolean)
- * @see #intersects(Envelope, boolean)
+ * @see #contains(Envelope)
+ * @see #intersects(Envelope)
*/
public boolean equals(final Envelope other, final double eps, final
boolean epsIsRelative) {
ensureNonNull("other", other);
Modified:
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/geometry/Envelope2D.java
URL:
http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/geometry/Envelope2D.java?rev=1583523&r1=1583522&r2=1583523&view=diff
==============================================================================
---
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/geometry/Envelope2D.java
[UTF-8] (original)
+++
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/geometry/Envelope2D.java
[UTF-8] Tue Apr 1 03:34:45 2014
@@ -673,7 +673,7 @@ public class Envelope2D extends Rectangl
*
* {@section Spanning the anti-meridian of a Geographic CRS}
* This method supports anti-meridian spanning in the same way than
- * {@link AbstractEnvelope#contains(Envelope, boolean)}.
+ * {@link AbstractEnvelope#contains(Envelope)}.
*
* @param rect The rectangle to test for inclusion.
* @return {@code true} if this envelope completely encloses the specified
rectangle.
@@ -695,7 +695,7 @@ public class Envelope2D extends Rectangl
*
* {@section Spanning the anti-meridian of a Geographic CRS}
* This method supports anti-meridian spanning in the same way than
- * {@link AbstractEnvelope#contains(Envelope, boolean)}.
+ * {@link AbstractEnvelope#contains(Envelope)}.
*
* @param rx The <var>x</var> ordinate of the lower corner of the
rectangle to test for inclusion.
* @param ry The <var>y</var> ordinate of the lower corner of the
rectangle to test for inclusion.
@@ -742,7 +742,7 @@ public class Envelope2D extends Rectangl
*
* {@section Spanning the anti-meridian of a Geographic CRS}
* This method supports anti-meridian spanning in the same way than
- * {@link AbstractEnvelope#intersects(Envelope, boolean)}.
+ * {@link AbstractEnvelope#intersects(Envelope)}.
*
* @param rect The rectangle to test for intersection.
* @return {@code true} if this envelope intersects the specified
rectangle.
@@ -764,7 +764,7 @@ public class Envelope2D extends Rectangl
*
* {@section Spanning the anti-meridian of a Geographic CRS}
* This method supports anti-meridian spanning in the same way than
- * {@link AbstractEnvelope#intersects(Envelope, boolean)}.
+ * {@link AbstractEnvelope#intersects(Envelope)}.
*
* @param rx The <var>x</var> ordinate of the lower corner of the
rectangle to test for intersection.
* @param ry The <var>y</var> ordinate of the lower corner of the
rectangle to test for intersection.
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=1583523&r1=1583522&r2=1583523&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] Tue Apr 1 03:34:45 2014
@@ -82,8 +82,8 @@ import static org.apache.sis.math.MathFu
* <li>{@link #isEmpty()}</li>
* <li>{@link #toSimpleEnvelopes() toSimpleEnvelopes()}</li>
* <li>{@link #contains(DirectPosition) contains(DirectPosition)}</li>
- * <li>{@link #contains(Envelope, boolean) contains(Envelope, boolean)}</li>
- * <li>{@link #intersects(Envelope, boolean) intersects(Envelope,
boolean)}</li>
+ * <li>{@link #contains(Envelope) contains(Envelope)}</li>
+ * <li>{@link #intersects(Envelope) intersects(Envelope)}</li>
* <li>{@link #intersect(Envelope)}</li>
* <li>{@link #add(Envelope)}</li>
* <li>{@link #add(DirectPosition)}</li>
@@ -664,7 +664,7 @@ public class GeneralEnvelope extends Arr
ordinates[iUpper] = Double.POSITIVE_INFINITY;
}
}
- assert contains(envelope, true) || isEmpty() || hasNaN(envelope) :
this;
+ assert contains(envelope) || isEmpty() || hasNaN(envelope) : this;
}
/**
@@ -795,7 +795,7 @@ public class GeneralEnvelope extends Arr
if (max1 < max0) ordinates[iUpper] = max1;
}
// Tests only if the interection result is non-empty.
- assert isEmpty() ||
AbstractEnvelope.castOrCopy(envelope).contains(this, true) : this;
+ assert isEmpty() ||
AbstractEnvelope.castOrCopy(envelope).contains(this) : this;
}
/**
Modified:
sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/test/suite/ReferencingTestSuite.java
URL:
http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/test/suite/ReferencingTestSuite.java?rev=1583523&r1=1583522&r2=1583523&view=diff
==============================================================================
---
sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/test/suite/ReferencingTestSuite.java
[UTF-8] (original)
+++
sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/test/suite/ReferencingTestSuite.java
[UTF-8] Tue Apr 1 03:34:45 2014
@@ -100,6 +100,8 @@ import org.junit.BeforeClass;
org.apache.sis.geometry.Envelope2DTest.class,
org.apache.sis.geometry.EnvelopesTest.class,
+ org.apache.sis.distance.LatLonPointRadiusTest.class, // Pending
refactoring in a geometry package.
+
org.apache.sis.test.integration.ReferencingInMetadataTest.class
})
public final strictfp class ReferencingTestSuite extends TestSuite {
Modified:
sis/trunk/core/sis-utility/src/test/java/org/apache/sis/internal/converter/PathConverterTest.java
URL:
http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/test/java/org/apache/sis/internal/converter/PathConverterTest.java?rev=1583523&r1=1583522&r2=1583523&view=diff
==============================================================================
---
sis/trunk/core/sis-utility/src/test/java/org/apache/sis/internal/converter/PathConverterTest.java
[UTF-8] (original)
+++
sis/trunk/core/sis-utility/src/test/java/org/apache/sis/internal/converter/PathConverterTest.java
[UTF-8] Tue Apr 1 03:34:45 2014
@@ -138,7 +138,7 @@ public final strictfp class PathConverte
@Test
@PlatformDependent
public void testURI_File() throws URISyntaxException {
- PathConverterTest.assumeUnixRoot();
+ assumeUnixRoot();
final ObjectConverter<URI,File> c = PathConverter.URIFile.INSTANCE;
runInvertibleConversion(c, new URI("file:/home/user/index.txt"), new
File("/home/user/index.txt"));
assertSerializedEquals(c);
@@ -177,7 +177,7 @@ public final strictfp class PathConverte
@Test
@PlatformDependent
public void testURL_File() throws MalformedURLException {
- PathConverterTest.assumeUnixRoot();
+ assumeUnixRoot();
final ObjectConverter<URL,File> c = PathConverter.URLFile.INSTANCE;
runInvertibleConversion(c, new URL("file:/home/user/index.txt"), new
File("/home/user/index.txt"));
assertSerializedEquals(c);
Modified:
sis/trunk/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/package-info.java
URL:
http://svn.apache.org/viewvc/sis/trunk/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/package-info.java?rev=1583523&r1=1583522&r2=1583523&view=diff
==============================================================================
---
sis/trunk/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/package-info.java
[UTF-8] (original)
+++
sis/trunk/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/package-info.java
[UTF-8] Tue Apr 1 03:34:45 2014
@@ -20,9 +20,9 @@
* attributes in a NetCDF file. The mapping is defined in the following web
pages:
*
* <ul>
- * <li><a
href="https://geo-ide.noaa.gov/wiki/index.php?title=NetCDF_Attribute_Convention_for_Dataset_Discovery">NetCDF
- * Attribute Convention for Dataset Discovery</a> wiki</li>
- * <li><a
href="http://ngdc.noaa.gov/metadata/published/xsl/nciso2.0/UnidataDD2MI.xsl">UnidataDD2MI.xsl</a>
file</li>
+ * <li><a
href="http://wiki.esipfed.org/index.php/Category:Attribute_Conventions_Dataset_Discovery">NetCDF
+ * Attribute Convention for Dataset Discovery</a> version 1.0.</li>
+ * <li><a
href="http://ngdc.noaa.gov/metadata/published/xsl/nciso2.0/UnidataDD2MI.xsl">UnidataDD2MI.xsl</a>
file.</li>
* </ul>
*
* The NetCDF attributes recognized by this package are listed in the
Modified:
sis/trunk/storage/sis-storage/src/main/java/org/apache/sis/index/tree/QuadTree.java
URL:
http://svn.apache.org/viewvc/sis/trunk/storage/sis-storage/src/main/java/org/apache/sis/index/tree/QuadTree.java?rev=1583523&r1=1583522&r2=1583523&view=diff
==============================================================================
---
sis/trunk/storage/sis-storage/src/main/java/org/apache/sis/index/tree/QuadTree.java
[UTF-8] (original)
+++
sis/trunk/storage/sis-storage/src/main/java/org/apache/sis/index/tree/QuadTree.java
[UTF-8] Tue Apr 1 03:34:45 2014
@@ -24,9 +24,9 @@ import java.util.List;
//SIS imports
import org.apache.sis.geometry.DirectPosition2D;
-import org.apache.sis.core.LatLonPointRadius;
import org.apache.sis.geometry.Envelope2D;
import org.apache.sis.distance.DistanceUtils;
+import org.apache.sis.distance.LatLonPointRadius;
/**
* Implementation of Quad Tree Index. Insertion algorithm implemented based on