- Timestamp:
- 2025-02-14T10:20:59+01:00 (10 days ago)
- Location:
- trunk
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/Preferences.java
r19179 r19316 86 86 /** remove if key equals */ 87 87 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 92 89 }; 93 90 94 91 /** remove if key starts with */ 95 92 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 121 94 }; 122 95 123 96 /** keep subkey even if it starts with any of {@link #OBSOLETE_PREF_KEYS_START} */ 124 97 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 133 99 ); 134 100 … … 138 104 private static Map<String, String> getUpdatePrefKeys() { 139 105 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"); 161 108 return Collections.unmodifiableMap(m); 162 109 } -
trunk/src/org/openstreetmap/josm/data/gpx/GpxConstants.java
r18396 r19316 179 179 String PT_DGPSID = "dgpsid"; 180 180 181 /** Standard horizontal major deviation */ 182 String PT_STD_HDEV = "stdhdev"; 183 184 /** Standard vertical major deviation */ 185 String PT_STD_VDEV = "stdvdev"; 186 181 187 /** 182 188 * Ordered list of all possible waypoint keys. … … 184 190 List<String> WPT_KEYS = Collections.unmodifiableList(Arrays.asList(PT_ELE, PT_TIME, PT_MAGVAR, PT_GEOIDHEIGHT, 185 191 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)); 187 193 188 194 /** -
trunk/src/org/openstreetmap/josm/gui/layer/gpx/GpxDrawHelper.java
r19238 r19316 92 92 private boolean large; 93 93 private int largesize; 94 private boolean hdopCircle; 94 private boolean drawCircle; 95 private int circleDataSource; 95 96 /** paint direction arrow with alternate math. may be faster **/ 96 97 private boolean arrowsFast; … … 138 139 private ColorScale directionScale; 139 140 140 /** Opacity for hdoppoints **/141 private int hdopAlpha;141 /** Opacity for circle points **/ 142 private int circleAlpha; 142 143 143 144 // lookup array to draw arrows without doing any math … … 243 244 244 245 private void setupColors() { 245 hdopAlpha = Config.getPref().getInt("hdop.color.alpha", -1);246 circleAlpha = Config.getPref().getInt("circle.color.alpha", -1); 246 247 velocityScale = ColorScale.createHSBScale(256); 247 248 /* Colors (without custom alpha channel, if given) for HDOP painting. */ … … 380 381 large = optBool("points.large"); 381 382 largesize = optInt("points.large.size"); 382 hdopCircle = optBool("points.hdopcircle"); 383 drawCircle = optBool("points.circle"); 384 circleDataSource = optInt("points.circle.data.source"); 383 385 colored = getColorMode(); 384 386 velocityTune = optInt("colormode.velocity.tune"); … … 857 859 858 860 /**************************************************************** 859 ********** STEP 3d - DRAW LARGE POINTS AND HDOP CIRCLE*********861 ************ STEP 3d - DRAW LARGE POINTS AND CIRCLES *********** 860 862 ****************************************************************/ 861 863 private void drawPointsStep3d(Graphics2D g, MapView mv, List<WayPoint> visibleSegments) { 862 if (large || hdopCircle) {864 if (large || drawCircle) { 863 865 final int halfSize = largesize / 2; 864 866 for (WayPoint trkPnt : visibleSegments) { … … 869 871 Point screen = mv.getPoint(trkPnt); 870 872 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); 876 880 } 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 } 885 891 } 886 892 if (large) { … … 901 907 } 902 908 } // 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); 904 924 } 905 925 -
trunk/src/org/openstreetmap/josm/gui/preferences/display/GPXSettingsPanel.java
r19080 r19316 21 21 import javax.swing.ButtonGroup; 22 22 import javax.swing.JCheckBox; 23 import javax.swing.JComboBox; 23 24 import javax.swing.JLabel; 24 25 import javax.swing.JOptionPane; … … 66 67 private final JCheckBox forceRawGpsLines = new JCheckBox(tr("Force lines if no segments imported")); 67 68 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")}); 69 71 private final JRadioButton colorTypeVelocity = new JRadioButton(tr("Velocity (red = slow, green = fast)")); 70 72 private final JRadioButton colorTypeDirection = new JRadioButton(tr("Direction (red = west, yellow = north, green = east, blue = south)")); … … 133 135 m.put("markers.pattern", Marker.LABEL_PATTERN_AUTO); 134 136 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); 136 139 m.put("points.large", false); 137 140 m.put("points.large.alpha", -1); //Expert mode only … … 421 424 add(drawGpsArrowsMinDist, GBC.eol().fill(GBC.HORIZONTAL).insets(5, 0, 0, 5)); 422 425 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); 427 436 428 437 // largeGpsPoints … … 623 632 drawGpsArrowsFast.setSelected(prefBool("lines.arrows.fast")); 624 633 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")); 626 636 largeGpsPoints.setSelected(prefBool("points.large")); 627 637 useGpsAntialiasing.setSelected(Config.getPref().getBoolean("mappaint.gpx.use-antialiasing", false)); … … 699 709 } 700 710 701 putPref("points.hdopcircle", hdopCircleGpsPoints.isSelected()); 711 putPref("points.circle", circleGpsPoints.isSelected()); 712 putPref("points.circle.data.source", circleDataSource.getSelectedIndex()); 702 713 putPref("points.large", largeGpsPoints.isSelected()); 703 714 putPref("lines.width", drawLineWidth.getText()); -
trunk/src/org/openstreetmap/josm/io/nmea/NmeaParser.java
r19050 r19316 24 24 /** 25 25 * 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>. 27 27 * 28 28 * NMEA data is in printable ASCII form and may include information such as position, … … 134 134 final int position; 135 135 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) { 136 156 this.position = position; 137 157 } … … 423 443 } 424 444 } 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 } 425 450 // reference ID 426 451 if (GGA.REF.position < e.length) { … … 465 490 if (!accu.isEmpty() && currentwp != null) { 466 491 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)); 467 504 } 468 505 } else if (isSentence(e[0], Sentence.RMC)) { -
trunk/src/org/openstreetmap/josm/io/nmea/NmeaReader.java
r18787 r19316 21 21 /** 22 22 * 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>. 24 24 * 25 25 * 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 9 9 * Newer ones conforming to NMEA 3.x may emit GBS as well. 10 10 * 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> 12 12 * @since 12421 13 13 */ … … 32 32 * <li>Checksum</li> 33 33 * </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> 35 35 */ 36 36 GBS, … … 72 72 * <li>Checksum</li> 73 73 * </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> 75 75 */ 76 76 GGA, … … 103 103 * <li>Checksum</li> 104 104 * </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> 106 106 */ 107 107 GSA, … … 123 123 * <li>SNR in dB (00-99) (leading zeros sent) more satellite info quadruples like 4-7 n) checksum</li> 124 124 * </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> 126 126 */ 127 127 GSV, … … 144 144 * <li>Checksum</li> 145 145 * </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> 147 147 */ 148 148 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, 149 171 150 172 /** … … 171 193 * <li>Checksum</li> 172 194 * </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> 174 196 */ 175 197 RMC, … … 194 216 * <li>Checksum</li> 195 217 * </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> 197 219 */ 198 220 VTG, … … 214 236 * <li>Checksum</li> 215 237 * </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> 217 239 */ 218 240 ZDA -
trunk/src/org/openstreetmap/josm/io/nmea/TalkerId.java
r12427 r19316 5 5 * Talker identifiers mnemonics are the first two characters at the beginning of each sentence. 6 6 * 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> 8 8 * @since 12421 9 9 */ -
trunk/src/org/openstreetmap/josm/io/nmea/package-info.java
r12421 r19316 4 4 * Provides the classes for reading NMEA-0183 files. 5 5 * <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>. 7 7 * @since 12421 8 8 */ -
trunk/src/org/openstreetmap/josm/io/rtklib/RtkLibPosReader.java
r18179 r19316 91 91 double sdn = Double.parseDouble(fields[IDX_SDN]); 92 92 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]); 94 95 waypoints.add(currentwp); 95 96 success++; -
trunk/test/unit/org/openstreetmap/josm/io/nmea/NmeaReaderTest.java
r18853 r19316 63 63 assertNull(wayPoints.get(0).get(GpxConstants.PT_PDOP)); 64 64 } 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 66 85 private static void compareWithReference(int ticket, String filename, int numCoor) throws IOException, SAXException { 67 86 GpxData gpx = GpxReaderTest.parseGpxData(TestUtils.getRegressionDataFile(ticket, filename+".gpx")); -
trunk/test/unit/org/openstreetmap/josm/io/rtklib/RtkLibPosReaderTest.java
r18853 r19316 54 54 assertEquals("92.3955", wp0.get(GpxConstants.PT_ELE)); 55 55 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()); 57 58 58 59 assertEquals("1.5620", wp0.get(GpxConstants.RTKLIB_SDN));
Note:
See TracChangeset
for help on using the changeset viewer.