diff options
| author | Martial Simon <msimon_fr@hotmail.com> | 2025-09-15 01:07:58 +0200 |
|---|---|---|
| committer | Martial Simon <msimon_fr@hotmail.com> | 2025-09-15 01:07:58 +0200 |
| commit | 967be9e750221ab2ab783f95df79bb26d290a45e (patch) | |
| tree | 6802900a5e975f9f68b169f0f503f040056d6952 /ero1/src/generation/graph_generation.py | |
Diffstat (limited to 'ero1/src/generation/graph_generation.py')
| -rw-r--r-- | ero1/src/generation/graph_generation.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/ero1/src/generation/graph_generation.py b/ero1/src/generation/graph_generation.py new file mode 100644 index 0000000..641e761 --- /dev/null +++ b/ero1/src/generation/graph_generation.py @@ -0,0 +1,17 @@ +import osmnx as ox +from src.helper.duplicate_removal import remove_duplicates + +def generate_graph(city_name, debug_mode=False): + """ + Génère un graphe à partir du nom d'une ville en utilisant OSMnx. + + Parameters: + city_name : Le nom de la ville pour laquelle générer le graphe. + + Returns: + MultiDiGraph : Le graphe généré. + """ + # Generate the graph from the city name + GRAPH = ox.graph_from_place(city_name, network_type='drive') + GRAPH = remove_duplicates(GRAPH, debug_mode) + return GRAPH
\ No newline at end of file |
