diff --git a/pom.xml b/pom.xml index cb0e07f..40b745e 100644 --- a/pom.xml +++ b/pom.xml @@ -1,7 +1,22 @@ - 4.0.0 - br.com.skywalker - coordinate-converter - 0.0.1-SNAPSHOT - Coordinate Converter - \ No newline at end of file + 4.0.0 + br.com.skywalker + coordinate-converter + 0.0.1-SNAPSHOT + Coordinate Converter + + + 1.8 + ${java.version} + ${java.version} + + + + + junit + junit + 4.13.1 + test + + + diff --git a/src/main/java/br/com/skywalker/coordinateconverter/Main.java b/src/main/java/br/com/skywalker/coordinateconverter/Main.java deleted file mode 100644 index 47dc39d..0000000 --- a/src/main/java/br/com/skywalker/coordinateconverter/Main.java +++ /dev/null @@ -1,38 +0,0 @@ -package br.com.skywalker.coordinateconverter; - -public class Main { - - public static void main(String[] args) { - - Datums toDatum = Datums.WGS84; - - DecimalDegreesCoordinates decimalDegreesCoordinates = new DecimalDegreesCoordinates(-46.17957, -23.51511, - Datums.SAD69); - DegreesMinutesSecondsCoordinates degreesMinutesSecondsCoordinates = new DegreesMinutesSecondsCoordinates( - decimalDegreesCoordinates); - System.out.printf("Decimal degree coordinate in Datum %s:\n %s.\n", - decimalDegreesCoordinates.getDatum().name(), decimalDegreesCoordinates); - System.out.printf("Converting decimal degree coordinate %s to DMS:\n %s.\n", decimalDegreesCoordinates, - new DegreesMinutesSecondsCoordinates(decimalDegreesCoordinates)); - System.out.printf("Converting back to decimal degree coordinate:\n %s.\n", - new DecimalDegreesCoordinates(degreesMinutesSecondsCoordinates)); - DecimalDegreesCoordinates toDatumDecimalDegreesCoordinates = decimalDegreesCoordinates.convertDatum(toDatum); - System.out.printf("In %s:\n %s.\n", toDatum.name(), toDatumDecimalDegreesCoordinates); - - System.out.println("=========="); - - double[] centralMeridian = decimalDegreesCoordinates.calculateCentralMeridian(); - System.out.printf("Central meridian: %.10f %.10f\n", centralMeridian[0], centralMeridian[1]); - - System.out.println("=========="); - - UTMCoordinates utmCoordinates = new UTMCoordinates(toDatumDecimalDegreesCoordinates); - System.out.printf("Converting decimal degree coordinate %s to UTM (%s to %s):\n %s.\n", - decimalDegreesCoordinates, decimalDegreesCoordinates.getDatum(), toDatum, utmCoordinates); - System.out.printf("Converting back to decimal degree coordinate from UTM:\n %s.\n", - new DecimalDegreesCoordinates(utmCoordinates)); - - - } - -} diff --git a/src/test/java/br/com/skywalker/coordinateconverter/CoordinatesConverterTest.java b/src/test/java/br/com/skywalker/coordinateconverter/CoordinatesConverterTest.java index dea89e0..f97c6ca 100644 --- a/src/test/java/br/com/skywalker/coordinateconverter/CoordinatesConverterTest.java +++ b/src/test/java/br/com/skywalker/coordinateconverter/CoordinatesConverterTest.java @@ -10,7 +10,7 @@ public class CoordinatesConverterTest { public void testDDToDMS() { DecimalDegreesCoordinates coordinates = new DecimalDegreesCoordinates(-46.1795700000, -23.5151100000, Datums.SAD69); - assertEquals("46° 10' 46,4520\" S 23° 30' 54,3960\" W", + assertEquals("46° 10' 46.4520\" S 23° 30' 54.3960\" W", CoordinatesConverter.toDMS(coordinates).toString()); } @@ -31,7 +31,7 @@ public void testDDToUTMCorregoAlegre() { assertEquals(305777.4495, utmCoordinates.getX(), 0.01); assertEquals(4882850.0889, utmCoordinates.getY(), 0.01); } - + @Test public void testDDToUTMWGS84() { DecimalDegreesCoordinates coordinates = new DecimalDegreesCoordinates(-46.1795700000, -23.5151100000, @@ -40,7 +40,7 @@ public void testDDToUTMWGS84() { assertEquals(305861.6300, utmCoordinates.getX(), 0.01); assertEquals(4882853.4451, utmCoordinates.getY(), 0.01); } - + @Test public void testDDToUTMSIRGAS2000() { DecimalDegreesCoordinates coordinates = new DecimalDegreesCoordinates(-46.1795700000, -23.5151100000,