|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.bbn.openmap.proj.LineCoordinateGenerator
public class LineCoordinateGenerator
Generator class that connects simple coordinates with complex lines (great circle or rhumb). If you provide decimal degrees, the answer will be in decimal degrees. If coords are provided in radians, the answer will be in radians.
Usage: double[] coords = new double[] { 30.0, -125.0, 30.0, -90.0, 15.0, -90.0, 15, -125.0, 30.0, -125.0 }; double[] complexCoords = LineCoordinateGenerator.fromDegrees(coords).withSegmentsPerDegrees(10).greatCircleLineDoubles();
Field Summary | |
---|---|
static double |
DEFAULT_SEGS_PER_DEG
|
Method Summary | |
---|---|
static LineCoordinateGenerator |
fromDegrees(double[] degrees)
Create LCG with decimal degree coordinates. |
static LineCoordinateGenerator |
fromRadians(double[] radians)
Create LCG with radian coordinates. |
double[] |
greatCircleLineDoubles()
Return the source coordinates connected by great circle lines |
java.awt.Shape |
greatCircleLineShape()
Create a java.awt.Shape object of coordinates connected by great circle lines. |
double[] |
rhumbLineDoubles()
Return the source coordinates connected by rhumb lines |
java.awt.Shape |
rhumbLineShape()
Create a java.awt.Shape object of coordinates connected by rhumb lines. |
java.awt.Shape |
straightLineShape()
Creates a Shape object from provided coordinates. |
static java.util.List<double[]> |
toDoubles(java.awt.Shape s)
Convert a Shape object into a List of double[]. |
LineCoordinateGenerator |
withSegmentsPerDegrees(double spd)
Set how complex the line is by setting how many segments per degree are used to approximate the curve. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final double DEFAULT_SEGS_PER_DEG
Method Detail |
---|
public static LineCoordinateGenerator fromRadians(double[] radians)
radians
- array of coordinates in radians, in lat, lon, lat, lon
order.
public static LineCoordinateGenerator fromDegrees(double[] degrees)
degrees
- array of coordinates in degrees, in lat, lon, lat, lon
order.
public LineCoordinateGenerator withSegmentsPerDegrees(double spd)
spd
- the default is 10 segments per degree
public double[] greatCircleLineDoubles()
public java.awt.Shape greatCircleLineShape()
public double[] rhumbLineDoubles()
public java.awt.Shape rhumbLineShape()
public java.awt.Shape straightLineShape()
public static java.util.List<double[]> toDoubles(java.awt.Shape s)
s
- java.awt.Shape
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |