public class MapConverter
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static double |
PROJECTION_HEIGHT |
static double |
PROJECTION_WIDTH |
| Constructor and Description |
|---|
MapConverter() |
| Modifier and Type | Method and Description |
|---|---|
double |
getHeight() |
java.util.List<java.awt.geom.Line2D> |
getLatLonGrid()
generates a projected grid of latitude and longitude lines converted to
the scaled graphics space
|
double |
getScale() |
double |
getWidth() |
double |
latToY(double lat)
Convert latitude to graphics Y, assuming (0,0) is the point of reference
in the spherical coord system
|
double |
latToY(double lat,
MapPoint refPoint)
Convert latitude to graphics Y given a point of reference
|
double |
lonToX(double lon)
Convert longitude to graphics X, assuming a reference point of (0,0) in
spherical coords.
|
double |
lonToX(double lon,
MapPoint refPoint)
Convert longitude to graphics X, given a reference point in spherical
coords
|
java.awt.Point |
mapPointToPoint(MapPoint mp)
Convert a MapPoint (lat, lon) to a graphics-space point, assuming the parallel
of no distortion is the equator.
|
java.awt.Point |
mollweideProjection(java.awt.Point point,
double radius)
This converts lat and long point into the mollweide projection
http://mathworld.wolfram.com/MollweideProjection.html
|
MapPoint |
pointToMapPoint(java.awt.geom.Point2D p)
Convert a Point in graphics-space to a MapPoint assuming the parallel of no
distortion is the equator.
|
java.awt.Polygon |
regionToPolygon(GeographicArea r)
Converts a GeographicArea to a Polygon in graphics-space
|
public static final double PROJECTION_HEIGHT
public static final double PROJECTION_WIDTH
public double latToY(double lat,
MapPoint refPoint)
lat - refPoint - public double latToY(double lat)
lat - public double lonToX(double lon,
MapPoint refPoint)
lon - decimal longitude to convertrefPoint - mapPoint of referencepublic double lonToX(double lon)
lon - decimal longitude to convertpublic java.awt.Point mapPointToPoint(MapPoint mp)
mp - MapPoint to convertpublic MapPoint pointToMapPoint(java.awt.geom.Point2D p)
p - Point to convertpublic java.awt.Polygon regionToPolygon(GeographicArea r)
r - region object to be transformed.public double getScale()
public java.util.List<java.awt.geom.Line2D> getLatLonGrid()
public java.awt.Point mollweideProjection(java.awt.Point point,
double radius)
point - public double getWidth()
public double getHeight()