|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectschmitzm.geotools.JTSUtil
public class JTSUtil
Diese Klasse enthaelt allgemeine Funktionen fuer die Arbeit mit den in Geotools verwendeten JTS-Komponenten vereinfacht.
Constructor Summary | |
---|---|
JTSUtil()
|
Method Summary | |
---|---|
static Envelope |
createEnvelope(org.opengis.geometry.Envelope envelope)
Created an (CRS-less) JTS-Envelope from an OpenGIS-Envelope. |
static ReferencedEnvelope |
createReferencedEnvelope(DirectPosition startCoord,
DirectPosition endCoord)
Creates an referenced envelope from two referenced coordinates. |
static Envelope |
expandEnvelope(Envelope env,
double pct)
Expands an Envelope by percentage. |
static ReferencedEnvelope |
expandEnvelope(ReferencedEnvelope env,
double pct)
Expands an Envelope by percentage. |
static ReferencedEnvelope |
fixAspectRatio(Rectangle rect,
ReferencedEnvelope 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. |
static ReferencedEnvelope |
transformEnvelope(ReferencedEnvelope bounds,
CoordinateReferenceSystem destCRS)
Transforms a ReferencedEnvelope into another CRS and return a
ReferencedEnvelope |
static Geometry |
transformGeometry(Geometry geometry,
CoordinateReferenceSystem srcCrs,
CoordinateReferenceSystem destCrs)
Transformiert eine JTS Geometry 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 |
---|
public JTSUtil()
Method Detail |
---|
public static Envelope createEnvelope(org.opengis.geometry.Envelope envelope)
envelope
- an OpenGIS-Envelope
public static Envelope expandEnvelope(Envelope env, double pct)
Envelope
by percentage.
env
- the Envelope
pct
- percentage (e.g. 0.1 = 10%) to expands the envelope by.
Negative values are allowed.public static ReferencedEnvelope expandEnvelope(ReferencedEnvelope env, double pct)
Envelope
by percentage.
env
- the Envelope
pct
- percentage (e.g. 0.1 = 10%) to expands the envelope by.
Negative values are allowed.public static Envelope transformEnvelope(Envelope sourceEnv, CoordinateReferenceSystem sourceCRS, CoordinateReferenceSystem destCRS)
getLenient()
lenient gerechnet.
sourceEnv
- JTS-EnvelopesourceCRS
- CRS von sourceEnv
destCRS
- CRS in das umgerechnet werden sollCRS#findMathTransform(CoordinateReferenceSystem,CoordinateReferenceSystem)
,
JTS#transform(Envelope,MathTransform)
,
transformEnvelope(ReferencedEnvelope, CoordinateReferenceSystem)
public static Coordinate transformCoordinate(Coordinate sourceCoord, CoordinateReferenceSystem sourceCRS, CoordinateReferenceSystem destCRS)
sourceCoord
- KoordinatesourceCRS
- CRS von sourceCoord
destCRS
- CRS in das umgerechnet werden sollCRS#findMathTransform(CoordinateReferenceSystem,CoordinateReferenceSystem)
,
JTS#transform(Coordinate, Coordinate, MathTransform)
public static Geometry transformGeometry(Geometry geometry, CoordinateReferenceSystem srcCrs, CoordinateReferenceSystem destCrs)
Geometry
von einem CRS in ein anderes.
geometry
- KoordinatesrcCrs
- CRS von sourceCoord
destCrs
- CRS in das umgerechnet werden sollCRS#findMathTransform(CoordinateReferenceSystem,CoordinateReferenceSystem)
,
JTS#transform(Coordinate, Coordinate, MathTransform)
public static ReferencedEnvelope fixAspectRatio(Rectangle rect, ReferencedEnvelope mapArea, boolean grow)
Envelope
that has the same aspect ratio as the given
rectangle
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" togrow
- If true
, than the area will be enlarged to match
the aspect ratio. If false
, it will only shrink.public static ReferencedEnvelope transformEnvelope(ReferencedEnvelope bounds, CoordinateReferenceSystem destCRS)
ReferencedEnvelope
into another CRS and return a
ReferencedEnvelope
public static ReferencedEnvelope createReferencedEnvelope(DirectPosition startCoord, DirectPosition endCoord)
startCoord
- endCoord
-
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |