Many of the ArcGIS Military Analyst and MOLE extension application programming interface (API) objects you have used in the past have equivalent or near equivalent objects in the ArcGIS 10 ArcObjects API. These new objects should now be used and do not require a Military Analyst extension or MOLE extension license. See Migrating from Military Analyst and MOLE for information on how to accomplish tasks in ArcGIS 10 that previously required the Military Analyst and MOLE APIs.
How to use:
- In your project, add a reference to the ESRI Defense Solutions jar.
- Copy and paste the sample code into your project.
- Compile and run your project.
public static void convertCoordDMS(){
try{
// create coordinate object for degrees, minutes, seconds format
DMSCoordinate dmsCoord = new DMSCoordinate();
dmsCoord.setString("37 -123 32 34.43"); // put a string value
String dms = dmsCoord.getString(); // get back the normalized DMS string
System.out.println("Input (string): (\"37 -123 32 34.43\")");
System.out.println("Output (normalized string): " + dms + '\n');
// now for decimal degrees
DDCoordinate ddCoord = new DDCoordinate();
// put in the Point from dmsCoord. The Point property is
// “common ground” for all Coordinate objects
IPoint point = null;
ddCoord.setPoint(dmsCoord.getPoint());
// get back the normalized DD string
String dd = ddCoord.getString();
System.out.println("Input (Point): same as DMS");
System.out.println("Output (normalized string): " + dd + '\n');
// and the coordinate as lon lat doubles
double[] x = new double[25];
double[] y = new double[25];
ddCoord.getCoords(x, y);
System.out.println("Input (Point): same as DMS");
System.out.println("Output (Lat Lon): " + x + " " + y);
}
catch (Exception ex){
ex.printStackTrace();
}
}
See Also:
Sample: How to convert coordinate arrays
Sample: How to convert from MGRS in Indian 1960 (ING-A) to Lat-Lon (DMS and DD) in WGS 1984
Sample: How to normalize Decimal Degree coordinates
Development licensing | Deployment licensing |
---|---|
Engine Developer Kit: Military Analyst | Engine Runtime: Military Analyst |