/** * Creates and sets all to the GPS tags for a give latitude and longitude. * * @param latitude a GPS latitude coordinate. * @param longitude a GPS longitude coordinate. * @return true if success, false if they could not be created or set. */ @SuppressWarnings( "unused" ) public boolean addGpsTags( double latitude, double longitude ) { ExifTag latTag = buildTag( TAG_GPS_LATITUDE, toExifLatLong( latitude ) ); ExifTag longTag = buildTag( TAG_GPS_LONGITUDE, toExifLatLong( longitude ) ); ExifTag latRefTag = buildTag( TAG_GPS_LATITUDE_REF, latitude >= 0 ? GpsLatitudeRef.NORTH : GpsLatitudeRef.SOUTH ); ExifTag longRefTag = buildTag( TAG_GPS_LONGITUDE_REF, longitude >= 0 ? GpsLongitudeRef.EAST : GpsLongitudeRef.WEST ); if( latTag == null || longTag == null || latRefTag == null || longRefTag == null ) { return false; } setTag( latTag ); setTag( longTag ); setTag( latRefTag ); setTag( longRefTag ); return true; }
/** * Creates and sets all to the GPS tags for a give latitude and longitude. * * @param latitude a GPS latitude coordinate. * @param longitude a GPS longitude coordinate. * @return true if success, false if they could not be created or set. */ @SuppressWarnings( "unused" ) public boolean addGpsTags( double latitude, double longitude ) { ExifTag latTag = buildTag( TAG_GPS_LATITUDE, toExifLatLong( latitude ) ); ExifTag longTag = buildTag( TAG_GPS_LONGITUDE, toExifLatLong( longitude ) ); ExifTag latRefTag = buildTag( TAG_GPS_LATITUDE_REF, latitude >= 0 ? GpsLatitudeRef.NORTH : GpsLatitudeRef.SOUTH ); ExifTag longRefTag = buildTag( TAG_GPS_LONGITUDE_REF, longitude >= 0 ? GpsLongitudeRef.EAST : GpsLongitudeRef.WEST ); if( latTag == null || longTag == null || latRefTag == null || longRefTag == null ) { return false; } setTag( latTag ); setTag( longTag ); setTag( latRefTag ); setTag( longRefTag ); return true; }