Package org.openstreetmap.josm.data.gpx
Class GpxImageCorrelation
java.lang.Object
org.openstreetmap.josm.data.gpx.GpxImageCorrelation
Correlation logic for
CorrelateGpxWithImages.- Since:
- 14205
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static doublecomputeDirection(double direction, double angleOffset) Computes an adjusted direction by applying an angular offset and normalizing the result between 0° and 360°.(package private) static DoublegetElevation(WayPoint wp) Gets the elevation value from a WayPoint's attributes.(package private) static IntegergetGps2d3dMode(String prevGpsFixMode, String curGpsFixMode, List<String> positioningModes) Determines if the GNSS mode is 2d or 3d, based on previous and current GNSS fix modes.(package private) static DoubleRetrieves GPS Dilution of Precision (DOP) from a WayPoint's attributes.(package private) static StringgetGpsProcMethod(String prevGpsFixMode, String curGpsFixMode, List<String> positioningModes) Determines the GPS processing method based on previous and current GNSS fix modes.(package private) static DoublegetGpsTrack(WayPoint wp) Gets the track direction angle value from a waypoint in a GNSS track.(package private) static DoublegetHPosErr(WayPoint wp) Gets the horizontal positioning estimated error value from a WayPoint's attributes.private static intgetLastIndexOfListBefore(List<? extends GpxImageEntry> images, long searchedTime, TimeSource imgTimeSource) Finds the last image in the sorted image list which is before the given timeloadTracks(Collection<IGpxTrack> tracks) static intmatchGpxTrack(List<? extends GpxImageEntry> images, GpxData selectedGpx, GpxImageCorrelationSettings settings) Match a list of photos to a gpx track with given settings.private static intmatchPoints(List<? extends GpxImageEntry> images, WayPoint prevWp, long prevWpTime, WayPoint curWp, long curWpTime, TimeSource imgTimeSource, long offset, boolean interpolate, int tagTime, WayPoint nextWp, GpxImageDirectionPositionSettings dirpos, GpxImageDatumSettings datumSettings)
-
Constructor Details
-
GpxImageCorrelation
private GpxImageCorrelation()
-
-
Method Details
-
matchGpxTrack
public static int matchGpxTrack(List<? extends GpxImageEntry> images, GpxData selectedGpx, GpxImageCorrelationSettings settings) Match a list of photos to a gpx track with given settings. All images need a exifTime attribute and the List must be sorted according to these times.- Parameters:
images- images to matchselectedGpx- selected GPX datasettings- correlation settings- Returns:
- number of matched points
-
loadTracks
-
getElevation
Gets the elevation value from a WayPoint's attributes.- Parameters:
wp- the WayPoint- Returns:
- the WayPoint's elevation (in meters)
-
getHPosErr
Gets the horizontal positioning estimated error value from a WayPoint's attributes.- Parameters:
wp- the WayPoint- Returns:
- the WayPoint's horizontal positioning error (in meters)
- Since:
- 19387
-
getGpsDop
Retrieves GPS Dilution of Precision (DOP) from a WayPoint's attributes. Checks for Position DOP (PDOP) first, then falls back to Horizontal DOP (HDOP) if PDOP isn't available. Converts Float values to Double for consistent return type.- Parameters:
wp- the WayPoint- Returns:
- the WayPoint's DOP value as Double (PDOP preferred, HDOP fallback)
- Since:
- 19387
-
getGpsTrack
Gets the track direction angle value from a waypoint in a GNSS track. This angle is the GNSS receiver movement direction.- Parameters:
wp- the waypoint- Returns:
- the waypoint direction (in degrees)
- Since:
- 19387
-
getGpsProcMethod
static String getGpsProcMethod(String prevGpsFixMode, String curGpsFixMode, List<String> positioningModes) Determines the GPS processing method based on previous and current GNSS fix modes. This method compares the positioning modes of the previous and current GNSS fixes, selects the most basic processing method (lowest index in positioningModes list), and formats the output string according to predefined conventions. Because the returned processing method depends on a time correlation between an image and a waypoint timestamp, the term 'CORRELATION' is added.- Parameters:
prevGpsFixMode- the previous GNSS fix mode (e.g., "SINGLE", "DGNSS", "RTK_FIX")curGpsFixMode- the current GNSS fix modepositioningModes- list of positioning modes ordered by accuracy- Returns:
- formatted processing method string
- Since:
- 19387
-
getGps2d3dMode
static Integer getGps2d3dMode(String prevGpsFixMode, String curGpsFixMode, List<String> positioningModes) Determines if the GNSS mode is 2d or 3d, based on previous and current GNSS fix modes. This method compares the positioning modes of the previous and current GNSS fixes, selects the most basic processing method (lowest index in positioningModes list), and return the lowest value between 2d or 3d mode, or null if it's not a gnss mode (e.g. estimated, manual).- Parameters:
prevGpsFixMode- the previous GNSS modecurGpsFixMode- the current GNSS modepositioningModes- list of positioning modes ordered by accuracy- Returns:
- 2 for 2d, 3 for 3d, or null
- Since:
- 19387
-
matchPoints
private static int matchPoints(List<? extends GpxImageEntry> images, WayPoint prevWp, long prevWpTime, WayPoint curWp, long curWpTime, TimeSource imgTimeSource, long offset, boolean interpolate, int tagTime, WayPoint nextWp, GpxImageDirectionPositionSettings dirpos, GpxImageDatumSettings datumSettings) -
computeDirection
Computes an adjusted direction by applying an angular offset and normalizing the result between 0° and 360°.- Parameters:
direction- initial direction angle (in radians)angleOffset- angular offset to apply (in degrees)- Returns:
- resulting direction normalized to the range [0, 360) degrees
-
getLastIndexOfListBefore
private static int getLastIndexOfListBefore(List<? extends GpxImageEntry> images, long searchedTime, TimeSource imgTimeSource) Finds the last image in the sorted image list which is before the given time- Parameters:
images- list of imagessearchedTime- time to search- Returns:
- index of last image before given time
-