Changeset 19316 in josm for trunk


Ignore:
Timestamp:
2025-02-14T10:20:59+01:00 (10 days ago)
Author:
stoecker
Message:

support 2 more circle drawing data sources for NMEA, patch by StephaneP (slightly modified), fix #21007

Location:
trunk
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/Preferences.java

    r19179 r19316  
    8686    /** remove if key equals */
    8787    private static final String[] OBSOLETE_PREF_KEYS = {
    88         "remotecontrol.https.enabled", /* remove entry after Dec. 2019 */
    89         "remotecontrol.https.port", /* remove entry after Dec. 2019 */
    90         "curves.circlearc.angle-separation", // see #19076
    91         "update.selected.complete-relation" // see #19124
     88        // nothing ATM
    9289    };
    9390
    9491    /** remove if key starts with */
    9592    private static final String[] OBSOLETE_PREF_KEYS_START = {
    96             //only remove layer specific prefs
    97             "draw.rawgps.layer.wpt.",
    98             "draw.rawgps.layer.audiowpt.",
    99             "draw.rawgps.lines.force.",
    100             "draw.rawgps.lines.alpha-blend.",
    101             "draw.rawgps.lines.",
    102             "markers.show ", //uses space as separator
    103             "marker.makeautomarker.",
    104             "clr.layer.",
    105 
    106             //remove both layer specific and global prefs
    107             "draw.rawgps.colors",
    108             "draw.rawgps.direction",
    109             "draw.rawgps.alternatedirection",
    110             "draw.rawgps.linewidth",
    111             "draw.rawgps.max-line-length.local",
    112             "draw.rawgps.max-line-length",
    113             "draw.rawgps.large",
    114             "draw.rawgps.large.size",
    115             "draw.rawgps.hdopcircle",
    116             "draw.rawgps.min-arrow-distance",
    117             "draw.rawgps.colorTracksTune",
    118             "draw.rawgps.colors.dynamic",
    119             "draw.rawgps.lines.local",
    120             "draw.rawgps.heatmap"
     93        // nothing ATM
    12194    };
    12295
    12396    /** keep subkey even if it starts with any of {@link #OBSOLETE_PREF_KEYS_START} */
    12497    private static final List<String> KEEP_PREF_KEYS = Arrays.asList(
    125             "draw.rawgps.lines.alpha-blend",
    126             "draw.rawgps.lines.arrows",
    127             "draw.rawgps.lines.arrows.fast",
    128             "draw.rawgps.lines.arrows.min-distance",
    129             "draw.rawgps.lines.force",
    130             "draw.rawgps.lines.max-length",
    131             "draw.rawgps.lines.max-length.local",
    132             "draw.rawgps.lines.width"
     98        // nothing ATM
    13399    );
    134100
     
    138104    private static Map<String, String> getUpdatePrefKeys() {
    139105        HashMap<String, String> m = new HashMap<>();
    140         m.put("draw.rawgps.direction", "draw.rawgps.lines.arrows");
    141         m.put("draw.rawgps.alternatedirection", "draw.rawgps.lines.arrows.fast");
    142         m.put("draw.rawgps.min-arrow-distance", "draw.rawgps.lines.arrows.min-distance");
    143         m.put("draw.rawgps.linewidth", "draw.rawgps.lines.width");
    144         m.put("draw.rawgps.max-line-length.local", "draw.rawgps.lines.max-length.local");
    145         m.put("draw.rawgps.max-line-length", "draw.rawgps.lines.max-length");
    146         m.put("draw.rawgps.large", "draw.rawgps.points.large");
    147         m.put("draw.rawgps.large.alpha", "draw.rawgps.points.large.alpha");
    148         m.put("draw.rawgps.large.size", "draw.rawgps.points.large.size");
    149         m.put("draw.rawgps.hdopcircle", "draw.rawgps.points.hdopcircle");
    150         m.put("draw.rawgps.layer.wpt.pattern", "draw.rawgps.markers.pattern");
    151         m.put("draw.rawgps.layer.audiowpt.pattern", "draw.rawgps.markers.audio.pattern");
    152         m.put("draw.rawgps.colors", "draw.rawgps.colormode");
    153         m.put("draw.rawgps.colorTracksTune", "draw.rawgps.colormode.velocity.tune");
    154         m.put("draw.rawgps.colors.dynamic", "draw.rawgps.colormode.dynamic-range");
    155         m.put("draw.rawgps.heatmap.line-extra", "draw.rawgps.colormode.heatmap.line-extra");
    156         m.put("draw.rawgps.heatmap.colormap", "draw.rawgps.colormode.heatmap.colormap");
    157         m.put("draw.rawgps.heatmap.use-points", "draw.rawgps.colormode.heatmap.use-points");
    158         m.put("draw.rawgps.heatmap.gain", "draw.rawgps.colormode.heatmap.gain");
    159         m.put("draw.rawgps.heatmap.lower-limit", "draw.rawgps.colormode.heatmap.lower-limit");
    160         m.put("draw.rawgps.date-coloring-min-dt", "draw.rawgps.colormode.time.min-distance");
     106        m.put("hdop.color.alpha", "circle.color.alpha");
     107        m.put("points.hdopcircle", "points.circle");
    161108        return Collections.unmodifiableMap(m);
    162109    }
  • trunk/src/org/openstreetmap/josm/data/gpx/GpxConstants.java

    r18396 r19316  
    179179    String PT_DGPSID = "dgpsid";
    180180
     181    /** Standard horizontal major deviation */
     182    String PT_STD_HDEV = "stdhdev";
     183   
     184    /** Standard vertical major deviation */
     185    String PT_STD_VDEV = "stdvdev";
     186   
    181187    /**
    182188     * Ordered list of all possible waypoint keys.
     
    184190    List<String> WPT_KEYS = Collections.unmodifiableList(Arrays.asList(PT_ELE, PT_TIME, PT_MAGVAR, PT_GEOIDHEIGHT,
    185191            GPX_NAME, GPX_CMT, GPX_DESC, GPX_SRC, META_LINKS, PT_SYM, PT_TYPE,
    186             PT_FIX, PT_SAT, PT_HDOP, PT_VDOP, PT_PDOP, PT_AGEOFDGPSDATA, PT_DGPSID));
     192            PT_FIX, PT_SAT, PT_HDOP, PT_VDOP, PT_PDOP, PT_AGEOFDGPSDATA, PT_DGPSID, PT_STD_HDEV, PT_STD_VDEV));
    187193
    188194    /**
  • trunk/src/org/openstreetmap/josm/gui/layer/gpx/GpxDrawHelper.java

    r19238 r19316  
    9292    private boolean large;
    9393    private int largesize;
    94     private boolean hdopCircle;
     94    private boolean drawCircle;
     95    private int circleDataSource;
    9596    /** paint direction arrow with alternate math. may be faster **/
    9697    private boolean arrowsFast;
     
    138139    private ColorScale directionScale;
    139140
    140     /** Opacity for hdop points **/
    141     private int hdopAlpha;
     141    /** Opacity for circle points **/
     142    private int circleAlpha;
    142143
    143144    // lookup array to draw arrows without doing any math
     
    243244
    244245    private void setupColors() {
    245         hdopAlpha = Config.getPref().getInt("hdop.color.alpha", -1);
     246        circleAlpha = Config.getPref().getInt("circle.color.alpha", -1);
    246247        velocityScale = ColorScale.createHSBScale(256);
    247248        /* Colors (without custom alpha channel, if given) for HDOP painting. */
     
    380381        large = optBool("points.large");
    381382        largesize = optInt("points.large.size");
    382         hdopCircle = optBool("points.hdopcircle");
     383        drawCircle = optBool("points.circle");
     384        circleDataSource = optInt("points.circle.data.source");
    383385        colored = getColorMode();
    384386        velocityTune = optInt("colormode.velocity.tune");
     
    857859
    858860    /****************************************************************
    859      ********** STEP 3d - DRAW LARGE POINTS AND HDOP CIRCLE *********
     861     ************ STEP 3d - DRAW LARGE POINTS AND CIRCLES ***********
    860862     ****************************************************************/
    861863    private void drawPointsStep3d(Graphics2D g, MapView mv, List<WayPoint> visibleSegments) {
    862         if (large || hdopCircle) {
     864        if (large || drawCircle) {
    863865            final int halfSize = largesize / 2;
    864866            for (WayPoint trkPnt : visibleSegments) {
     
    869871                Point screen = mv.getPoint(trkPnt);
    870872
    871                 if (hdopCircle && trkPnt.get(GpxConstants.PT_HDOP) != null) {
    872                     // hdop value
    873                     float hdop = ((Number) trkPnt.get(GpxConstants.PT_HDOP)).floatValue();
    874                     if (hdop < 0) {
    875                         hdop = 0;
     873                if (drawCircle) {
     874                    float circleSize;
     875                    //hdop
     876                    if (circleDataSource == 0 && trkPnt.get(GpxConstants.PT_HDOP) != null) {
     877                        // circleSize value
     878                        circleSize = ((Number) trkPnt.get(GpxConstants.PT_HDOP)).floatValue();
     879                        drawCircle(g, mv, trkPnt, screen, circleSize);
    876880                    }
    877                     Color customColoringTransparent = hdopAlpha < 0 ? trkPnt.customColoring :
    878                             new Color((trkPnt.customColoring.getRGB() & 0x00ffffff) | (hdopAlpha << 24), true);
    879                     g.setColor(customColoringTransparent);
    880                     // hdop circles
    881                     int hdopp = mv.getPoint(new LatLon(
    882                             trkPnt.getCoor().lat(),
    883                             trkPnt.getCoor().lon() + 2d * 6 * hdop * 360 / 40000000d)).x - screen.x;
    884                     g.drawArc(screen.x - hdopp / 2, screen.y - hdopp / 2, hdopp, hdopp, 0, 360);
     881                    //horizontal standard deviation estimate
     882                    if (circleDataSource == 1 && trkPnt.get(GpxConstants.PT_STD_HDEV) != null) {
     883                        circleSize = ((Number) trkPnt.get(GpxConstants.PT_STD_HDEV)).floatValue();
     884                        drawCircle(g, mv, trkPnt, screen, circleSize);
     885                    }
     886                    //age of correction
     887                    if (circleDataSource == 2 && trkPnt.get(GpxConstants.PT_AGEOFDGPSDATA) != null) {
     888                        circleSize = ((Number) trkPnt.get(GpxConstants.PT_AGEOFDGPSDATA)).floatValue();
     889                        drawCircle(g, mv, trkPnt, screen, circleSize);
     890                    }
    885891                }
    886892                if (large) {
     
    901907                }
    902908            } // end for trkpnt
    903         } // end if large || hdopcircle
     909        } // end if large || drawCircle
     910    }
     911
     912    private void drawCircle(Graphics2D g, MapView mv, WayPoint trkPnt, Point screen, float circleSize) {
     913        if (circleSize < 0) {
     914            circleSize = 0;
     915        }
     916        Color customColoringTransparent = circleAlpha < 0 ? trkPnt.customColoring :
     917                new Color((trkPnt.customColoring.getRGB() & 0x00ffffff) | (circleAlpha << 24), true);
     918        g.setColor(customColoringTransparent);
     919        // circles
     920        int circleSizep = mv.getPoint(new LatLon(
     921                trkPnt.getCoor().lat(),
     922                trkPnt.getCoor().lon() + 2d * 6 * circleSize * 360 / 40000000d)).x - screen.x;
     923        g.drawArc(screen.x - circleSizep / 2, screen.y - circleSizep / 2, circleSizep, circleSizep, 0, 360);
    904924    }
    905925
  • trunk/src/org/openstreetmap/josm/gui/preferences/display/GPXSettingsPanel.java

    r19080 r19316  
    2121import javax.swing.ButtonGroup;
    2222import javax.swing.JCheckBox;
     23import javax.swing.JComboBox;
    2324import javax.swing.JLabel;
    2425import javax.swing.JOptionPane;
     
    6667    private final JCheckBox forceRawGpsLines = new JCheckBox(tr("Force lines if no segments imported"));
    6768    private final JCheckBox largeGpsPoints = new JCheckBox(tr("Draw large GPS points"));
    68     private final JCheckBox hdopCircleGpsPoints = new JCheckBox(tr("Draw a circle from HDOP value"));
     69    private final JCheckBox circleGpsPoints = new JCheckBox(tr("Draw a circle from value"));
     70    private final JComboBox<String> circleDataSource = new JosmComboBox<>(new String[] {tr("Hdop"), tr("Horizontal deviation estimate"), tr("Age of correction data")});
    6971    private final JRadioButton colorTypeVelocity = new JRadioButton(tr("Velocity (red = slow, green = fast)"));
    7072    private final JRadioButton colorTypeDirection = new JRadioButton(tr("Direction (red = west, yellow = north, green = east, blue = south)"));
     
    133135        m.put("markers.pattern", Marker.LABEL_PATTERN_AUTO);
    134136        m.put("markers.audio.pattern", "?{ '{name}' | '{desc}' | '{" + Marker.MARKER_FORMATTED_OFFSET + "}' }");
    135         m.put("points.hdopcircle", false);
     137        m.put("points.circle", false);
     138        m.put("points.circle.data.source", 0);
    136139        m.put("points.large", false);
    137140        m.put("points.large.alpha", -1); //Expert mode only
     
    421424        add(drawGpsArrowsMinDist, GBC.eol().fill(GBC.HORIZONTAL).insets(5, 0, 0, 5));
    422425
    423         // hdopCircleGpsPoints
    424         hdopCircleGpsPoints.setToolTipText(tr("Draw a circle from HDOP value"));
    425         add(hdopCircleGpsPoints, GBC.eop().insets(20, 0, 0, 0));
    426         ExpertToggleAction.addVisibilitySwitcher(hdopCircleGpsPoints);
     426        // circleGpsPoints
     427        circleGpsPoints.addItemListener(e -> {circleDataSource.setEnabled(circleGpsPoints.isSelected());});
     428        circleGpsPoints.setToolTipText(tr("Draw a circle from value"));
     429        circleDataSource.setToolTipText(tr("Source of the circle size"));
     430        circleDataSource.setEnabled(false);
     431
     432        add(circleGpsPoints, GBC.std().insets(20, 0, 0, 0));
     433        add(circleDataSource, GBC.eop().fill(GBC.HORIZONTAL).insets(5, 0, 0, 5));
     434        ExpertToggleAction.addVisibilitySwitcher(circleGpsPoints);
     435        ExpertToggleAction.addVisibilitySwitcher(circleDataSource);
    427436
    428437        // largeGpsPoints
     
    623632        drawGpsArrowsFast.setSelected(prefBool("lines.arrows.fast"));
    624633        drawGpsArrowsMinDist.setText(pref("lines.arrows.min-distance"));
    625         hdopCircleGpsPoints.setSelected(prefBool("points.hdopcircle"));
     634        circleGpsPoints.setSelected(prefBool("points.circle"));
     635        circleDataSource.setSelectedIndex(prefInt("points.circle.data.source"));
    626636        largeGpsPoints.setSelected(prefBool("points.large"));
    627637        useGpsAntialiasing.setSelected(Config.getPref().getBoolean("mappaint.gpx.use-antialiasing", false));
     
    699709        }
    700710
    701         putPref("points.hdopcircle", hdopCircleGpsPoints.isSelected());
     711        putPref("points.circle", circleGpsPoints.isSelected());
     712        putPref("points.circle.data.source", circleDataSource.getSelectedIndex());
    702713        putPref("points.large", largeGpsPoints.isSelected());
    703714        putPref("lines.width", drawLineWidth.getText());
  • trunk/src/org/openstreetmap/josm/io/nmea/NmeaParser.java

    r19050 r19316  
    2424/**
    2525 * Parses NMEA 0183 data. Based on information from
    26  * <a href="http://www.catb.org/gpsd/NMEA.html">http://www.catb.org/gpsd</a>.
     26 * <a href="https://gpsd.gitlab.io/gpsd/NMEA.html">https://gpsd.gitlab.io/gpsd</a>.
    2727 *
    2828 * NMEA data is in printable ASCII form and may include information such as position,
     
    134134        final int position;
    135135        GSA(int position) {
     136            this.position = position;
     137        }
     138    }
     139
     140    /**
     141     * GST - GNSS Pseudorange Noise Statistics
     142     * <p>
     143     * RMS and Standard deviation estimated values.
     144     */
     145    enum GST {
     146        TIME(1),
     147        RMS_DEVIATION(2),        // Total RMS standard deviation of ranges inputs to the navigation solution
     148        STDDEV_MAJOR(3),         // Standard deviation (meters) of semi-major axis of error ellipse
     149        STDDEV_MINOR(4),         // Standard deviation (meters) of semi-minor axis of error ellipse
     150        STDDEV_MAJOR_BEARING(5), // Orientation of semi-major axis of error ellipse (true north degrees)
     151        STDDEV_LAT(6),           // Standard deviation (meters) of latitude error
     152        STDDEV_LONG(7),          // Standard deviation (meters) of longitude error
     153        STDDEV_HEIGHT(8);        // Standard deviation (meters) of altitude error
     154        final int position;
     155        GST(int position) {
    136156            this.position = position;
    137157        }
     
    423443                    }
    424444                }
     445                // Age of differential correction
     446                accu = e[GGA.GPS_AGE.position];
     447                if (!accu.isEmpty() && currentwp != null) {
     448                    currentwp.put(GpxConstants.PT_AGEOFDGPSDATA, Float.valueOf(accu));
     449                }
    425450                // reference ID
    426451                if (GGA.REF.position < e.length) {
     
    465490                if (!accu.isEmpty() && currentwp != null) {
    466491                    currentwp.put(GpxConstants.PT_PDOP, Float.valueOf(accu));
     492                }
     493                // GST Sentence
     494            } else if (isSentence(e[0], Sentence.GST)) {
     495                // std horizontal deviation
     496                accu = e[GST.STDDEV_MAJOR.position];
     497                if (!accu.isEmpty() && currentwp != null) {
     498                    currentwp.put(GpxConstants.PT_STD_HDEV, Float.valueOf(accu));
     499                }
     500                // std vertical deviation
     501                accu = e[GST.STDDEV_HEIGHT.position];
     502                if (!accu.isEmpty() && currentwp != null) {
     503                    currentwp.put(GpxConstants.PT_STD_VDEV, Float.valueOf(accu));
    467504                }
    468505            } else if (isSentence(e[0], Sentence.RMC)) {
  • trunk/src/org/openstreetmap/josm/io/nmea/NmeaReader.java

    r18787 r19316  
    2121/**
    2222 * Reads a NMEA 0183 file. Based on information from
    23  * <a href="http://www.catb.org/gpsd/NMEA.html">http://www.catb.org/gpsd</a>.
     23 * <a href="https://gpsd.gitlab.io/gpsd/NMEA.html">https://gpsd.gitlab.io/gpsd</a>.
    2424 *
    2525 * NMEA files are in printable ASCII form and may include information such as position,
  • trunk/src/org/openstreetmap/josm/io/nmea/Sentence.java

    r12429 r19316  
    99 * Newer ones conforming to NMEA 3.x may emit GBS as well.
    1010 * Other NMEA sentences are usually only emitted by high-end maritime navigation systems.<p>
    11  * See <a href="http://www.catb.org/gpsd/NMEA.html#_nmea_encoding_conventions">NMEA Encoding Conventions</a>
     11 * See <a href="https://gpsd.gitlab.io//gpsd/NMEA.html#_nmea_encoding_conventions">NMEA Encoding Conventions</a>
    1212 * @since 12421
    1313 */
     
    3232     * <li>Checksum</li>
    3333     * </ol>
    34      * See <a href="http://www.catb.org/gpsd/NMEA.html#_gbs_gps_satellite_fault_detection">GBS</a>
     34     * See <a href="https://gpsd.gitlab.io//gpsd/NMEA.html#_gbs_gps_satellite_fault_detection">GBS</a>
    3535     */
    3636    GBS,
     
    7272     * <li>Checksum</li>
    7373     * </ol>
    74      * See <a href="http://www.catb.org/gpsd/NMEA.html#_gga_global_positioning_system_fix_data">GGA</a>
     74     * See <a href="https://gpsd.gitlab.io/gpsd/NMEA.html#_gga_global_positioning_system_fix_data">GGA</a>
    7575     */
    7676    GGA,
     
    103103     * <li>Checksum</li>
    104104     * </ol>
    105      * See <a href="http://www.catb.org/gpsd/NMEA.html#_gsa_gps_dop_and_active_satellites">GSA</a>
     105     * See <a href="https://gpsd.gitlab.io/gpsd/NMEA.html#_gsa_gps_dop_and_active_satellites">GSA</a>
    106106     */
    107107    GSA,
     
    123123     * <li>SNR in dB (00-99) (leading zeros sent) more satellite info quadruples like 4-7 n) checksum</li>
    124124     * </ol>
    125      * See <a href="http://www.catb.org/gpsd/NMEA.html#_gsv_satellites_in_view">GSV</a>
     125     * See <a href="https://gpsd.gitlab.io/gpsd/NMEA.html#_gsv_satellites_in_view">GSV</a>
    126126     */
    127127    GSV,
     
    144144     * <li>Checksum</li>
    145145     * </ol>
    146      * See <a href="http://www.catb.org/gpsd/NMEA.html#_gll_geographic_position_latitude_longitude">GLL</a>
     146     * See <a href="https://gpsd.gitlab.io/gpsd/NMEA.html#_gll_geographic_position_latitude_longitude">GLL</a>
    147147     */
    148148    GLL,
     149   
     150    /**
     151     * GST - GPS Pseudorange Noise Statistics
     152     * <pre>
     153     *              1    2 3 4 5 6 7 8   9
     154     *              |    | | | | | | |   |
     155     * $ --GST,hhmmss.ss,x,x,x,x,x,x,x*hh
     156     * </pre>
     157     * Field Number:<ol>
     158     * <li>UTC time of associated GGA fix</li>
     159     * <li>Total RMS standard deviation of ranges inputs to the navigation solution</li>
     160     * <li>Standard deviation (meters) of semi-major axis of error ellipse</li>
     161     * <li>Standard deviation (meters) of semi-minor axis of error ellipse</li>
     162     * <li>Orientation of semi-major axis of error ellipse (true north degrees)</li>
     163     * <li>Standard deviation (meters) of latitude error</li>
     164     * <li>Standard deviation (meters) of longitude error</li>
     165     * <li>Standard deviation (meters) of altitude error</li>
     166     * <li>Checksum</li>
     167     * </ol>
     168     * See <a href="https://gpsd.gitlab.io/gpsd/NMEA.html#_gst_gps_pseudorange_noise_statistics">GST</a>
     169     */
     170    GST,
    149171
    150172    /**
     
    171193     * <li>Checksum</li>
    172194     * </ol>
    173      * See <a href="http://www.catb.org/gpsd/NMEA.html#_rmc_recommended_minimum_navigation_information">RMC</a>
     195     * See <a href="https://gpsd.gitlab.io/gpsd/NMEA.html#_rmc_recommended_minimum_navigation_information">RMC</a>
    174196     */
    175197    RMC,
     
    194216     * <li>Checksum</li>
    195217     * </ol>
    196      * See <a href="http://www.catb.org/gpsd/NMEA.html#_vtg_track_made_good_and_ground_speed">VTG</a>
     218     * See <a href="https://gpsd.gitlab.io/gpsd/NMEA.html#_vtg_track_made_good_and_ground_speed">VTG</a>
    197219     */
    198220    VTG,
     
    214236     * <li>Checksum</li>
    215237     * </ol>
    216      * See <a href="http://www.catb.org/gpsd/NMEA.html#_zda_time_amp_date_utc_day_month_year_and_local_time_zone">ZDA</a>
     238     * See <a href="https://gpsd.gitlab.io/gpsd/NMEA.html#_zda_time_amp_date_utc_day_month_year_and_local_time_zone">ZDA</a>
    217239     */
    218240    ZDA
  • trunk/src/org/openstreetmap/josm/io/nmea/TalkerId.java

    r12427 r19316  
    55 * Talker identifiers mnemonics are the first two characters at the beginning of each sentence.
    66 * This enum lists the common ones (navigation systems).<p>
    7  * See <a href="http://www.catb.org/gpsd/NMEA.html#_talker_ids">Talker IDs</a>
     7 * See <a href="https://gpsd.gitlab.io/gpsd/NMEA.html#_talker_ids">Talker IDs</a>
    88 * @since 12421
    99 */
  • trunk/src/org/openstreetmap/josm/io/nmea/package-info.java

    r12421 r19316  
    44 * Provides the classes for reading NMEA-0183 files.
    55 * <p>
    6  * See <a href="http://www.catb.org/gpsd/NMEA.html#_gbs_gps_satellite_fault_detection">NMEA Revealed</a>.
     6 * See <a href="https://gpsd.gitlab.io/gpsd/NMEA.html">NMEA Revealed</a>.
    77 * @since 12421
    88 */
  • trunk/src/org/openstreetmap/josm/io/rtklib/RtkLibPosReader.java

    r18179 r19316  
    9191                            double sdn = Double.parseDouble(fields[IDX_SDN]);
    9292                            double sde = Double.parseDouble(fields[IDX_SDE]);
    93                             currentwp.put(GpxConstants.PT_HDOP, (float) Math.sqrt(sdn*sdn + sde*sde));
     93                            currentwp.put(GpxConstants.PT_STD_HDEV, (float) Math.sqrt(sdn*sdn + sde*sde));
     94                            currentwp.put(GpxConstants.PT_STD_VDEV, fields[IDX_SDU]);
    9495                            waypoints.add(currentwp);
    9596                            success++;
  • trunk/test/unit/org/openstreetmap/josm/io/nmea/NmeaReaderTest.java

    r18853 r19316  
    6363        assertNull(wayPoints.get(0).get(GpxConstants.PT_PDOP));
    6464    }
    65 
     65    /**
     66     * Tests reading a nmea file with GST sentences.
     67     * @throws Exception if any error occurs
     68     */
     69    @Test
     70    void testReader2() throws Exception {
     71        final NmeaReader in = new NmeaReader(Files.newInputStream(Paths.get("nodist/data/btnmea_GST.nmea")));
     72        in.parse(true);
     73        assertEquals(9, in.getNumberOfCoordinates());
     74        assertEquals(0, in.getParserMalformed());
     75
     76        final List<WayPoint> wayPoints = new ArrayList<>(in.data.tracks.iterator().next().getSegments().iterator().next().getWayPoints());
     77        assertEquals("43.294", wayPoints.get(0).get(GpxConstants.PT_ELE));
     78        assertEquals("12", wayPoints.get(0).get(GpxConstants.PT_SAT));
     79        assertEquals("rtk", wayPoints.get(0).get(GpxConstants.PT_FIX));
     80        assertEquals("0.52", wayPoints.get(0).get(GpxConstants.PT_HDOP).toString().trim());
     81        assertEquals("0.78", wayPoints.get(0).get(GpxConstants.PT_VDOP).toString().trim());
     82        assertEquals("0.94", wayPoints.get(0).get(GpxConstants.PT_PDOP).toString().trim());
     83    }
     84   
    6685    private static void compareWithReference(int ticket, String filename, int numCoor) throws IOException, SAXException {
    6786        GpxData gpx = GpxReaderTest.parseGpxData(TestUtils.getRegressionDataFile(ticket, filename+".gpx"));
  • trunk/test/unit/org/openstreetmap/josm/io/rtklib/RtkLibPosReaderTest.java

    r18853 r19316  
    5454        assertEquals("92.3955", wp0.get(GpxConstants.PT_ELE));
    5555        assertEquals("2", wp0.get(GpxConstants.PT_SAT));
    56         assertEquals("1.8191757", wp0.get(GpxConstants.PT_HDOP).toString().trim());
     56        assertEquals("1.8191757", wp0.get(GpxConstants.PT_STD_HDEV).toString().trim());
     57        assertEquals("0.8167", wp0.get(GpxConstants.PT_STD_VDEV).toString().trim());
    5758
    5859        assertEquals("1.5620", wp0.get(GpxConstants.RTKLIB_SDN));
Note: See TracChangeset for help on using the changeset viewer.