}
private static Wpt wptFromGpsTag(Directory gps) throws MetadataException{
Wpt result = null;
if(!gps.containsTag(GpsDirectory.TAG_GPS_LATITUDE)){
throw new MetadataException("GPS latitude missing.");
}
if(!gps.containsTag(GpsDirectory.TAG_GPS_LATITUDE_REF)){
throw new MetadataException("GPS latitude reference missing.");
}
if(!gps.containsTag(GpsDirectory.TAG_GPS_LONGITUDE)){
throw new MetadataException("GPS longitude missing.");
}
if(!gps.containsTag(GpsDirectory.TAG_GPS_LONGITUDE_REF)){
throw new MetadataException("GPS longitude reference missing.");
}
result = new Wpt();
result.setLat(
asBigDecimal(
gps.getRationalArray(GpsDirectory.TAG_GPS_LATITUDE),