[Schmitzm-commits] r1011 - branches/2.2.x/src/schmitzm/geotools

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


Author: alfonx
Date: 2010-09-17 14:48:12 +0200 (Fri, 17 Sep 2010)
New Revision: 1011

Modified:
   branches/2.2.x/src/schmitzm/geotools/JTSUtil.java
Log:
Allow checkNotZeroArea method to accept null and return null.

Modified: branches/2.2.x/src/schmitzm/geotools/JTSUtil.java
===================================================================
--- branches/2.2.x/src/schmitzm/geotools/JTSUtil.java	2010-09-16 22:00:02 UTC (rev 1010)
+++ branches/2.2.x/src/schmitzm/geotools/JTSUtil.java	2010-09-17 12:48:12 UTC (rev 1011)
@@ -349,7 +349,8 @@
 	/**
 	 * 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/>
+	 * If <code>null</code> is passed, the method return <code>null</code>.
 	 * 
 	 * TODO check that the new Envelope is still in the valid are of the CRS
 	 * env.getCoordinateReferenceSystem().getDomainOfValidity()
@@ -358,21 +359,21 @@
 	 */
 	public static ReferencedEnvelope checkNotZeroArea(
 			final ReferencedEnvelope env) {
-		
+
 		ReferencedEnvelope env2 = env;
 		// Check, that the BBOX doesn't have a height of 0. If so, the height is
 		// increased by 2!
 		if (env2.getHeight() == 0.) {
-			env2 = new ReferencedEnvelope(env2.getMinX(), env2.getMaxX(), env2
-					.getMinY() - 1., env2.getMaxY() + 1., env2
-					.getCoordinateReferenceSystem());
+			env2 = new ReferencedEnvelope(env2.getMinX(), env2.getMaxX(),
+					env2.getMinY() - 1., env2.getMaxY() + 1.,
+					env2.getCoordinateReferenceSystem());
 		}
 		// Check, that the BBOX doesn't have a width of 0. If so, the width is
 		// increased by 2!
 		if (env2.getWidth() == 0.) {
 			env2 = new ReferencedEnvelope(env2.getMinX() - 1.,
-					env2.getMaxX() + 1., env2.getMinY(), env2.getMaxY(), env2
-							.getCoordinateReferenceSystem());
+					env2.getMaxX() + 1., env2.getMinY(), env2.getMaxY(),
+					env2.getCoordinateReferenceSystem());
 		}
 
 		// env.getCoordinateReferenceSystem().getDomainOfValidity()



More information about the Schmitzm-commits mailing list