def main(): """ """ starttime = time.time() gpx_path = 'tests/data/GreenwichMeridianWalk-Viking.gpx' extracted_points = gpx.extractpoints(gpx_path) # print geom field from trkpoints returned by extractpoints for point in extracted_points[0]: print(point[7]) print("--- {} seconds ---".format(time.time() - starttime))
def test_extractpoints(self, gpx_path): extracted_points = gpx.extractpoints(gpx_path) assert len(extracted_points) == 6 expected_starttime = datetime.strptime('2012-03-17T12:46:19Z', '%Y-%m-%dT%H:%M:%SZ') expected_endtime = datetime.strptime('2012-03-17T12:47:23Z', '%Y-%m-%dT%H:%M:%SZ') assert expected_starttime == extracted_points[2] assert expected_endtime == extracted_points[3] assert len(extracted_points[0]) == 4 assert len(extracted_points[1]) == 1 assert len(extracted_points[4]) == 2