OSDN Git Service

LAT,LONの精度UP
[importpicture/importpicture.git] / importPicture / src / osm / jp / gpx / ImportPicture.java
index 5586322..6bde0cc 100644 (file)
@@ -569,11 +569,12 @@ public class ImportPicture extends Thread {
                        }\r
        \r
                        //---- EXIF GPS_ ----\r
-                    final String longitudeRef = (longitude < 0 ? "W" : "E");\r
                     longitude = Math.abs(longitude);\r
-                    final String latitudeRef = (latitude < 0 ? "S" : "N");\r
                     latitude = Math.abs(latitude);\r
 \r
+                    /*\r
+                    final String longitudeRef = (longitude < 0 ? "W" : "E");\r
+                    final String latitudeRef = (latitude < 0 ? "S" : "N");\r
                     gpsDir.removeField(GpsTagConstants.GPS_TAG_GPS_LONGITUDE_REF);\r
                     gpsDir.add(GpsTagConstants.GPS_TAG_GPS_LONGITUDE_REF, longitudeRef);\r
                     gpsDir.removeField(GpsTagConstants.GPS_TAG_GPS_LATITUDE_REF);\r
@@ -587,7 +588,7 @@ public class ImportPicture extends Thread {
                         final double longitudeMinutes = (value.setScale(0, RoundingMode.DOWN)).doubleValue();\r
                         value = value.subtract(BigDecimal.valueOf(longitudeMinutes));\r
                         value = value.multiply(BigDecimal.valueOf(60));\r
-                        final double longitudeSeconds = (value.setScale(0, RoundingMode.DOWN)).doubleValue();\r
+                        final double longitudeSeconds = (value.setScale(3, BigDecimal.ROUND_HALF_UP)).doubleValue();\r
                         gpsDir.removeField(GpsTagConstants.GPS_TAG_GPS_LONGITUDE);\r
                         gpsDir.add(GpsTagConstants.GPS_TAG_GPS_LONGITUDE,\r
                                 RationalNumber.valueOf(longitudeDegrees),\r
@@ -602,12 +603,15 @@ public class ImportPicture extends Thread {
                         final double latitudeMinutes = (value.setScale(0, RoundingMode.DOWN)).doubleValue();\r
                         value = value.subtract(BigDecimal.valueOf(latitudeMinutes));\r
                         value = value.multiply(BigDecimal.valueOf(60));\r
-                        final double latitudeSeconds = (value.setScale(0, RoundingMode.DOWN)).doubleValue();                        gpsDir.removeField(GpsTagConstants.GPS_TAG_GPS_LATITUDE);\r
+                        final double latitudeSeconds = (value.setScale(3, BigDecimal.ROUND_HALF_UP)).doubleValue();\r
+                        gpsDir.removeField(GpsTagConstants.GPS_TAG_GPS_LATITUDE);\r
                         gpsDir.add(GpsTagConstants.GPS_TAG_GPS_LATITUDE,\r
                                 RationalNumber.valueOf(latitudeDegrees),\r
                                 RationalNumber.valueOf(latitudeMinutes),\r
                                 RationalNumber.valueOf(latitudeSeconds));\r
                     }\r
+                    */\r
+                    outputSet.setGPSInDegrees(longitude, latitude);\r
                 }\r
 \r
                 ExifRewriter rewriter = new ExifRewriter();\r