List of usage examples for org.apache.commons.imaging.common RationalNumber doubleValue
@Override public double doubleValue()
From source file:slash.navigation.photo.PhotoFormat.java
private Double parseAltitude(TiffDirectory directory) throws ImageReadException { RationalNumber altitudeNumber = getFieldValue(directory, GPS_TAG_GPS_ALTITUDE); if (altitudeNumber == null) return null; double altitude = altitudeNumber.doubleValue(); Byte altitudeRef = directory.getFieldValue(GPS_TAG_GPS_ALTITUDE_REF); return altitudeRef == 1 ? -altitude : altitude; }
From source file:slash.navigation.photo.PhotoFormat.java
private Double parseSpeed(TiffDirectory directory) throws ImageReadException { RationalNumber speedNumber = getFieldValue(directory, GPS_TAG_GPS_SPEED); if (speedNumber == null) return null; double speed = speedNumber.doubleValue(); String speedRef = (String) directory.getFieldValue(GPS_TAG_GPS_SPEED_REF); if (speedRef != null) { if (GPS_TAG_GPS_SPEED_REF_VALUE_MPH.equals(speedRef)) speed = statuteMilesToKiloMeter(speed); else if (GPS_TAG_GPS_SPEED_REF_VALUE_KNOTS.equals(speedRef)) speed = nauticMilesToKiloMeter(speed); }/*w w w. j a v a 2s. c om*/ return speed; }
From source file:slash.navigation.photo.PhotoFormat.java
private Double parseDirection(TiffDirectory directory) throws ImageReadException { RationalNumber direction = getFieldValue(directory, GPS_TAG_GPS_IMG_DIRECTION); return direction != null ? direction.doubleValue() : null; }
From source file:slash.navigation.photo.PhotoFormat.java
private Double parseDOP(TiffDirectory directory) throws ImageReadException { RationalNumber dop = getFieldValue(directory, GPS_TAG_GPS_DOP); return dop != null ? dop.doubleValue() : null; }