Changeset 5242 in josm


Ignore:
Timestamp:
May 24, 2012 8:27:56 PM (12 months ago)
Author:
bastiK
Message:

fixed #7711 - Extract altitude from photos and GPX track

Location:
trunk/src/org/openstreetmap/josm/gui/layer/geoimage
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImages.java

    r5222 r5242  
    12501250                curImg.tmp.setSpeed(speed); 
    12511251                if (curElevation != null && prevElevation != null) { 
    1252                     curImg.setElevation(prevElevation + (curElevation - prevElevation) * timeDiff); 
     1252                    curImg.tmp.setElevation(prevElevation + (curElevation - prevElevation) * timeDiff); 
    12531253                } 
    12541254                curImg.tmp.setGpsTime(new Date(curImg.getExifTime().getTime() - offset)); 
  • trunk/src/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayer.java

    r4977 r5242  
    537537 
    538538        try { 
     539            double ele=dirGps.getDouble(GpsDirectory.TAG_GPS_ALTITUDE); 
     540            int d = dirGps.getInt(GpsDirectory.TAG_GPS_ALTITUDE_REF); 
     541            if (d == 1) { 
     542                ele *= -1; 
     543            } 
     544            e.setElevation(ele); 
     545        } catch (MetadataException ex) { 
     546        } 
     547 
     548        try { 
    539549            // longitude 
    540550 
     
    596606            } 
    597607        } catch (Exception ex) { // (other exceptions, e.g. #5271) 
    598             System.err.println("Error when reading EXIF from file: "+ex); 
     608            System.err.println("Error reading EXIF from file: "+ex); 
    599609            e.setExifCoor(null); 
    600610            e.setPos(null); 
Note: See TracChangeset for help on using the changeset viewer.