com.esri.adf.web.util
Class MeasureUtil
java.lang.Object
com.esri.adf.web.util.MeasureUtil
public class MeasureUtil
- extends Object
Field Summary |
static int |
U_A
|
static int |
U_FT
|
static int |
U_KM
|
static int |
U_M
|
static int |
U_MI
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
U_M
public static final int U_M
- See Also:
- Constant Field Values
U_KM
public static final int U_KM
- See Also:
- Constant Field Values
U_FT
public static final int U_FT
- See Also:
- Constant Field Values
U_MI
public static final int U_MI
- See Also:
- Constant Field Values
U_A
public static final int U_A
- See Also:
- Constant Field Values
MeasureUtil
public MeasureUtil()
getDistance
public static double getDistance(WebPolyline wLine,
WebSpatialReference wRef)
- Gets distance in meters
- Parameters:
wLine
- wRef
-
calculateDistance
public static double calculateDistance(WebPoint wpt1,
WebPoint wpt2,
WebSpatialReference wRef)
- Calculates the map distance between the given 2 points in meters. The distance will be calculated alone Equator for
GCS, and the distance on latitude will be ignored.
- Parameters:
wpt1
- the first point.wpt2
- the second point.wRef
- the reference of the point
- Returns:
- the distance in meters
isProjected
public static boolean isProjected(WebSpatialReference wRef)
- Returns true if the spatial reference system is projected.
- Parameters:
wRef
-
getArea
public static double[] getArea(WebPolygon wPolygon,
WebSpatialReference wRef)
- Gets area (in sq meters) and perimeter of the given polygon. The returned double array contains 2 elements:
double[0] is area, double[1] is perimeter.
- Parameters:
wPolygon
- wRef
-
- Returns:
- area and perimeter.
convertUnits
public static double convertUnits(double distance,
int fromUnits,
int toUnits)
convertAreaUnits
public static double convertAreaUnits(double area,
int fromUnits,
int toUnits)
getUnitsLabel
public static String getUnitsLabel(int units)