<jupyter_start><jupyter_text>General Steps1. Design your pre-defined trip. Example: https://goo.gl/maps/6CeojHgiRG4Wn3Ht9 2. Recreate the trip route. Go to Google Maps -> Menu -> Your places -> Maps -> See all your maps. Or directly click https://www.google.com/maps/d/u/0/?hl=en3. Click "Create a new map"4. Refer to the video for drawing routes and downloading the KML file containing the list of lat/long coordinates: https://youtu.be/VMv0yK7XCrY?t=715. You need to export each motion mode/segment in the trip seperately. Do not generate the whole trip with multiple segements at once.<jupyter_code>file_path = "/Users/bowenxu2/Downloads/pre_def_1_bus.xml"
file_path_2 = "/Users/bowenxu2/Downloads/pre_def_1_walk.xml"
def get_cleaned_lat_long_from_xml(file_path):
    xmldoc = minidom.parse(file_path)
    itemlist = xmldoc.getElementsByTagName('coordinates') 
    # print(itemlist[0].firstChild.nodeValue)
    raw_coordinates = itemlist[0].firstChild.nodeValue.split("\n")[1:-1]
    new_coordinates = []
    for raw_data in raw_coordinates:
        cleaned_data = raw_data.strip().split(",")
        # print(cleaned_data)
        new_coordinates.append([float(cleaned_data[0]), float(cleaned_data[1])])
    print(new_coordinates)
    return new_coordinates
get_cleaned_lat_long_from_xml(file_path)
get_cleaned_lat_long_from_xml(file_path_2)<jupyter_output>[[-122.30482, 47.6569], [-122.30482, 47.65683], [-122.30481, 47.65679], [-122.3048, 47.65673], [-122.30475, 47.65662], [-122.3047, 47.65652], [-122.30469, 47.6565], [-122.30461, 47.65635], [-122.30459, 47.65617], [-122.30455, 47.65594], [-122.30454, 47.65586], [-122.30454, 47.65576], [-122.30453, 47.65561], [-122.30454, 47.65541], [-122.30454, 47.6554], [-122.30454, 47.65534], [-122.30461, 47.65502], [-122.30466, 47.65496], [-122.30471, 47.6549], [-122.30477, 47.65485], [-122.30483, 47.65478], [-122.30489, 47.65473], [-122.30493, 47.6547], [-122.30496, 47.65466], [-122.305, 47.6546], [-122.30503, 47.65455], [-122.30505, 47.65452], [-122.30506, 47.65449], [-122.30507, 47.65447], [-122.3051, 47.6544], [-122.30513, 47.65431], [-122.30514, 47.65421], [-122.30514, 47.65416], [-122.30514, 47.65412], [-122.30513, 47.65407], [-122.30513, 47.65403], [-122.30513, 47.65397], [-122.30512, 47.65387], [-122.30513, 47.65379], [-122.30514, 47.6537], [-122.30516, 47.65359], [-122.30518, 47.65349], [-12[...]
{'fraction_non_alphanumeric': 0.1894291754756871, 'fraction_numerical': 0.2727272727272727, 'mean_word_length': 4.328828828828829, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 8, 'https://': 3, 'lorem ipsum': 0, 'www.': 1, 'xml': 7}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '416347', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 1362, 'n_tokens_neox': 942, 'n_words': 186, 'path': 'spec_creation/generate_digital_pre_defined_trips.ipynb', 'repo_name': 'xubowenhaoren/mobilitynet-analysis-scripts', 'size': '2365'}