[Schmitzm-commits] r537 - branches/1.0-gt2-2.6/src/schmitzm/geotools

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Fri Nov 20 16:39:21 CET 2009


Author: alfonx
Date: 2009-11-20 16:39:21 +0100 (Fri, 20 Nov 2009)
New Revision: 537

Modified:
   branches/1.0-gt2-2.6/src/schmitzm/geotools/JTSUtil.java
Log:
Added a method boolean getLenient() to centrally define whether findMathTransform should be lenien

Modified: branches/1.0-gt2-2.6/src/schmitzm/geotools/JTSUtil.java
===================================================================
--- branches/1.0-gt2-2.6/src/schmitzm/geotools/JTSUtil.java	2009-11-20 15:38:34 UTC (rev 536)
+++ branches/1.0-gt2-2.6/src/schmitzm/geotools/JTSUtil.java	2009-11-20 15:39:21 UTC (rev 537)
@@ -95,7 +95,7 @@
     Envelope destEnv = null;
       MathTransform transform;
 	try {
-		transform = CRS.findMathTransform(sourceCRS, destCRS, true);
+		transform = CRS.findMathTransform(sourceCRS, destCRS, getLenient());
 		destEnv = JTS.transform(sourceEnv,transform);
 	} catch (OperationNotFoundException e) {
 		LOGGER.warn("CRS tranformation not found: "+e.getMessage());
@@ -108,6 +108,13 @@
   }
 
   /**
+   * @return Central setting to set the lenient param for CRS.findMathTransform(
+   */
+  private static boolean getLenient() {
+	return true;
+}
+
+/**
    * Transformiert eine Koordinate von einem CRS in ein anderes.
    * @param sourceCoord Koordinate
    * @param sourceCRS   CRS von {@code sourceCoord}
@@ -119,7 +126,7 @@
     Coordinate destCoord = null;
     MathTransform transform;
     try {
-        transform = CRS.findMathTransform(sourceCRS, destCRS, true);
+        transform = CRS.findMathTransform(sourceCRS, destCRS, getLenient());
         destCoord = JTS.transform(sourceCoord,null,transform);
     } catch (FactoryException e) {
         LOGGER.warn("CRS tranformation for JTS coordinate not successful",e);



More information about the Schmitzm-commits mailing list