skrueger.geotools.io
Class GeoImportUtilURL

java.lang.Object
  extended by schmitzm.geotools.io.GeoImportUtil
      extended by skrueger.geotools.io.GeoImportUtilURL

public class GeoImportUtilURL
extends GeoImportUtil

Erweiterungen von Martin's GeoImportUtil classe fuer die konsequente Benutzung mit URLs. TODO Diese Klasse sollte vielleicht mit der GeoImportUtil zusammengefuegt werden.

Author:
Stefan Alfons Krüger

Nested Class Summary
 
Nested classes/interfaces inherited from class schmitzm.geotools.io.GeoImportUtil
GeoImportUtil.ARCASCII_POSTFIXES, GeoImportUtil.GEOTIFF_POSTFIXES, GeoImportUtil.IMAGE_POSTFIXES, GeoImportUtil.SHP_POSTFIXES, GeoImportUtil.WORLD_POSTFIXES
 
Field Summary
 
Fields inherited from class schmitzm.geotools.io.GeoImportUtil
DEFAULT_CRS
 
Constructor Summary
GeoImportUtilURL()
           
 
Method Summary
static GridCoverage2D readGridFromGeoTiff(URL geotiffURL, CoordinateReferenceSystem crs)
          Diese Methode importiert ein Raster aus einer Datei im GeoTIFF-Format.
static GridCoverage2D readGridFromImage(URL url)
          Read a GridCoverage2D from an image file. .prj and .wld files are usually expected
static GridCoverage2D readGridFromImage(URL url, CoordinateReferenceSystem crs)
          Read a GridCoverage2D from an image file. .wld file is usually expected also.
 
Methods inherited from class schmitzm.geotools.io.GeoImportUtil
createGridReaderFromGeoTiff, createGridReaderFromGeoTiff, determineProjection, determineProjection, getDEFAULT_CRS, readDataStoreFromShape, readFeaturesFromShapeFile, readFeaturesFromShapeURL, readGeometriesFromShapeFile, readGridFromArcInfoASCII, readGridFromArcInfoASCII, readGridFromArcInfoASCII, readGridFromGeoTiff, readGridFromGeoTiff, readGridRasterFromArcInfoASCII, readGridRasterFromArcInfoASCII, readGridRasterFromGeoTiff, readGridRasterFromGeoTiff, readProjectionFile, readProjectionFile, readProjectionString, readWorldFile, readWorldFile, setDEFAULT_CRS
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GeoImportUtilURL

public GeoImportUtilURL()
Method Detail

readGridFromImage

public static GridCoverage2D readGridFromImage(URL url)
                                        throws IOException
Read a GridCoverage2D from an image file. .prj and .wld files are usually expected

Throws:
IOException

readGridFromImage

public static GridCoverage2D readGridFromImage(URL url,
                                               CoordinateReferenceSystem crs)
                                        throws IOException
Read a GridCoverage2D from an image file. .wld file is usually expected also. The CRS can be given as the crs parameter. null is valid.

Throws:
IOException

readGridFromGeoTiff

public static GridCoverage2D readGridFromGeoTiff(URL geotiffURL,
                                                 CoordinateReferenceSystem crs)
                                          throws Exception
Diese Methode importiert ein Raster aus einer Datei im GeoTIFF-Format. Zunaechst wird versucht, die Geo-Informationen (Referenz+CRS) aus den TIFF-Metadaten zu ermitteln. Ist dies nicht erfolgreich, werden ein gleichnamiges World-File (.tfw) und Projection-File (.prj) herangezogen. Als Projektion (.prj) ist sowohl ein EPSG-Code "EPSG:...", als auch eine WKT-Definition erlaubt. Kann kein CRS ermitteln werden, wird GeoImportUtil.DEFAULT_CRS als CRS verwendet.

Parameters:
geotiffURL - URL to GeoTIFF-File
crs - erzwungenes CoordinateReferenceSystem fuer das Raster (kann null sein)
Throws:
Exception - bei irgendeinem Fehler