Ignore:
Timestamp:
2009-02-17T19:17:26+01:00 (15 years ago)
Author:
stoecker
Message:

fixed #1642. patch by xeen

Location:
trunk/src/org/openstreetmap/josm/io
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/io/GpxReader.java

    r1169 r1425  
    224224                break;
    225225            case wpt:
    226                 if (qName.equals("ele") || qName.equals("magvar")
    227                         || qName.equals("geoidheight") || qName.equals("name")
    228                         || qName.equals("sym") || qName.equals("type")) {
     226                if (   qName.equals("ele") || qName.equals("magvar")
     227                    || qName.equals("name") || qName.equals("geoidheight")
     228                    || qName.equals("type") || qName.equals("sym")) {
    229229                    currentWayPoint.attr.put(qName, accumulator.toString());
     230                } else if(qName.equals("hdop") /*|| qName.equals("vdop") ||
     231                        qName.equals("pdop")*/) {
     232                    try {
     233                        currentWayPoint.attr.put(qName, Float.parseFloat(accumulator.toString()));
     234                    } catch(Exception e) {
     235                        currentWayPoint.attr.put(qName, new Float(0));
     236                    }
    230237                } else if (qName.equals("time")) {
    231238                    currentWayPoint.attr.put(qName, accumulator.toString());
  • trunk/src/org/openstreetmap/josm/io/NmeaReader.java

    r1415 r1425  
    309309                // h-dilution
    310310                accu=e[GPGGA.HDOP.position];
    311                 if(!accu.equals("")) {
    312                     Double.parseDouble(accu);
    313                     currentwp.attr.put("hdop", accu);
    314                 }
     311                if(!accu.equals(""))
     312                    currentwp.attr.put("hdop", Float.parseFloat(accu));
    315313                // fix
    316314                accu=e[GPGGA.QUALITY.position];
     
    356354                // vdop
    357355                accu=e[GPGSA.VDOP.position];
    358                 if(!accu.equals("")) {
    359                     Double.parseDouble(accu);
    360                     currentwp.attr.put("vdop", accu);
    361                 }
     356                if(!accu.equals(""))
     357                    currentwp.attr.put("vdop", Float.parseFloat(accu));
    362358                // hdop
    363359                accu=e[GPGSA.HDOP.position];
    364                 if(!accu.equals("")) {
    365                     Double.parseDouble(accu);
    366                     currentwp.attr.put("hdop", accu);
    367                 }
     360                if(!accu.equals(""))
     361                    currentwp.attr.put("hdop", Float.parseFloat(accu));
    368362                // pdop
    369363                accu=e[GPGSA.PDOP.position];
    370                 if(!accu.equals("")) {
    371                     Double.parseDouble(accu);
    372                     currentwp.attr.put("pdop", accu);
    373                 }
     364                if(!accu.equals(""))
     365                    currentwp.attr.put("pdop", Float.parseFloat(accu));
    374366            }
    375367            else if(e[0].equals("$GPRMC")) {
  • trunk/src/org/openstreetmap/josm/io/OsmReader.java

    r1415 r1425  
    478478      * @param ref The dataset that is search in for references first. If
    479479      *      the Reference is not found here, Main.ds is searched and a copy of the
    480       *  elemet found there is returned.
     480      *  element found there is returned.
    481481      */
    482482     public static DataSet parseDataSet(InputStream source, DataSet ref, PleaseWaitDialog pleaseWaitDlg) throws SAXException, IOException {
Note: See TracChangeset for help on using the changeset viewer.