~foxtrotgps-team/foxtrotgps/trunk

« back to all changes in this revision

Viewing changes to contrib/gpx2osm

  • Committer: Paul Wise
  • Date: 2018-03-06 03:32:21 UTC
  • Revision ID: pabs3@bonedaddy.net-20180306033221-lzyia8y0cpw95j1b
Remove trailing whitespace

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
TagName = "\t\t<tag k='name' v='no name yet' />\n"
17
17
HDOP = "10"
18
18
        # hdop is a measure of how accurate GPS might be, smaller the better.
19
 
        # Markus used 3.1 but I found that walking tracks with overhead trees 
20
 
        # can easily generate tracks in the 6 range. 
 
19
        # Markus used 3.1 but I found that walking tracks with overhead trees
 
20
        # can easily generate tracks in the 6 range.
21
21
        # http://wiki.openstreetmap.org/wiki/Converting_NMEA_to_GPX suggests 10
22
22
        # If you are really careless you can describe HDOP as a multiplier to the
23
23
        # intrinsic error of the full hardware chain, typically 5 to 8 metres.
63
63
def HowManyPoints(FileName):
64
64
        Count = 0
65
65
        BadCount = 0
66
 
        IF = open(FileName)             
 
66
        IF = open(FileName)
67
67
        for Line in IF:
68
68
                Count = Count + Line.count("<hdop>") # careful, this is case sensitive !
69
69
                # print("CNT", Count, Line)
74
74
                                if 10.0 < float(i[:i.find('<')]):
75
75
                                        BadCount = BadCount+1
76
76
                        except ValueError:
77
 
                                continue        
 
77
                                continue
78
78
        IF.close
79
79
        return Count, BadCount
80
 
                
 
80
 
81
81
# -------- ------------------------
82
82
# -------- Main Function ----------
83
83
# ---------------------------------
113
113
                print(WriteOSM(Base), end=" ")
114
114
                print("nodes saved")
115
115
        else:
116
 
                WriteOSM(Base) 
 
116
                WriteOSM(Base)
117
117