schmitzm.geotools
Class JTSUtil

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

public class JTSUtil
extends Object

Diese Klasse enthaelt allgemeine Funktionen fuer die Arbeit mit den in Geotools verwendeten JTS-Komponenten vereinfacht.

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

Constructor Summary
JTSUtil()
           
 
Method Summary
static Envelope createEnvelope(org.opengis.geometry.Envelope envelope)
          Created an (CRS-less) JTS-Envelope from an OpenGIS-Envelope.
static Envelope fixAspectRatio(Rectangle rect, Envelope mapArea, boolean grow)
          Returns an Envelope that has the same aspect ratio as the given rectangle
static Coordinate transformCoordinate(Coordinate sourceCoord, CoordinateReferenceSystem sourceCRS, CoordinateReferenceSystem destCRS)
          Transformiert eine Koordinate von einem CRS in ein anderes.
static Envelope transformEnvelope(Envelope sourceEnv, CoordinateReferenceSystem sourceCRS, CoordinateReferenceSystem destCRS)
          Transformiert einen JTS-Envelope von einem CRS in ein anderes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JTSUtil

public JTSUtil()
Method Detail

fixAspectRatio

public static Envelope fixAspectRatio(Rectangle rect,
                                      Envelope mapArea,
                                      boolean grow)
Returns an Envelope that has the same aspect ratio as the given rectangle

Parameters:
rect - defines the aspect ratio the map area is fixed with (e.g. a gui components size)
mapArea - the map area to apply the aspect ratio of "r" to
grow - If true, than the area will be enlarged to match the aspect ratio. If false, it will only shrink.

createEnvelope

public static Envelope createEnvelope(org.opengis.geometry.Envelope envelope)
Created an (CRS-less) JTS-Envelope from an OpenGIS-Envelope.

Parameters:
envelope - an OpenGIS-Envelope
Returns:
an JTS-Envelope

transformEnvelope

public static Envelope transformEnvelope(Envelope sourceEnv,
                                         CoordinateReferenceSystem sourceCRS,
                                         CoordinateReferenceSystem destCRS)
Transformiert einen JTS-Envelope von einem CRS in ein anderes.

Parameters:
sourceEnv - JTS-Envelope
sourceCRS - CRS von sourceEnv
destCRS - CRS in das umgerechnet werden soll
See Also:
CRS#findMathTransform(CoordinateReferenceSystem,CoordinateReferenceSystem), JTS#transform(Envelope,MathTransform)

transformCoordinate

public static Coordinate transformCoordinate(Coordinate sourceCoord,
                                             CoordinateReferenceSystem sourceCRS,
                                             CoordinateReferenceSystem destCRS)
Transformiert eine Koordinate von einem CRS in ein anderes.

Parameters:
sourceCoord - Koordinate
sourceCRS - CRS von sourceCoord
destCRS - CRS in das umgerechnet werden soll
See Also:
CRS#findMathTransform(CoordinateReferenceSystem,CoordinateReferenceSystem), JTS#transform(Coordinate, Coordinate, MathTransform)