public interface Projection
extends java.io.Serializable
This is a READONLY interface to the projection object. See the
Proj
class for read/write access.
A projection is an object that is maintained by the map, and represents a abstract "view" of the data. The projection has the properties of x-width, * y-height, scale (in pixels/meters), and a x/y center point that is in different units, depending on the projection implementation.
Proj
,
Cylindrical
,
Mercator
,
CADRG
,
Azimuth
,
Orthographic
,
Cartesian
,
GeoProj
Modifier and Type | Method and Description |
---|---|
java.awt.geom.Point2D |
forward(double lat,
double lon)
Forward project y, x world coordinates into xy space.
|
java.awt.geom.Point2D |
forward(double lat,
double lon,
java.awt.geom.Point2D pt)
Forward projects y, x world coordinates into XY space and returns a
Point2D.
|
java.awt.geom.Point2D |
forward(float lat,
float lon)
Forward project y, x world coordinates into xy space.
|
java.awt.geom.Point2D |
forward(float lat,
float lon,
java.awt.geom.Point2D pt)
Forward projects y, x world coordinates into XY space and returns a
Point2D.
|
java.awt.geom.Point2D |
forward(java.awt.geom.Point2D coord)
Forward project a world coordinate into XY pixel space.
|
java.awt.geom.Point2D |
forward(java.awt.geom.Point2D llp,
java.awt.geom.Point2D pt)
Forward projects a world coordinate into XY space and return a Point2D.
|
java.util.ArrayList<float[]> |
forwardLine(java.awt.geom.Point2D ll1,
java.awt.geom.Point2D ll2)
Forward project a line defined by two coordinate end points.
|
java.util.ArrayList<float[]> |
forwardPoly(double[] rawllpts,
boolean isFilled)
Forward project a polygon defined by the coordinates.
|
java.util.ArrayList<float[]> |
forwardPoly(float[] rawllpts,
boolean isFilled)
Forward project a polygon defined by the coordinates.
|
boolean |
forwardRaw(double[] rawllpts,
int rawoff,
float[] xcoords,
float[] ycoords,
boolean[] visible,
int copyoff,
int copylen)
Forward project a raw array of world coordinates.
|
boolean |
forwardRaw(float[] rawllpts,
int rawoff,
float[] xcoords,
float[] ycoords,
boolean[] visible,
int copyoff,
int copylen)
Forward project a raw array of world coordinates.
|
java.util.ArrayList<float[]> |
forwardRect(java.awt.geom.Point2D ll1,
java.awt.geom.Point2D ll2)
Forward project a rectangle defined by an upper left point and a lower
right point.
|
java.awt.Shape |
forwardShape(java.awt.Shape shape)
Forward project a shape defined with world coordinates into map x, y
space.
|
<T extends java.awt.geom.Point2D> |
getCenter()
Get the center coordinate.
|
<T extends java.awt.geom.Point2D> |
getCenter(T fillInThis)
Get the center coordinates set in a Point2D object provided.
|
int |
getHeight()
Get the height of the map in pixels.
|
<T extends java.awt.geom.Point2D> |
getLowerRight()
Get the lower right (southeast) point of the projection.
|
float |
getMaxScale()
Get the maximum scale value.
|
float |
getMinScale()
Get the minimum scale value.
|
java.lang.String |
getName()
Get the String used as a name, usually as a type.
|
java.lang.String |
getProjectionID()
Get the projection ID string.
|
float |
getScale()
Get the scale.
|
<T extends java.awt.geom.Point2D> |
getScale(T ll1,
T ll2,
java.awt.geom.Point2D point1,
java.awt.geom.Point2D point2)
Given a couple of points representing a bounding box, find out what the
scale should be in order to make those points appear at the corners of
the projection.
|
Length |
getUcuom()
Get the unprojected coordinates units of measure.
|
<T extends java.awt.geom.Point2D> |
getUpperLeft()
Get the upper left (northwest) point of the projection.
|
int |
getWidth()
Get the width of the map in pixels.
|
<T extends java.awt.geom.Point2D> |
inverse(double x,
double y)
Inverse project x,y coordinates into world coordinates.
|
<T extends java.awt.geom.Point2D> |
inverse(double x,
double y,
T llpt)
Inverse project x,y coordinates into world coordinates.
|
<T extends java.awt.geom.Point2D> |
inverse(java.awt.geom.Point2D point)
Inverse project a Point2D from map x/y space into world coordinates.
|
<T extends java.awt.geom.Point2D> |
inverse(java.awt.geom.Point2D point2D,
T llpt)
Inverse project a Point2D from map x/y space into world coordinates.
|
boolean |
isPlotable(double lat,
double lon)
Checks if a location is plot-able.
|
boolean |
isPlotable(float lat,
float lon)
Checks if a location is plot-able.
|
boolean |
isPlotable(java.awt.geom.Point2D point)
Checks if a point is plot-able.
|
Projection |
makeClone()
Clone the projection.
|
void |
pan(float Az)
Pan the map/projection.
|
void |
pan(float Az,
float c)
Pan the map/projection.
|
float getScale()
float getMaxScale()
float getMinScale()
<T extends java.awt.geom.Point2D> T getCenter()
<T extends java.awt.geom.Point2D> T getCenter(T fillInThis)
fillInThis
- the Point2D to fill in.int getWidth()
int getHeight()
java.lang.String getProjectionID()
<T extends java.awt.geom.Point2D> T getUpperLeft()
Returns the upper left point (or closest equivalent) of the projection based on the center point and height and width of screen.
This is trivial for most cylindrical projections, but much more complicated for azimuthal projections.
<T extends java.awt.geom.Point2D> T getLowerRight()
Returns the lower right point (or closest equivalent) of the projection based on the center point and height and width of screen.
This is trivial for most cylindrical projections, but much more complicated for azimuthal projections.
boolean isPlotable(java.awt.geom.Point2D point)
Call this to check and see if a point can be plotted. This is meant to be used for checking before projecting and rendering Point2D objects (bitmaps or text objects tacked at a specific location, for instance).
point
- Point2Dboolean isPlotable(float lat, float lon)
Call this to check and see if a location can be plotted. This is meant to be used for checking before projecting and rendering Point2D objects (bitmaps or text objects tacked at a location, for instance).
lat
- vertical location component (units depend on the projection
implementation).lon
- horizontal location component (units depend on the projection
implementation).boolean isPlotable(double lat, double lon)
Call this to check and see if a location can be plotted. This is meant to be used for checking before projecting and rendering Point2D objects (bitmaps or text objects tacked at a location, for instance).
lat
- vertical location component (units depend on the projection
implementation).lon
- horizontal location component (units depend on the projection
implementation).java.awt.geom.Point2D forward(java.awt.geom.Point2D coord)
coord
- Point2Djava.awt.geom.Point2D forward(java.awt.geom.Point2D llp, java.awt.geom.Point2D pt)
llp
- Point2D containing coordinates to be projectedpt
- A Point2D object to load the result into, a new Point2D object
will be created if this is null.java.awt.geom.Point2D forward(float lat, float lon)
lat
- float vertical location component (units depend on projection
implementation).lon
- float horizontal location component (units depend on
projection implementation).java.awt.geom.Point2D forward(double lat, double lon)
lat
- double vertical location component (units depend on projection
implementation).lon
- double horizontal location component (units depend on
projection implementation).java.awt.geom.Point2D forward(float lat, float lon, java.awt.geom.Point2D pt)
lat
- float vertical location component (units depend on projection
implementation).lon
- float horizontal location component (units depend on
projection implementation).pt
- A Point2D object to load the result into, a new Point2D object
will be created if this is null.java.awt.geom.Point2D forward(double lat, double lon, java.awt.geom.Point2D pt)
lat
- double vertical location component (units depend on projection
implementation).lon
- double horizontal location component (units depend on
projection implementation).pt
- A Point2D object to load the result into, a new Point2D object
will be created if this is null.java.awt.Shape forwardShape(java.awt.Shape shape)
shape
- java.awt.Shape object to project.<T extends java.awt.geom.Point2D> T inverse(java.awt.geom.Point2D point)
point
- XY Point2D<T extends java.awt.geom.Point2D> T inverse(java.awt.geom.Point2D point2D, T llpt)
point2D
- XY Point2Dllpt
- resulting Point2D object to load the result into, a new
Point2D object will be created if this is null.<T extends java.awt.geom.Point2D> T inverse(double x, double y)
x
- integer x coordinatey
- integer y coordinate<T extends java.awt.geom.Point2D> T inverse(double x, double y, T llpt)
x
- integer x coordinatey
- integer y coordinatellpt
- Point2D to be loaded with the result. A new Point2D object
will be created if this is null.Proj.inverse(Point2D)
void pan(float Az, float c)
pan(180, c)
pan south `c' amount.
pan(-90, c)
pan west `c' amount.
pan(0, c)
pan north `c' amount.
pan(90, c)
pan east `c' amount.
Az
- azimuth "east of north" in decimal degrees:
-180 <= Az <= 180
c
- distance in units determined by the projection implementation.void pan(float Az)
pan(180)
pan south
pan(-90)
pan west
pan(0)
pan north
pan(90)
pan east
Az
- azimuth "east of north" in decimal degrees:
-180 <= Az <= 180
java.util.ArrayList<float[]> forwardLine(java.awt.geom.Point2D ll1, java.awt.geom.Point2D ll2)
Returns a ArrayList
java.util.ArrayList<float[]> forwardRect(java.awt.geom.Point2D ll1, java.awt.geom.Point2D ll2)
Returns a ArrayList
ll1
- Point2D of northwest cornerll2
- Point2D of southeast cornerjava.util.ArrayList<float[]> forwardPoly(float[] rawllpts, boolean isFilled)
rawllpts
- a set of y, x coordinates.isFilled
- true of is important to note the area of the poly,
instead of just the edge.java.util.ArrayList<float[]> forwardPoly(double[] rawllpts, boolean isFilled)
rawllpts
- a set of y, x coordinates.isFilled
- true of is important to note the area of the poly,
instead of just the edge.boolean forwardRaw(float[] rawllpts, int rawoff, float[] xcoords, float[] ycoords, boolean[] visible, int copyoff, int copylen)
It does populate a visible array indicating whether the points are visible on the projected view of the world.
rawllpts
- array of y, xrawoff
- offset into rawllptsxcoords
- x coordinatesycoords
- y coordinatesvisible
- coordinates visible?copyoff
- offset into x,y,visible arrayscopylen
- number of coordinates (coordinate arrays should be at
least this long, rawllpts should be at least twice as long).boolean forwardRaw(double[] rawllpts, int rawoff, float[] xcoords, float[] ycoords, boolean[] visible, int copyoff, int copylen)
It does populate a visible array indicating whether the points are visible on the projected view of the world.
rawllpts
- array of y, xrawoff
- offset into rawllptsxcoords
- x coordinatesycoords
- y coordinatesvisible
- coordinates visible?copyoff
- offset into x,y,visible arrayscopylen
- number of coordinates (coordinate arrays should be at
least this long, rawllpts should be at least twice as long).Projection makeClone()
java.lang.String getName()
<T extends java.awt.geom.Point2D> float getScale(T ll1, T ll2, java.awt.geom.Point2D point1, java.awt.geom.Point2D point2)
ll1
- the upper left coordinates of the bounding box.ll2
- the lower right coordinates of the bounding box.point1
- a java.awt.geom.Point2D reflecting a pixel spot on the
projection that matches the ll1 coordinate, the upper left corner
of the area of interest. Note that this is where ll1 is going to
go in the new projection, not where it is now.point2
- a java.awt.geom.Point2D reflecting a pixel spot on the
projection that matches the ll2 coordinate, usually the lower
right corner of the area of interest. Note that this is where ll2
is going to go in the new projection, not where it is now.Length getUcuom()
Copyright (C) BBNT Solutions LLC; See http://openmap.bbn.com/ for details