schmitzm.geotools
Class GTUtil

java.lang.Object
  extended by schmitzm.geotools.GTUtil

public class GTUtil
extends Object

Diese Klasse enthaelt allgemeine Funktionen fuer die Arbeit mit Geotools.

Version:
1.0
Author:
Martin Schmitz (University of Bonn/Germany)

Field Summary
static CoordinateReferenceSystem WGS84
          Konstante fuer das CRS "WGS84" (erzeugt als "EPSG:4326")
 
Constructor Summary
GTUtil()
           
 
Method Summary
static CoordinateReferenceSystem createCRS_EPSG(String code)
          Erzeugt ein CoordinateReferenceSystem aus einem (EPSG-)Code.
static CoordinateReferenceSystem createCRS_UTM(int zone)
          Erzeugt ein UTM-CoordinateReferenceSystem.
static CoordinateReferenceSystem createCRS(String crsDef)
          Erzeugt ein CoordinateReferenceSystem aus einer String-Definition.
static Envelope2D createEnvelope2D(Rectangle2D env, CoordinateReferenceSystem crs)
          Erzeugt einen Envelope2D aus einem Rectangle2D .
static SortedMap<String,CoordinateReferenceSystem> getAvailableCRSByCode(String authority, boolean longitudeFirst, boolean suppressWarnings)
          Liefert alle zur Verfuegung stehenden CRS fuer eine Authority.
static SortedMap<String,CoordinateReferenceSystem> getAvailableCRSByName(String authority, boolean longitudeFirst, boolean suppressWarnings)
          Liefert alle zur Verfuegung stehenden CRS fuer eine Authority.
static Envelope intersectEnvelope(Envelope env1, Envelope env2, CoordinateReferenceSystem crs)
          Berechnet den Schnitt zweier Envelopes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WGS84

public static CoordinateReferenceSystem WGS84
Konstante fuer das CRS "WGS84" (erzeugt als "EPSG:4326")

Constructor Detail

GTUtil

public GTUtil()
Method Detail

createCRS

public static CoordinateReferenceSystem createCRS(String crsDef)
Erzeugt ein CoordinateReferenceSystem aus einer String-Definition. Akzeptiert wird ein EPSG-Code "EPSG:..." oder eine WKT-Definition des CRS

Parameters:
crsDef - Definition fuer das CRS.
Returns:
null, falls der String nicht zu einem CRS dekodiert werden kann

createCRS_EPSG

public static CoordinateReferenceSystem createCRS_EPSG(String code)
Erzeugt ein CoordinateReferenceSystem aus einem (EPSG-)Code. Entspricht CRS#decode(String,true). Exceptions werden jedoch abgefangen und stattdessen null zurueckgegeben.

Parameters:
code - Code fuer das CRS.

createCRS_UTM

public static CoordinateReferenceSystem createCRS_UTM(int zone)
Erzeugt ein UTM-CoordinateReferenceSystem.

Parameters:
zone - UTM-Zone

createEnvelope2D

public static Envelope2D createEnvelope2D(Rectangle2D env,
                                          CoordinateReferenceSystem crs)
Erzeugt einen Envelope2D aus einem Rectangle2D .

Parameters:
env - Georeferenz und Ausdehnung
crs - CoordinateReferenceSystem

getAvailableCRSByName

public static final SortedMap<String,CoordinateReferenceSystem> getAvailableCRSByName(String authority,
                                                                                      boolean longitudeFirst,
                                                                                      boolean suppressWarnings)
Liefert alle zur Verfuegung stehenden CRS fuer eine Authority.

Parameters:
authority - Authority fuer die die CRS geliefert werden (z.B. "EPSG")
longitudeFirst - true erzwingt die Achsenordnung (longitude, latitude). Siehe CRS#decode(String, boolean) (Bemerkung: false bedeutet System-Default, nicht (latitude, longitude)!)
suppressWarnings - wenn true werden Warnmeldungen unterdrueckt
Returns:
eine nach dem CRS-Namen geordnete Map

getAvailableCRSByCode

public static final SortedMap<String,CoordinateReferenceSystem> getAvailableCRSByCode(String authority,
                                                                                      boolean longitudeFirst,
                                                                                      boolean suppressWarnings)
Liefert alle zur Verfuegung stehenden CRS fuer eine Authority.

Parameters:
authority - Authority fuer die die CRS geliefert werden (z.B. "EPSG")
longitudeFirst - true erzwingt die Achsenordnung (longitude, latitude). Siehe CRS#decode(String, boolean) (Bemerkung: false bedeutet System-Default, nicht (latitude, longitude)!)
suppressWarnings - wenn true werden Warnmeldungen unterdrueckt
Returns:
eine nach dem CRS-Code geordnete Map

intersectEnvelope

public static Envelope intersectEnvelope(Envelope env1,
                                         Envelope env2,
                                         CoordinateReferenceSystem crs)
Berechnet den Schnitt zweier Envelopes.

Parameters:
env1 - erster Envelope
env2 - zweiter Envelope
crs - CoordinateReferenceSystem fuer den Schnitt-Envelope