Ticket #4157: josm-ehpe.diff
| File josm-ehpe.diff, 3.3 KB (added by , 16 years ago) |
|---|
-
src/org/openstreetmap/josm/gui/layer/GpxLayer.java
513 513 // paint large dots for points 514 514 boolean large = Main.pref.getBoolean("draw.rawgps.large"); 515 515 boolean hdopcircle = Main.pref.getBoolean("draw.rawgps.hdopcircle", true); 516 boolean ehpecircle = Main.pref.getBoolean("draw.rawgps.ehpecircle", true); 517 double ehpefactor; 518 try { 519 ehpefactor = Main.pref.getDouble("draw.rawgps.ehpefactor", 1.0d); 520 } catch (Exception e) { 521 ehpefactor = 1.0d; 522 } 516 523 // color the lines 517 524 colorModes colored = colorModes.none; 518 525 try { … … 707 714 /**************************************************************** 708 715 ********** STEP 3d - DRAW LARGE POINTS AND HDOP CIRCLE ********* 709 716 ****************************************************************/ 710 if (large || hdopcircle ) {717 if (large || hdopcircle || ehpecircle) { 711 718 g.setColor(neutralColor); 712 719 for (GpxTrack trk : data.tracks) { 713 720 for (Collection<WayPoint> segment : trk.trackSegs) { … … 728 735 int hdopp = mv.getPoint(new LatLon(trkPnt.getCoor().lat(), trkPnt.getCoor().lon() + 2*6*hdop*360/40000000)).x - screen.x; 729 736 g.drawArc(screen.x-hdopp/2, screen.y-hdopp/2, hdopp, hdopp, 0, 360); 730 737 } 738 if (ehpecircle && trkPnt.attr.get("ehpe") != null) { 739 // ehpe value 740 float ehpe = ((Float) trkPnt.attr.get("ehpe")).floatValue(); 741 if (ehpe < 0) { 742 ehpe = 0; 743 } 744 // ehpe pixels; 1 arcdeg of latitude is about 111,000m 745 int ehpep = Math.abs(mv.getPoint(new LatLon(trkPnt.getCoor().lat() + ehpefactor*ehpe/111000, trkPnt.getCoor().lon())).y - screen.y); 746 g.drawArc(screen.x - ehpep / 2, screen.y - ehpep / 2, ehpep, ehpep, 0, 360); 747 } 731 748 if (large) { 732 749 g.fillRect(screen.x-1, screen.y-1, 3, 3); 733 750 } -
src/org/openstreetmap/josm/io/GpxReader.java
314 314 case ext: 315 315 if (qName.equals("extensions")) { 316 316 currentState = states.pop(); 317 } else if (qName.equals("ehpe")) { 318 try { 319 currentWayPoint.attr.put(qName, Float.parseFloat(accumulator.toString())); 320 } catch (Exception e) { 321 currentWayPoint.attr.put(qName, new Float(0)); 317 322 } 323 } 318 324 break; 319 325 default: 320 326 if (qName.equals("wpt")) {
