|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectschmitzm.geotools.GTUtil
public class GTUtil
Diese Klasse enthaelt allgemeine Funktionen fuer die Arbeit mit Geotools.
Nested Class Summary | |
---|---|
static class |
GTUtil.GTRendererType
Specifies the types of renderer used by createGTRenderer()
. |
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 GTRenderer |
createGTRenderer()
Creates a GTRenderer . |
static GTRenderer |
createGTRenderer(MapContext mapContext)
Creates a GTRenderer . |
static GTRenderer |
createGTRenderer(MapContext mapContext,
Map<Object,Object> additionalRenderingHints)
Creates a GTRenderer . |
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 HashMap<Object,Object> |
getDefaultGTRendererHints(GTRenderer renderer)
Returns the default RendererHints for a given GTRenderer . |
static GTUtil.GTRendererType |
getGTRendererType()
Returns the renderer used by createGTRenderer() . |
static ReferencedEnvelope |
getVisibleLayoutBounds(MapContext context)
Very similar to MapContext#getLayerBounds() , this may return
null . |
static Envelope |
intersectEnvelope(Envelope env1,
Envelope env2,
CoordinateReferenceSystem crs)
Berechnet den Schnitt zweier Envelopes . |
static void |
setGTRendererType(GTUtil.GTRendererType rType)
Sets the renderer used by createGTRenderer() . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static CoordinateReferenceSystem WGS84
Constructor Detail |
---|
public GTUtil()
Method Detail |
---|
public static CoordinateReferenceSystem createCRS(String crsDef)
CoordinateReferenceSystem
aus einer
String-Definition. Akzeptiert wird ein EPSG-Code "EPSG:..." oder eine
WKT-Definition des CRS
crsDef
- Definition fuer das CRS.
null
, falls der String nicht zu einem CRS dekodiert
werden kannpublic static CoordinateReferenceSystem createCRS_EPSG(String code)
CoordinateReferenceSystem
aus einem (EPSG-)Code.
Entspricht CRS#decode(String,true)
.
Exceptions werden jedoch abgefangen und stattdessen null
zurueckgegeben.
code
- Code fuer das CRS.public static CoordinateReferenceSystem createCRS_UTM(int zone)
zone
- UTM-Zonepublic static Envelope2D createEnvelope2D(Rectangle2D env, CoordinateReferenceSystem crs)
Envelope2D
aus einem Rectangle2D
.
env
- Georeferenz und Ausdehnungcrs
- CoordinateReferenceSystempublic static final SortedMap<String,CoordinateReferenceSystem> getAvailableCRSByName(String authority, boolean longitudeFirst, boolean suppressWarnings)
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
public static final SortedMap<String,CoordinateReferenceSystem> getAvailableCRSByCode(String authority, boolean longitudeFirst, boolean suppressWarnings)
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
public static Envelope intersectEnvelope(Envelope env1, Envelope env2, CoordinateReferenceSystem crs)
Envelopes
.
env1
- erster Envelopeenv2
- zweiter Envelopecrs
- CoordinateReferenceSystem
fuer den Schnitt-Envelopepublic static GTRenderer createGTRenderer(MapContext mapContext)
GTRenderer
. This method can be used all over a project,
so the renderer can be switched easily.
mapContext
- a MapContext
(can be null
)public static GTRenderer createGTRenderer(MapContext mapContext, Map<Object,Object> additionalRenderingHints)
GTRenderer
. This method can be used all over a project,
so the renderer can be switched easily.
mapContext
- a MapContext
(can be null
)additionalRenderingHints
- A list of hints that will overload the default hints. May be
null
public static GTRenderer createGTRenderer()
GTRenderer
. This method can be used all over a project,
so the renderer can be switched easily. The GTRenderer
is
initialized with the default renering hints for the kind of renderer.
getDefaultGTRendererHints(GTRenderer)
public static void setGTRendererType(GTUtil.GTRendererType rType)
createGTRenderer()
.
rType
- renderer typeGTUtil.GTRendererType
public static GTUtil.GTRendererType getGTRendererType()
createGTRenderer()
.
GTUtil.GTRendererType
public static HashMap<Object,Object> getDefaultGTRendererHints(GTRenderer renderer)
GTRenderer
. By
2009/11/01 the StreamingRenderer
needs
StreamingRenderer.MEMORY_PRE_LOADING_KEY
false, whereas
ShapefileRenderer
need its set to true.
renderer
- is null
, the default GTUtil.GTRendererType
is
used.public static ReferencedEnvelope getVisibleLayoutBounds(MapContext context)
MapContext#getLayerBounds()
, this may return
null
. Different to MapContext#getLayerBounds()
, this
instance only looks at visible layers.
localContext
-
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |