diff --git a/importPicture/src/osm/jp/gpx/ImportPicture.java b/importPicture/src/osm/jp/gpx/ImportPicture.java index 6bde0cc..e05b155 100644 --- a/importPicture/src/osm/jp/gpx/ImportPicture.java +++ b/importPicture/src/osm/jp/gpx/ImportPicture.java @@ -1,8 +1,6 @@ package osm.jp.gpx; import java.io.*; -import java.math.BigDecimal; -import java.math.RoundingMode; import java.nio.channels.FileChannel; import java.text.DateFormat; import java.text.DecimalFormat; @@ -298,10 +296,6 @@ public static final String TIME_FORMAT_STRING = "yyyy-MM-dd'T'HH:mm:ss'Z'"; private static final String EXIF_DATE_TIME_FORMAT_STRING = "yyyy:MM:dd HH:mm:ss"; - //public static final SimpleDateFormat DATE_PARSE = new SimpleDateFormat(TIME_FORMAT_STRING +" Z"); - //public static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat(TIME_FORMAT_STRING); - //public static final SimpleDateFormat EXIF_DATE_TIME_PARSE = new SimpleDateFormat(EXIF_DATE_TIME_FORMAT_STRING + " Z"); - //public static final SimpleDateFormat EXIF_DATE_TIME_FORMAT = new SimpleDateFormat(EXIF_DATE_TIME_FORMAT_STRING); @Override public void run() { @@ -571,46 +565,6 @@ //---- EXIF GPS_ ---- longitude = Math.abs(longitude); latitude = Math.abs(latitude); - - /* - final String longitudeRef = (longitude < 0 ? "W" : "E"); - final String latitudeRef = (latitude < 0 ? "S" : "N"); - gpsDir.removeField(GpsTagConstants.GPS_TAG_GPS_LONGITUDE_REF); - gpsDir.add(GpsTagConstants.GPS_TAG_GPS_LONGITUDE_REF, longitudeRef); - gpsDir.removeField(GpsTagConstants.GPS_TAG_GPS_LATITUDE_REF); - gpsDir.add(GpsTagConstants.GPS_TAG_GPS_LATITUDE_REF, latitudeRef); - { - BigDecimal value = BigDecimal.valueOf(longitude); - - final double longitudeDegrees = (value.setScale(0, RoundingMode.DOWN)).doubleValue(); - value = value.subtract(BigDecimal.valueOf(longitudeDegrees)); - value = value.multiply(BigDecimal.valueOf(60)); - final double longitudeMinutes = (value.setScale(0, RoundingMode.DOWN)).doubleValue(); - value = value.subtract(BigDecimal.valueOf(longitudeMinutes)); - value = value.multiply(BigDecimal.valueOf(60)); - final double longitudeSeconds = (value.setScale(3, BigDecimal.ROUND_HALF_UP)).doubleValue(); - gpsDir.removeField(GpsTagConstants.GPS_TAG_GPS_LONGITUDE); - gpsDir.add(GpsTagConstants.GPS_TAG_GPS_LONGITUDE, - RationalNumber.valueOf(longitudeDegrees), - RationalNumber.valueOf(longitudeMinutes), - RationalNumber.valueOf(longitudeSeconds)); - } - { - BigDecimal value = BigDecimal.valueOf(latitude); - final double latitudeDegrees = (value.setScale(0, RoundingMode.DOWN)).doubleValue(); - value = value.subtract(BigDecimal.valueOf(latitudeDegrees)); - value = value.multiply(BigDecimal.valueOf(60)); - final double latitudeMinutes = (value.setScale(0, RoundingMode.DOWN)).doubleValue(); - value = value.subtract(BigDecimal.valueOf(latitudeMinutes)); - value = value.multiply(BigDecimal.valueOf(60)); - final double latitudeSeconds = (value.setScale(3, BigDecimal.ROUND_HALF_UP)).doubleValue(); - gpsDir.removeField(GpsTagConstants.GPS_TAG_GPS_LATITUDE); - gpsDir.add(GpsTagConstants.GPS_TAG_GPS_LATITUDE, - RationalNumber.valueOf(latitudeDegrees), - RationalNumber.valueOf(latitudeMinutes), - RationalNumber.valueOf(latitudeSeconds)); - } - */ outputSet.setGPSInDegrees(longitude, latitude); } @@ -784,7 +738,6 @@ */ public static String toEXIFString(Date localdate) { DateFormat dfUTC = new SimpleDateFormat(EXIF_DATE_TIME_FORMAT_STRING); - //dfUTC.setTimeZone(TimeZone.getTimeZone("UTC")); return dfUTC.format(localdate); }