[Schmitzm-commits] r616 - branches/2.0-RC1/src/schmitzm/geotools/io
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Mon Dec 14 20:53:09 CET 2009
Author: alfonx
Date: 2009-12-14 20:53:08 +0100 (Mon, 14 Dec 2009)
New Revision: 616
Modified:
branches/2.0-RC1/src/schmitzm/geotools/io/GeoImportUtil.java
Log:
if reading a geotiff withour CRS fails, try with defautl CRS
* @see #readGridFromGeoTiff(File, CoordinateReferenceSystem)
*/
public static GridCoverage2D readGridFromGeoTiff(File file)
throws Exception {
try {
return readGridFromGeoTiff(file, null);
} catch (DataSourceException dse) {
return readGridFromGeoTiff(file, getDefaultCRS());
}
}
Modified: branches/2.0-RC1/src/schmitzm/geotools/io/GeoImportUtil.java
===================================================================
--- branches/2.0-RC1/src/schmitzm/geotools/io/GeoImportUtil.java 2009-12-14 17:31:41 UTC (rev 615)
+++ branches/2.0-RC1/src/schmitzm/geotools/io/GeoImportUtil.java 2009-12-14 19:53:08 UTC (rev 616)
@@ -55,6 +55,7 @@
import org.geotools.coverage.grid.GridCoverage2D;
import org.geotools.coverage.grid.GridCoverageFactory;
import org.geotools.coverage.grid.io.AbstractGridCoverage2DReader;
+import org.geotools.data.DataSourceException;
import org.geotools.data.DataStore;
import org.geotools.data.DataUtilities;
import org.geotools.data.shapefile.ShapefileDataStore;
@@ -567,7 +568,11 @@
*/
public static GridCoverage2D readGridFromGeoTiff(File file)
throws Exception {
- return readGridFromGeoTiff(file, null);
+ try {
+ return readGridFromGeoTiff(file, null);
+ } catch (DataSourceException dse) {
+ return readGridFromGeoTiff(file, getDefaultCRS());
+ }
}
/**
More information about the Schmitzm-commits
mailing list