public class

CoordinateConversion

extends Object
java.lang.Object
   ↳ com.esri.core.geometry.CoordinateConversion

Class Overview

The CoordinateConversion class contains a number of static methods which are for converting between Point and coordinate strings. Supported strings include:

- Decimal Degrees
- Degrees Decimal Minutes
- Degree Minutes Seconds
- GARS
- Georef
- MGRS
- USNG
- UTM

There are methods which support individual and batch conversions.

Summary

Nested Classes
enum CoordinateConversion.GARSConversionMode Global area System conversion options. 
enum CoordinateConversion.MGRSConversionMode Military Grid System conversion options. 
enum CoordinateConversion.UTMConversionMode Universal Transverse Mercator System conversion options. 
Public Constructors
CoordinateConversion()
Public Methods
static Point decimalDegreesToPoint(String coordinate, SpatialReference outSR)
Returns a Point class in the specified output spatial reference which is converted from a Decimal Degrees formatted string.
static List<Point> decimalDegreesToPoints(List<String> coordinates, SpatialReference outSR)
Returns a List of Point classes in the specified output spatial reference which are converted from a list of Decimal Degrees formatted strings.
static Point degreesDecimalMinutesToPoint(String coordinate, SpatialReference outSR)
Returns a Point class in the specified output spatial reference which is converted from a Degrees Decimal Minutes formatted string.
static List<Point> degreesDecimalMinutesToPoints(List<String> coordinates, SpatialReference outSR)
Returns a List of Point classes in the specified output spatial reference which are converted from a list if Degrees Decimal Minutes formatted strings.
static Point degreesMinutesSecondsToPoint(String coordinate, SpatialReference outSR)
Returns a Point class in the specified output spatial reference which is converted from a Degrees Minutes Seconds formatted string.
static List<Point> degreesMinutesSecondsToPoints(List<String> coordinates, SpatialReference outSR)
Returns a list of Point classes in the specified output spatial reference which are converted from a list of Degrees Minutes Seconds formatted strings.
static Point garsToPoint(String coordinate, SpatialReference outSR, CoordinateConversion.GARSConversionMode conversionMode)
Returns a Point class in the specified output spatial reference which is converted from a GARS (Global Area Reference System) formatted string.
static List<Point> garsToPoints(List<String> coordinates, SpatialReference outSR, CoordinateConversion.GARSConversionMode conversionMode)
Returns a List of Point classes in the specified output spatial reference which are converted from a GARS (Global Area Reference System) formatted strings.
static Point georefToPoint(String coordinate, SpatialReference outSR)
Returns a Point class in the specified output spatial reference which is converted from a Georef (World Geographic Reference System) formatted string.
static List<Point> georefToPoints(List<String> coordinates, SpatialReference outSR)
Returns a list of Point classes in the specified output spatial reference which are converted from a Georef (World Geographic Reference System) formatted string list.
static Point mgrsToPoint(String coordinate, SpatialReference outSR, CoordinateConversion.MGRSConversionMode conversionMode)
Returns a Point class in the specified output spatial reference which is converted from a MGRS (Military Grid Reference System) formatted string.
static List<Point> mgrsToPoints(List<String> coordinates, SpatialReference outSR, CoordinateConversion.MGRSConversionMode conversionMode)
Returns a list of Point classes in the specified output spatial reference which is converted from a list of MGRS (Military Grid Reference System) formatted strings.
static String pointToDecimalDegrees(Point point, SpatialReference inSR, int numberOfDigits)
Returns a coordinate string (Decimal Degrees) which is converted from the supplied point.
static String pointToDegreesDecimalMinutes(Point point, SpatialReference inSR, int numberOfDigits)
Returns a coordinate string (Degrees Decimal Minutes) which is converted from the supplied point.
static String pointToDegreesMinutesSeconds(Point point, SpatialReference inSR, int numberOfDigits)
Returns a coordinate string (Degree Minutes Seconds) which is converted from the supplied point.
static String pointToGars(Point point, SpatialReference inSR)
Returns a coordinate string (GARS) which is converted from the supplied point.
static String pointToGeoref(Point point, SpatialReference inSR, int numberOfDigits, boolean roundToNearestWholeNumber)
Returns a coordinate string (Georef) which is converted from the supplied point.
static String pointToMgrs(Point point, SpatialReference inSR, CoordinateConversion.MGRSConversionMode conversionMode, int numberOfDigits, boolean roundToNearestWholeNumber, boolean addSpaces)
Returns a coordinate strings (MGRS) which is converted from the supplied point.
static String pointToUsng(Point point, SpatialReference inSR, int numberOfDigits, boolean roundToNearestWholeNumber, boolean addSpaces)
Returns a coordinate string (USNG) which is converted from the supplied point.
static String pointToUtm(Point point, SpatialReference inSR, CoordinateConversion.UTMConversionMode conversionMode, boolean addSpaces)
Returns a coordinate string (UTM) which is converted from the supplied point.
static List<String> pointsToDecimalDegrees(List<Point> points, SpatialReference inSR, int numberOfDigits)
Returns a list of coordinate strings (Decimal Degrees) which are converted from the supplied point list.
static List<String> pointsToDegreesDecimalMinutes(List<Point> points, SpatialReference inSR, int numberOfDigits)
Returns a list of coordinate strings (Degrees Decimal Minutes) which are converted from the supplied point list.
static List<String> pointsToDegreesMinutesSeconds(List<Point> points, SpatialReference inSR, int numberOfDigits)
Returns a list of coordinate strings (Degree Minutes Seconds) which are converted from the supplied point list.
static List<String> pointsToGars(List<Point> points, SpatialReference inSR)
Returns a list of coordinate strings (GARS) which are converted from the supplied point list.
static List<String> pointsToGeoref(List<Point> points, SpatialReference inSR, int numberOfDigits, boolean roundToNearestWholeNumber)
Returns a list of coordinate strings (Georef) which are converted from the supplied point list.
static List<String> pointsToMgrs(List<Point> points, SpatialReference inSR, CoordinateConversion.MGRSConversionMode conversionMode, int numberOfDigits, boolean roundToNearestWholeNumber, boolean addSpaces)
Returns a list of coordinate strings (MGRS) which are converted from the supplied point list.
static List<String> pointsToUsng(List<Point> points, SpatialReference inSR, int numberOfDigits, boolean roundToNearestWholeNumber, boolean addSpaces)
Returns a list of coordinate strings (USNG) which are converted from the supplied point list.
static List<String> pointsToUtm(List<Point> points, SpatialReference inSR, CoordinateConversion.UTMConversionMode conversionMode, boolean addSpaces)
Returns a list of coordinate strings (UTM) which are converted from the supplied point list.
static Point usngToPoint(String coordinate, SpatialReference outSR)
Returns a Point class in the specified output spatial reference which is converted from a USNG (United States National Grid) formatted string.
static List<Point> usngToPoints(List<String> coordinates, SpatialReference outSR)
Returns a Point class list in the specified output spatial reference which is converted from a list of USNG (United States National Grid) formatted strings.
static Point utmToPoint(String coordinate, SpatialReference outSR, CoordinateConversion.UTMConversionMode conversionMode)
Returns a Point class in the specified output spatial reference which is converted from a UTM (Universal Transverse Mercator) formatted string.
static List<Point> utmToPoints(List<String> coordinates, SpatialReference outSR, CoordinateConversion.UTMConversionMode conversionMode)
Returns a Point class list in the specified output spatial reference which is converted from a list of UTM (Universal Transverse Mercator) formatted strings.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public CoordinateConversion ()

Public Methods

public static Point decimalDegreesToPoint (String coordinate, SpatialReference outSR)

Returns a Point class in the specified output spatial reference which is converted from a Decimal Degrees formatted string.

Parameters
coordinate String: A Decimal Degrees formatted string e.g. "01.80N 000.90E"
outSR SpatialReference: The spatial reference of the returned Point
Returns
Point Point class if the conversion is successful.

public static List<Point> decimalDegreesToPoints (List<String> coordinates, SpatialReference outSR)

Returns a List of Point classes in the specified output spatial reference which are converted from a list of Decimal Degrees formatted strings.

Parameters
coordinates List: A list of Decimal Degrees formatted strings. e.g. "01.80N 000.90E"
outSR SpatialReference: The spatial reference of the returned Point
Returns
List<Point> Point class list if the conversion is successful.

public static Point degreesDecimalMinutesToPoint (String coordinate, SpatialReference outSR)

Returns a Point class in the specified output spatial reference which is converted from a Degrees Decimal Minutes formatted string.

Parameters
coordinate String: A Degrees Decimal Minutes formatted string
outSR SpatialReference: The spatial reference of the returned Point
Returns
Point Point class if the conversion is successful.

public static List<Point> degreesDecimalMinutesToPoints (List<String> coordinates, SpatialReference outSR)

Returns a List of Point classes in the specified output spatial reference which are converted from a list if Degrees Decimal Minutes formatted strings.

Parameters
coordinates List: A Degrees Decimal Minutes formatted string list
outSR SpatialReference: The spatial reference of the returned Point
Returns
List<Point> Point class list if the conversion is successful.

public static Point degreesMinutesSecondsToPoint (String coordinate, SpatialReference outSR)

Returns a Point class in the specified output spatial reference which is converted from a Degrees Minutes Seconds formatted string.

Parameters
coordinate String: A Degrees Decimal Minutes formatted string. e.g. "01 47 46.81N 000 53 53.94E"
outSR SpatialReference: The spatial reference of the returned Point
Returns
Point Point class if the conversion is successful.

public static List<Point> degreesMinutesSecondsToPoints (List<String> coordinates, SpatialReference outSR)

Returns a list of Point classes in the specified output spatial reference which are converted from a list of Degrees Minutes Seconds formatted strings.

Parameters
coordinates List: A list of Degrees Decimal Minutes formatted strings, e.g. "01 47 46.81N 000 53 53.94E"
outSR SpatialReference: The spatial reference of the returned Point
Returns
List<Point> Point class list if the conversion is successful.

public static Point garsToPoint (String coordinate, SpatialReference outSR, CoordinateConversion.GARSConversionMode conversionMode)

Returns a Point class in the specified output spatial reference which is converted from a GARS (Global Area Reference System) formatted string.

Parameters
coordinate String: A GARS formatted string. e.g. "362HR28"
outSR SpatialReference: The spatial reference of the returned Point
conversionMode CoordinateConversion.GARSConversionMode: the conversion mode used for the conversion
Returns
Point Point class if the conversion is successful.

public static List<Point> garsToPoints (List<String> coordinates, SpatialReference outSR, CoordinateConversion.GARSConversionMode conversionMode)

Returns a List of Point classes in the specified output spatial reference which are converted from a GARS (Global Area Reference System) formatted strings.

Parameters
coordinates List: A GARS formatted string list. e.g. "362HR28"
outSR SpatialReference: The spatial reference of the returned Point
conversionMode CoordinateConversion.GARSConversionMode: the conversion mode used for the conversion
Returns
List<Point> Point class list if the conversion is successful.

public static Point georefToPoint (String coordinate, SpatialReference outSR)

Returns a Point class in the specified output spatial reference which is converted from a Georef (World Geographic Reference System) formatted string.

Parameters
coordinate String: A Georef formatted string. e.g. "NGAB5448"
outSR SpatialReference: The spatial reference of the returned Point
Returns
Point Point class if the conversion is successful.

public static List<Point> georefToPoints (List<String> coordinates, SpatialReference outSR)

Returns a list of Point classes in the specified output spatial reference which are converted from a Georef (World Geographic Reference System) formatted string list.

Parameters
coordinates List: A Georef formatted string list. e.g. "NGAB5448"
outSR SpatialReference: The spatial reference of the returned Point
Returns
List<Point> Point class list if the conversion is successful.

public static Point mgrsToPoint (String coordinate, SpatialReference outSR, CoordinateConversion.MGRSConversionMode conversionMode)

Returns a Point class in the specified output spatial reference which is converted from a MGRS (Military Grid Reference System) formatted string.

Parameters
coordinate String: a MGRS formatted string. e.g. "31N BB 66 99"
outSR SpatialReference: The spatial reference of the returned Point
conversionMode CoordinateConversion.MGRSConversionMode: the conversion mode used
Returns
Point Point class if the conversion is successful.

public static List<Point> mgrsToPoints (List<String> coordinates, SpatialReference outSR, CoordinateConversion.MGRSConversionMode conversionMode)

Returns a list of Point classes in the specified output spatial reference which is converted from a list of MGRS (Military Grid Reference System) formatted strings.

Parameters
coordinates List: a list of MGRS formatted strings. e.g. "31N BB 66 99"
outSR SpatialReference: The spatial reference of the returned Point
conversionMode CoordinateConversion.MGRSConversionMode: the conversion mode used
Returns
List<Point> Point class list if the conversion is successful.

public static String pointToDecimalDegrees (Point point, SpatialReference inSR, int numberOfDigits)

Returns a coordinate string (Decimal Degrees) which is converted from the supplied point.

Parameters
point Point: a point to be converted
inSR SpatialReference: the spatial reference of the point
numberOfDigits int: the number of decimal places of each returned coordinate notation.
Returns
String String coordinate if the conversion is successful.

public static String pointToDegreesDecimalMinutes (Point point, SpatialReference inSR, int numberOfDigits)

Returns a coordinate string (Degrees Decimal Minutes) which is converted from the supplied point.

Parameters
point Point: a point to be converted
inSR SpatialReference: the spatial reference of the point
numberOfDigits int: the number of decimal places of each returned coordinate notation.
Returns
String String coordinate if the conversion is successful.

public static String pointToDegreesMinutesSeconds (Point point, SpatialReference inSR, int numberOfDigits)

Returns a coordinate string (Degree Minutes Seconds) which is converted from the supplied point.

Parameters
point Point: a point to be converted
inSR SpatialReference: the spatial reference of the point
numberOfDigits int: the number of decimal places of each returned coordinate notation.
Returns
String String coordinate if the conversion is successful.

public static String pointToGars (Point point, SpatialReference inSR)

Returns a coordinate string (GARS) which is converted from the supplied point.

Parameters
point Point: a point to be converted
inSR SpatialReference: the spatial reference of the point
Returns
String String coordinate if the conversion is successful.

public static String pointToGeoref (Point point, SpatialReference inSR, int numberOfDigits, boolean roundToNearestWholeNumber)

Returns a coordinate string (Georef) which is converted from the supplied point.

Parameters
point Point: a point to be converted
inSR SpatialReference: the spatial reference of the points
numberOfDigits int: the number of decimal places of each returned coordinate notation
roundToNearestWholeNumber boolean: specifies if the result is rounded to the nearest whole number
Returns
String String coordinate if the conversion is successful.

public static String pointToMgrs (Point point, SpatialReference inSR, CoordinateConversion.MGRSConversionMode conversionMode, int numberOfDigits, boolean roundToNearestWholeNumber, boolean addSpaces)

Returns a coordinate strings (MGRS) which is converted from the supplied point.

Parameters
point Point: a point to be converted
inSR SpatialReference: the spatial reference of the points
conversionMode CoordinateConversion.MGRSConversionMode: the MGRS conversion mode used
numberOfDigits int: the number of decimal places of each returned coordinate notation
roundToNearestWholeNumber boolean: specifies if the result is rounded to the nearest whole number
addSpaces boolean: specifies is the returned coordinates are padded with spaces
Returns
String String coordinate if the conversion is successful.

public static String pointToUsng (Point point, SpatialReference inSR, int numberOfDigits, boolean roundToNearestWholeNumber, boolean addSpaces)

Returns a coordinate string (USNG) which is converted from the supplied point.

Parameters
point Point: a point to be converted
inSR SpatialReference: the spatial reference of the points
numberOfDigits int: the number of decimal places of each returned coordinate notation
roundToNearestWholeNumber boolean: specifies if the result is rounded to the nearest whole number
addSpaces boolean: specifies is the returned coordinates are padded with spaces
Returns
String String coordinate if the conversion is successful.

public static String pointToUtm (Point point, SpatialReference inSR, CoordinateConversion.UTMConversionMode conversionMode, boolean addSpaces)

Returns a coordinate string (UTM) which is converted from the supplied point.

Parameters
point Point: a point to be converted
inSR SpatialReference: the spatial reference of the points
conversionMode CoordinateConversion.UTMConversionMode: the UTM conversion mode used
addSpaces boolean: specifies is the returned coordinates are padded with spaces
Returns
String String list of coordinates if the conversion is successful.

public static List<String> pointsToDecimalDegrees (List<Point> points, SpatialReference inSR, int numberOfDigits)

Returns a list of coordinate strings (Decimal Degrees) which are converted from the supplied point list.

Parameters
points List: a list of points to be converted
inSR SpatialReference: the spatial reference of the points
numberOfDigits int: the number of decimal places of each returned coordinate notation.
Returns
List<String> String list of coordinates if the conversion is successful.

public static List<String> pointsToDegreesDecimalMinutes (List<Point> points, SpatialReference inSR, int numberOfDigits)

Returns a list of coordinate strings (Degrees Decimal Minutes) which are converted from the supplied point list.

Parameters
points List: a list of points to be converted
inSR SpatialReference: the spatial reference of the points
numberOfDigits int: the number of decimal places of each returned coordinate notation.
Returns
List<String> String list of coordinates if the conversion is successful.

public static List<String> pointsToDegreesMinutesSeconds (List<Point> points, SpatialReference inSR, int numberOfDigits)

Returns a list of coordinate strings (Degree Minutes Seconds) which are converted from the supplied point list.

Parameters
points List: a list of points to be converted
inSR SpatialReference: the spatial reference of the points
numberOfDigits int: the number of decimal places of each returned coordinate notation.
Returns
List<String> String list of coordinates if the conversion is successful.

public static List<String> pointsToGars (List<Point> points, SpatialReference inSR)

Returns a list of coordinate strings (GARS) which are converted from the supplied point list.

Parameters
points List: a list of points to be converted
inSR SpatialReference: the spatial reference of the points
Returns
List<String> String list of coordinates if the conversion is successful.

public static List<String> pointsToGeoref (List<Point> points, SpatialReference inSR, int numberOfDigits, boolean roundToNearestWholeNumber)

Returns a list of coordinate strings (Georef) which are converted from the supplied point list.

Parameters
points List: a list of points to be converted
inSR SpatialReference: the spatial reference of the points
numberOfDigits int: the number of decimal places of each returned coordinate notation
roundToNearestWholeNumber boolean: specifies if the result is rounded to the nearest whole number
Returns
List<String> String list of coordinates if the conversion is successful.

public static List<String> pointsToMgrs (List<Point> points, SpatialReference inSR, CoordinateConversion.MGRSConversionMode conversionMode, int numberOfDigits, boolean roundToNearestWholeNumber, boolean addSpaces)

Returns a list of coordinate strings (MGRS) which are converted from the supplied point list.

Parameters
points List: a list of points to be converted
inSR SpatialReference: the spatial reference of the points
conversionMode CoordinateConversion.MGRSConversionMode: the MGRS conversion mode used
numberOfDigits int: the number of decimal places of each returned coordinate notation
roundToNearestWholeNumber boolean: specifies if the result is rounded to the nearest whole number
addSpaces boolean: specifies is the returned coordinates are padded with spaces
Returns
List<String> String list of coordinates if the conversion is successful.

public static List<String> pointsToUsng (List<Point> points, SpatialReference inSR, int numberOfDigits, boolean roundToNearestWholeNumber, boolean addSpaces)

Returns a list of coordinate strings (USNG) which are converted from the supplied point list.

Parameters
points List: a list of points to be converted
inSR SpatialReference: the spatial reference of the points
numberOfDigits int: the number of decimal places of each returned coordinate notation
roundToNearestWholeNumber boolean: specifies if the result is rounded to the nearest whole number
addSpaces boolean: specifies is the returned coordinates are padded with spaces
Returns
List<String> String list of coordinates if the conversion is successful.

public static List<String> pointsToUtm (List<Point> points, SpatialReference inSR, CoordinateConversion.UTMConversionMode conversionMode, boolean addSpaces)

Returns a list of coordinate strings (UTM) which are converted from the supplied point list.

Parameters
points List: a list of points to be converted
inSR SpatialReference: the spatial reference of the points
conversionMode CoordinateConversion.UTMConversionMode: the UTM conversion mode used
addSpaces boolean: specifies is the returned coordinates are padded with spaces
Returns
List<String> String list of coordinates if the conversion is successful.

public static Point usngToPoint (String coordinate, SpatialReference outSR)

Returns a Point class in the specified output spatial reference which is converted from a USNG (United States National Grid) formatted string.

Parameters
coordinate String: a USNG formatted string. e.g. "31N BB 66 99"
outSR SpatialReference: The spatial reference of the returned Point
Returns
Point Point class if the conversion is successful.

public static List<Point> usngToPoints (List<String> coordinates, SpatialReference outSR)

Returns a Point class list in the specified output spatial reference which is converted from a list of USNG (United States National Grid) formatted strings.

Parameters
coordinates List: a list of USNG formatted strings. e.g. "31N BB 66 99"
outSR SpatialReference: The spatial reference of the returned Point
Returns
List<Point> Point class list if the conversion is successful.

public static Point utmToPoint (String coordinate, SpatialReference outSR, CoordinateConversion.UTMConversionMode conversionMode)

Returns a Point class in the specified output spatial reference which is converted from a UTM (Universal Transverse Mercator) formatted string.

Parameters
coordinate String: a UTM formatted string. e.g. "31N 266196 0198684"
outSR SpatialReference: The spatial reference of the returned Point
conversionMode CoordinateConversion.UTMConversionMode: the UTM conversion mode to be used
Returns
Point Point class if the conversion is successful.

public static List<Point> utmToPoints (List<String> coordinates, SpatialReference outSR, CoordinateConversion.UTMConversionMode conversionMode)

Returns a Point class list in the specified output spatial reference which is converted from a list of UTM (Universal Transverse Mercator) formatted strings.

Parameters
coordinates List: a list of UTM formatted strings. e.g. "31N 266196 0198684"
outSR SpatialReference: The spatial reference of the returned Point
conversionMode CoordinateConversion.UTMConversionMode: the UTM conversion mode to be used
Returns
List<Point> Point class if the conversion is successful.