[Schmitzm-commits] r1013 - branches/2.2.x/src/schmitzm/geotools
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Fri Sep 17 14:51:51 CEST 2010
Author: alfonx
Date: 2010-09-17 14:51:51 +0200 (Fri, 17 Sep 2010)
New Revision: 1013
Modified:
branches/2.2.x/src/schmitzm/geotools/JTSUtil.java
Log:
Allow both checkNotZeroArea methods to tolerate null by returning null.
Modified: branches/2.2.x/src/schmitzm/geotools/JTSUtil.java
===================================================================
--- branches/2.2.x/src/schmitzm/geotools/JTSUtil.java 2010-09-17 12:50:35 UTC (rev 1012)
+++ branches/2.2.x/src/schmitzm/geotools/JTSUtil.java 2010-09-17 12:51:51 UTC (rev 1013)
@@ -359,6 +359,8 @@
*/
public static ReferencedEnvelope checkNotZeroArea(
final ReferencedEnvelope env) {
+
+ if (env == null) return null;
ReferencedEnvelope env2 = env;
// Check, that the BBOX doesn't have a height of 0. If so, the height is
@@ -384,7 +386,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.
+ * 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()
@@ -392,6 +394,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