Ticket #24238: ticket_24238_javadoc.patch

File ticket_24238_javadoc.patch, 4.9 KB (added by StephaneP, 13 months ago)

javadoc for GpxImageCorrelation.java

  • src/org/openstreetmap/josm/data/gpx/GpxImageCorrelation.java

    diff --git a/src/org/openstreetmap/josm/data/gpx/GpxImageCorrelation.java b/src/org/openstreetmap/josm/data/gpx/GpxImageCorrelation.java
    index 112e0c4c57..663d27dac5 100644
    a b public final class GpxImageCorrelation {  
    200200        return trks;
    201201    }
    202202
     203    /**
     204     * Gets the elevation value from a WayPoint's attributes.
     205     * @param wp the WayPoint
     206     * @return the WayPoint's elevation (in meters)
     207     */
    203208    static Double getElevation(WayPoint wp) {
    204209        if (wp != null) {
    205210            String value = wp.getString(GpxConstants.PT_ELE);
    public final class GpxImageCorrelation {  
    214219        return null;
    215220    }
    216221
     222    /**
     223     * Gets the horizontal positionning estimated error value from a WayPoint's attributes.
     224     * @param wp the WayPoint
     225     * @return the WayPoint's horizontal positionning error (in meters)
     226     * @since 19387
     227     */
    217228    static Double getHPosErr(WayPoint wp) {
    218229        if (wp != null) {
    219230            if (wp.attr.get(GpxConstants.PT_STD_HDEV) instanceof Float) {
    public final class GpxImageCorrelation {  
    231242        return null;
    232243    }
    233244
     245    /**
     246     * Retrieves GPS Dilution of Precision (DOP) from a WayPoint's attributes.
     247     * Checks for Position DOP (PDOP) first, then falls back to Horizontal DOP (HDOP) if PDOP isn't available.
     248     * Converts Float values to Double for consistent return type.
     249     * @param wp the WayPoint
     250     * @return the WayPoint's DOP value as Double (PDOP preferred, HDOP fallback)
     251     * @since 19387
     252     */
    234253    static Double getGpsDop(WayPoint wp) {
    235254        if (wp != null) {
    236255            if (wp.attr.get(GpxConstants.PT_PDOP) != null) {
    public final class GpxImageCorrelation {  
    252271        return null;
    253272    }
    254273
     274    /**
     275     * Gets the track direction angle value from a waypoint in a GNSS track.
     276     * This angle is the GNSS receiver movement direction.
     277     * @param wp the waypoint
     278     * @return the waypoint direction (in degrees)
     279     * @since 19387
     280     */
    255281    static Double getGpsTrack(WayPoint wp) {
    256282        if (wp != null) {
    257283            String trackvalue = wp.getString(GpxConstants.PT_COURSE);
    public final class GpxImageCorrelation {  
    267293        return null;
    268294    }
    269295
     296    /**
     297     * Determines the GPS processing method based on previous and current GNSS fix modes.
     298     * This method compares the positioning modes of the previous and current GNSS fixes,
     299     * selects the most basic processing method (lowest index in positioningModes list),
     300     * and formats the output string according to predefined conventions.
     301     * Because the returned processing method depends on a time correlation between an image
     302     * and a waypoint timestamp, the term 'CORRELATION' is added.
     303     * @param prevGpsFixMode the previous GNSS fix mode (e.g., "SINGLE", "DGNSS", "RTK_FIX")
     304     * @param curGpsFixMode the current GNSS fix mode
     305     * @param positioningModes list of positioning modes ordered by accuracy
     306     * @return formatted processing method string
     307     * @since 19387
     308     */
    270309    static String getGpsProcMethod(String prevGpsFixMode, final String curGpsFixMode,
    271310                                    final List<String> positioningModes) {
    272311        String gpsProcMethod = null;
    public final class GpxImageCorrelation {  
    291330        return gpsProcMethod;
    292331    }
    293332
     333    /**
     334     * Determines if the GNSS mode is 2d or 3d, based on previous and current GNSS fix modes.
     335     * This method compares the positioning modes of the previous and current GNSS fixes,
     336     * selects the most basic processing method (lowest index in positioningModes list),
     337     * and return the lowest value between 2d or 3d mode, or null if it's not a gnss mode (e.g. estimated, manual).
     338     * @param prevGpsFixMode the previous GNSS mode
     339     * @param curGpsFixMode the current GNSS mode
     340     * @param positioningModes list of positioning modes ordered by accuracy
     341     * @return 2 for 2d, 3 for 3d, or null
     342     * @since 19387
     343     */
    294344    static Integer getGps2d3dMode(String prevGpsFixMode, final String curGpsFixMode,
    295345                                final List<String> positioningModes) {
    296346        Integer lowestMode = null;
    public final class GpxImageCorrelation {  
    512562    }
    513563    // CHECKSTYLE.ON: ParameterNumber
    514564
     565    /**
     566     * Computes an adjusted direction by applying an angular offset and normalizing the result between 0° and 360°.
     567     * @param direction initial direction angle (in radians)
     568     * @param angleOffset angular offset to apply (in degrees)
     569     * @return resulting direction normalized to the range [0, 360) degrees
     570     */
    515571    private static double computeDirection(double direction, double angleOffset) {
    516572        return (Utils.toDegrees(direction) + angleOffset) % 360d;
    517573    }