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

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Sat Jun 26 13:08:30 CEST 2010


Author: alfonx
Date: 2010-06-26 13:08:30 +0200 (Sat, 26 Jun 2010)
New Revision: 915

Modified:
   trunk/src/schmitzm/geotools/JTSUtil.java
Log:
BugFIX: XMapPane did crash for one-point-only layers, beacause their BBOX has width 0 and a Transfomation from Screen To Map could not be calculated.

Modified: trunk/src/schmitzm/geotools/JTSUtil.java
===================================================================
--- trunk/src/schmitzm/geotools/JTSUtil.java	2010-06-26 11:06:32 UTC (rev 914)
+++ trunk/src/schmitzm/geotools/JTSUtil.java	2010-06-26 11:08:30 UTC (rev 915)
@@ -357,57 +357,56 @@
 	 * @return A {@link ReferencedEnvelope} that has an area greater 0!
 	 */
 	public static ReferencedEnvelope checkNotZeroArea(
-			final ReferencedEnvelope env) {
-		
-		ReferencedEnvelope env2 = env;
+			final ReferencedEnvelope env_) {
+
+		ReferencedEnvelope env = env_;
 		// Check, that the BBOX doesn't have a height of 0. If so, the height is
 		// increased by 2!
 		if (env.getHeight() == 0.) {
-			env2 = new ReferencedEnvelope(env.getMinX(), env.getMaxX(), env
+			env = new ReferencedEnvelope(env.getMinX(), env.getMaxX(), env
 					.getMinY() - 1., env.getMaxY() + 1., env
 					.getCoordinateReferenceSystem());
 		}
 		// Check, that the BBOX doesn't have a width of 0. If so, the width is
 		// increased by 2!
 		if (env.getWidth() == 0.) {
-			env2 = new ReferencedEnvelope(env.getMinX() - 1.,
+			env = new ReferencedEnvelope(env.getMinX() - 1.,
 					env.getMaxX() + 1., env.getMinY(), env.getMaxY(), env
 							.getCoordinateReferenceSystem());
 		}
 
 		// env.getCoordinateReferenceSystem().getDomainOfValidity()
 
-		return env2;
+		return env;
 	}
 
 	/**
-	 * 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.
+	 * 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.
 	 * 
 	 * TODO check that the new Envelope is still in the valid are of the CRS
 	 * env.getCoordinateReferenceSystem().getDomainOfValidity()
 	 * 
 	 * @return A {@link ReferencedEnvelope} that has an area greater 0!
 	 */
-	public static Envelope checkNotZeroArea(final Envelope env) {
-		Envelope env2 = env;
+	public static Envelope checkNotZeroArea(final Envelope env_) {
+		Envelope env = env_;
 		// Check, that the BBOX doesn't have a height of 0. If so, the height is
 		// increased by 2!
 		if (env.getHeight() == 0.) {
-			env2 = new Envelope(env.getMinX(), env.getMaxX(),
+			env = new Envelope(env.getMinX(), env.getMaxX(),
 					env.getMinY() - 1., env.getMaxY() + 1.);
 		}
 		// Check, that the BBOX doesn't have a width of 0. If so, the width is
 		// increased by 2!
 		if (env.getWidth() == 0.) {
-			env2 = new Envelope(env.getMinX() - 1., env.getMaxX() + 1., env
+			env = new Envelope(env.getMinX() - 1., env.getMaxX() + 1., env
 					.getMinY(), env.getMaxY());
 		}
 
 		// env.getCoordinateReferenceSystem().getDomainOfValidity()
 
-		return env2;
+		return env;
 	}
 
 }



More information about the Schmitzm-commits mailing list