[Schmitzm-commits] r1012 - trunk/src/schmitzm/geotools

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Fri Sep 17 14:50:36 CEST 2010


Author: alfonx
Date: 2010-09-17 14:50:35 +0200 (Fri, 17 Sep 2010)
New Revision: 1012

Modified:
   trunk/src/schmitzm/geotools/JTSUtil.java
Log:
Make methods checkNotZeroArea telerate null by returning null.

Modified: trunk/src/schmitzm/geotools/JTSUtil.java
===================================================================
--- trunk/src/schmitzm/geotools/JTSUtil.java	2010-09-17 12:48:12 UTC (rev 1011)
+++ trunk/src/schmitzm/geotools/JTSUtil.java	2010-09-17 12:50:35 UTC (rev 1012)
@@ -349,15 +349,17 @@
 	/**
 	 * Checks that the passed {@link ReferencedEnvelope} doesn't have a width or
 	 * height of 0! If any of them is zero, it's increased by +/-1 in each
-	 * direction.
+	 * direction.<br/>Tolerates a <code>null</code> ReferencedEnvelope by returning <code>null</code>.
 	 * 
-	 * TODO check that the new Envelope is still in the valid are of the CRS
+	 * TODO check that the new ReferencedEnvelope is still in the valid are of the CRS
 	 * env.getCoordinateReferenceSystem().getDomainOfValidity()
 	 * 
 	 * @return A {@link ReferencedEnvelope} that has an area greater 0!
 	 */
 	public static ReferencedEnvelope checkNotZeroArea(
 			final ReferencedEnvelope env_) {
+		
+		if (env_ == null) return null;
 
 		ReferencedEnvelope env = env_;
 		// Check, that the BBOX doesn't have a height of 0. If so, the height is
@@ -382,7 +384,7 @@
 
 	/**
 	 * Checks that the passed {@link Envelope} doesn't have a width or height of
-	 * 0! If any of them is zero, it's increased by +/-1 in each direction.
+	 * 0! If any of them is zero, it's increased by +/-1 in each direction.<br/>Tolerates a <code>null</code> Envelope by returning <code>null</code>.
 	 * 
 	 * TODO check that the new Envelope is still in the valid are of the CRS
 	 * env.getCoordinateReferenceSystem().getDomainOfValidity()
@@ -390,6 +392,9 @@
 	 * @return A {@link ReferencedEnvelope} that has an area greater 0!
 	 */
 	public static Envelope checkNotZeroArea(final Envelope env_) {
+		
+		if (env_ == null) return null;
+		
 		Envelope env = env_;
 		// Check, that the BBOX doesn't have a height of 0. If so, the height is
 		// increased by 2!



More information about the Schmitzm-commits mailing list