public class JMapUnit
extends java.lang.Object
implements java.io.Serializable
| Modifier and Type | Field and Description |
|---|---|
static JMapUnit |
CENTIMETER |
static double |
CM_TO_INCH
Value of the ratio used to convert centimeters in inches
|
static JMapUnit |
DEGREE |
static int |
DEGREE_DECIMAL |
static int |
DEGREE_MINUTE_SEC |
static JMapUnit |
FEET |
static int |
FEET_IN_A_MILE
Numbers of feet in a mile
|
static double |
FEET_TO_M
Value of the ratio used to convert feets to meters
|
byte |
id |
static JMapUnit |
INCH |
static double |
INCH_TO_CM
Value of the ratio used to convert inches to centimeters
|
static byte |
JMAP_UNIT_CM
byte to identify that the unit is in centimeters
|
static byte |
JMAP_UNIT_DEG
byte to identify that the unit is in degrees
|
static byte |
JMAP_UNIT_FT
byte to identify that the unit is in feet
|
static byte |
JMAP_UNIT_IN
byte to identify that the unit is in inches
|
static byte |
JMAP_UNIT_KM
byte to identify that the unit is in kilometers
|
static byte |
JMAP_UNIT_M
byte to identify that the unit is in meters
|
static byte |
JMAP_UNIT_MI
byte to identify that the unit is in miles
|
static byte |
JMAP_UNIT_MM
byte to identify that the unit is in millimeters
|
static byte |
JMAP_UNIT_N_MI
byte to identify that the unit is in nautical miles
|
static byte |
JMAP_UNIT_OTHER
byte to identify that the unit used not part of our list
|
static byte |
JMAP_UNIT_TENTH_MM
byte to identify that the unit is in tenth of millimeters
|
static byte |
JMAP_UNIT_YR
byte to identify that the unit is in yards
|
static JMapUnit |
KILOMETER |
static double |
M_TO_FEET
Value of the ratio used to convert meters to feet
|
static JMapUnit |
METER |
static JMapUnit |
MILE |
static double |
MILES_IN_A_DEGRE
numbers of miles in a degre Degrees of latitude are parallel so the
distance between each degree remains almost constant but since degrees of
longitude are farthest apart at the equator and converge at the poles,
their distance varies greatly.
|
static JMapUnit |
MILLIMETER
4378176 JMap, 4374754.0 GeoServer, MapServer
|
static JMapUnit |
NAUTICAL_MILE |
double |
scaleConst |
static JMapUnit |
TENTH_MILLIMETERS |
static JMapUnit |
YARD |
| Constructor and Description |
|---|
JMapUnit() |
JMapUnit(byte id,
double scaleConst,
boolean cartesian,
int option,
java.lang.String xLabel,
java.lang.String yLabel) |
| Modifier and Type | Method and Description |
|---|---|
static double |
convert(double value,
JMapUnit fromUnit,
JMapUnit toUnit)
Returns the distance value converted from the specified unit to the
specified unit.
|
static double[] |
convertDegDecToDegMinSec(double degDec)
this method converts a value in degrees decimal to degree minute second
NOTE: If the degree value is negative, the minutes and seconds will also be
negative, so for display purposes, the absolute value should be used for
minutes and seconds
|
static double |
convertDegMinSecToDegDec(double[] degMinSec)
This method converts a value in degree minute seconds to degrees decimal
Note: if degree is negative, it assumes that minutes and seconds are also
negative.
|
static double |
convertSurface(double value,
JMapUnit fromUnit,
JMapUnit toUnit)
Returns the surface value converted from the specified unit to the
specified unit.
|
boolean |
equals(java.lang.Object o)
This method overrides equals()
|
java.lang.String |
getAbbreviation() |
byte |
getId() |
static JMapUnit |
getJMapUnit(java.lang.String JMapUnitName)
This method returns a JMapUnit instance from the name representing the unit
in the current locale
|
java.lang.String |
getLocalizedKey()
Returns the localized key of the JMapUnit instance.
|
java.lang.String |
getName()
Returns the name of the JMapUnit instance.
|
int |
getOption() |
double |
getScaleConst()
Returns the scale constant of the JMapUnit instance.
|
static JMapUnit |
getUnit(byte unit)
This method returns a JMapUnit instance from the byte representing the unit.
|
double |
getUnitFactor()
Deprecated.
use getScaleConst() instead
|
static double |
getUnitFactor(byte unitId)
Deprecated.
Use instance method instead.
|
java.lang.String |
getXLabel() |
java.lang.String |
getYLabel() |
boolean |
isCartesian() |
void |
setCartesian(boolean cartesian) |
void |
setOption(int option) |
void |
setScaleConst(double scaleConst) |
void |
setXLabel(java.lang.String label) |
void |
setYLabel(java.lang.String label) |
java.lang.String |
toString()
This method overrides toString()
|
static java.util.Enumeration<JMapUnit> |
units()
Returns an enumeration of the units available for use in a View object.
|
public static final double CM_TO_INCH
public static final double INCH_TO_CM
public static final double FEET_TO_M
public static final double M_TO_FEET
public static final double MILES_IN_A_DEGRE
public static final int FEET_IN_A_MILE
public static final byte JMAP_UNIT_M
public static final byte JMAP_UNIT_KM
public static final byte JMAP_UNIT_CM
public static final byte JMAP_UNIT_MM
public static final byte JMAP_UNIT_TENTH_MM
public static final byte JMAP_UNIT_FT
public static final byte JMAP_UNIT_MI
public static final byte JMAP_UNIT_IN
public static final byte JMAP_UNIT_YR
public static final byte JMAP_UNIT_N_MI
public static final byte JMAP_UNIT_DEG
public static final byte JMAP_UNIT_OTHER
public static final int DEGREE_DECIMAL
public static final int DEGREE_MINUTE_SEC
public static final JMapUnit MILLIMETER
public static final JMapUnit CENTIMETER
public static final JMapUnit METER
public static final JMapUnit KILOMETER
public static final JMapUnit INCH
public static final JMapUnit FEET
public static final JMapUnit YARD
public static final JMapUnit MILE
public static final JMapUnit NAUTICAL_MILE
public static final JMapUnit TENTH_MILLIMETERS
public static final JMapUnit DEGREE
public byte id
public double scaleConst
public JMapUnit()
public JMapUnit(byte id,
double scaleConst,
boolean cartesian,
int option,
java.lang.String xLabel,
java.lang.String yLabel)
public static JMapUnit getUnit(byte unit)
public static JMapUnit getJMapUnit(java.lang.String JMapUnitName)
@Deprecated public static double getUnitFactor(byte unitId)
unitId - the id of the requested unit object@Deprecated public double getUnitFactor()
public java.lang.String getName()
public java.lang.String getLocalizedKey()
public byte getId()
public static java.util.Enumeration<JMapUnit> units()
public static double convert(double value,
JMapUnit fromUnit,
JMapUnit toUnit)
value - the value to convertfromUnit - JMapUnit object representing the unit to convert fromtoUnit - JMapUnit object representing the unit to convert topublic static double convertSurface(double value,
JMapUnit fromUnit,
JMapUnit toUnit)
value - the value to convertfromUnit - JMapUnit object representing the unit to convert fromtoUnit - JMapUnit object representing the unit to convert topublic java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic boolean isCartesian()
public int getOption()
public void setOption(int option)
option - The option to set.public java.lang.String getXLabel()
public void setXLabel(java.lang.String label)
label - the label for the 'x' coordinatepublic java.lang.String getYLabel()
public void setYLabel(java.lang.String label)
label - the label for the 'y' coordinatepublic double getScaleConst()
public void setScaleConst(double scaleConst)
public void setCartesian(boolean cartesian)
public java.lang.String getAbbreviation()
public static double[] convertDegDecToDegMinSec(double degDec)
degDec - the value in degrees decimalpublic static double convertDegMinSecToDegDec(double[] degMinSec)
degMinSec - a double array containing the values: 1) degree 2) minute 3)
seconds