Package org.openstreetmap.josm.data.gpx
Class GpxImageCorrelation
- java.lang.Object
-
- org.openstreetmap.josm.data.gpx.GpxImageCorrelation
-
public final class GpxImageCorrelation extends java.lang.Object
Correlation logic forCorrelateGpxWithImages
.- Since:
- 14205
-
-
Constructor Summary
Constructors Modifier Constructor Description private
GpxImageCorrelation()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static double
computeDirection(double direction, double angleOffset)
Computes an adjusted direction by applying an angular offset and normalizing the result between 0° and 360°.(package private) static java.lang.Double
getElevation(WayPoint wp)
Gets the elevation value from a WayPoint's attributes.(package private) static java.lang.Integer
getGps2d3dMode(java.lang.String prevGpsFixMode, java.lang.String curGpsFixMode, java.util.List<java.lang.String> positioningModes)
Determines if the GNSS mode is 2d or 3d, based on previous and current GNSS fix modes.(package private) static java.lang.Double
getGpsDop(WayPoint wp)
Retrieves GPS Dilution of Precision (DOP) from a WayPoint's attributes.(package private) static java.lang.String
getGpsProcMethod(java.lang.String prevGpsFixMode, java.lang.String curGpsFixMode, java.util.List<java.lang.String> positioningModes)
Determines the GPS processing method based on previous and current GNSS fix modes.(package private) static java.lang.Double
getGpsTrack(WayPoint wp)
Gets the track direction angle value from a waypoint in a GNSS track.(package private) static java.lang.Double
getHPosErr(WayPoint wp)
Gets the horizontal positioning estimated error value from a WayPoint's attributes.private static int
getLastIndexOfListBefore(java.util.List<? extends GpxImageEntry> images, long searchedTime, TimeSource imgTimeSource)
Finds the last image in the sorted image list which is before the given time(package private) static java.util.List<java.util.List<java.util.List<WayPoint>>>
loadTracks(java.util.Collection<IGpxTrack> tracks)
static int
matchGpxTrack(java.util.List<? extends GpxImageEntry> images, GpxData selectedGpx, GpxImageCorrelationSettings settings)
Match a list of photos to a gpx track with given settings.private static int
matchPoints(java.util.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 Detail
-
GpxImageCorrelation
private GpxImageCorrelation()
-
-
Method Detail
-
matchGpxTrack
public static int matchGpxTrack(java.util.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
static java.util.List<java.util.List<java.util.List<WayPoint>>> loadTracks(java.util.Collection<IGpxTrack> tracks)
-
getElevation
static java.lang.Double getElevation(WayPoint wp)
Gets the elevation value from a WayPoint's attributes.- Parameters:
wp
- the WayPoint- Returns:
- the WayPoint's elevation (in meters)
-
getHPosErr
static java.lang.Double getHPosErr(WayPoint wp)
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
static java.lang.Double getGpsDop(WayPoint wp)
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
static java.lang.Double getGpsTrack(WayPoint wp)
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 java.lang.String getGpsProcMethod(java.lang.String prevGpsFixMode, java.lang.String curGpsFixMode, java.util.List<java.lang.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 java.lang.Integer getGps2d3dMode(java.lang.String prevGpsFixMode, java.lang.String curGpsFixMode, java.util.List<java.lang.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(java.util.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
private static double computeDirection(double direction, double angleOffset)
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(java.util.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
-
-