|
deegree 2.5 (2011/06/29 09:44 build-8-official) | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.deegree.framework.util.MapUtils
public class MapUtils
Field Summary | |
---|---|
static double |
DEFAULT_PIXEL_SIZE
The Value of a PixelSize |
static double |
SQRT2
The value of sqrt(2) |
Constructor Summary | |
---|---|
MapUtils()
|
Method Summary | |
---|---|
static double |
calcDistance(double lon1,
double lat1,
double lon2,
double lat2)
calculates the distance in meters between two points in EPSG:4326 coodinates. this is a convenience method assuming the world is a ball |
static double |
calcScale(int mapWidth,
int mapHeight,
Envelope bbox,
CoordinateSystem crs,
double pixelSize)
calculates the map scale (denominator) as defined in the OGC SLD 1.0.0 specification |
static double |
calcScaleWMS111(int mapWidth,
int mapHeight,
Envelope bbox,
CoordinateSystem crs)
|
static double |
calcScaleWMS130(int mapWidth,
int mapHeight,
Envelope bbox,
CoordinateSystem crs)
|
static Envelope |
ensureAspectRatio(Envelope bbox,
double mapWith,
double mapHeight)
This method ensures the bbox is resized (shrunk) to match the aspect ratio defined by mapHeight/mapWidth |
static Envelope |
scaleEnvelope(Envelope currentEnvelope,
double currentScale,
double requestedScale)
The method calculates a new Envelope from the requestedBarValue It will either zoom in or zoom out
of the actualBBOX |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final double SQRT2
public static final double DEFAULT_PIXEL_SIZE
Constructor Detail |
---|
public MapUtils()
Method Detail |
---|
public static double calcScaleWMS111(int mapWidth, int mapHeight, Envelope bbox, CoordinateSystem crs)
mapWidth
- mapHeight
- bbox
- crs
-
public static double calcScaleWMS130(int mapWidth, int mapHeight, Envelope bbox, CoordinateSystem crs)
mapWidth
- mapHeight
- bbox
- crs
-
public static double calcScale(int mapWidth, int mapHeight, Envelope bbox, CoordinateSystem crs, double pixelSize) throws java.lang.RuntimeException
mapWidth
- map width in pixelmapHeight
- map height in pixelbbox
- bounding box of the mapcrs
- coordinate reference system of the mappixelSize
- size of one pixel of the map measured in meter
java.lang.RuntimeException
public static double calcDistance(double lon1, double lat1, double lon2, double lat2)
lon1
- lat1
- lon2
- lat2
-
public static Envelope scaleEnvelope(Envelope currentEnvelope, double currentScale, double requestedScale)
requestedBarValue
It will either zoom in or zoom out
of the actualBBOX depending
on the ratio of the requestedBarValue
to the actualBarValue
- Parameters:
currentEnvelope
- current EnvelopecurrentScale
- the scale of the current enveloperequestedScale
- requested scale value
- Returns:
- a new Envelope
public static final Envelope ensureAspectRatio(Envelope bbox, double mapWith, double mapHeight)
bbox
- mapWith
- mapHeight
-
|
deegree 2.5 (2011/06/29 09:44 build-8-official) | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
an open source project founded by lat/lon, Bonn, Germany.
For more information visit: http://www.deegree.org