Class GpxImageCorrelation

java.lang.Object
org.openstreetmap.josm.data.gpx.GpxImageCorrelation

public final class GpxImageCorrelation extends Object
Correlation logic for CorrelateGpxWithImages.
Since:
14205
  • Constructor Details

  • 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 match
      selectedGpx - selected GPX data
      settings - 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

      static 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 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

      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 mode
      positioningModes - 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 mode
      curGpsFixMode - the current GNSS mode
      positioningModes - 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

      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(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 images
      searchedTime - time to search
      Returns:
      index of last image before given time