[Schmitzm-commits] r430 - branches/1.0-gt2-2.6/src/schmitzm/geotools
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Sun Oct 4 16:32:45 CEST 2009
Author: alfonx
Date: 2009-10-04 16:32:44 +0200 (Sun, 04 Oct 2009)
New Revision: 430
Modified:
branches/1.0-gt2-2.6/src/schmitzm/geotools/JTSUtil.java
Log:
* JTSUtil.transformEnvelope now uses a fallback to lenient transformation if BW parameters are missing.
Modified: branches/1.0-gt2-2.6/src/schmitzm/geotools/JTSUtil.java
===================================================================
--- branches/1.0-gt2-2.6/src/schmitzm/geotools/JTSUtil.java 2009-10-04 14:31:56 UTC (rev 429)
+++ branches/1.0-gt2-2.6/src/schmitzm/geotools/JTSUtil.java 2009-10-04 14:32:44 UTC (rev 430)
@@ -35,6 +35,7 @@
import org.opengis.referencing.FactoryException;
import org.opengis.referencing.crs.CoordinateReferenceSystem;
import org.opengis.referencing.operation.MathTransform;
+import org.opengis.referencing.operation.OperationNotFoundException;
import org.opengis.referencing.operation.TransformException;
import com.vividsolutions.jts.geom.Coordinate;
@@ -65,7 +66,7 @@
}
/**
- * Transformiert einen JTS-Envelope von einem CRS in ein anderes.
+ * Transformiert einen JTS-Envelope von einem CRS in ein anderes. Wenn Bursa-Wolf parameter fehlen, wird lenient gerechnet.
* @param sourceEnv JTS-Envelope
* @param sourceCRS CRS von {@code sourceEnv}
* @param destCRS CRS in das umgerechnet werden soll
@@ -76,8 +77,10 @@
Envelope destEnv = null;
MathTransform transform;
try {
- transform = CRS.findMathTransform(sourceCRS, destCRS);
+ transform = CRS.findMathTransform(sourceCRS, destCRS, true);
destEnv = JTS.transform(sourceEnv,transform);
+ } catch (OperationNotFoundException e) {
+ LOGGER.warn("CRS tranformation not found: "+e.getMessage());
} catch (FactoryException e) {
LOGGER.warn("CRS tranformation for JTS envelope not successfully",e);
} catch (TransformException e) {
More information about the Schmitzm-commits
mailing list