File size: 631 Bytes
efc0118
 
 
 
 
 
 
 
 
 
 
 
 
82aae5c
 
0508b3e
efc0118
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from read_kml import parse_kml, get_coordinates
from fetch_places import nearby_search, fetch_place_photos, place_details
from tqdm import tqdm


if __name__ == "__main__":
    file_path = "datas/Espaces_verts_SCAI.kml"
    kml_data = parse_kml(file_path)
    coordinates = get_coordinates(kml_data)

    for place_name, coordinate in tqdm(coordinates.items()):
        try:
            place_id, _, photos = nearby_search(coordinate)
            if not place_id:
                continue
            fetch_place_photos(place_id, place_name, photos)
        except Exception as e:
            print(f"Error: {e} for {place_name}")