summaryrefslogtreecommitdiff
path: root/ero1/src/generation/graph_generation.py
diff options
context:
space:
mode:
authorMartial Simon <msimon_fr@hotmail.com>2025-09-15 01:07:58 +0200
committerMartial Simon <msimon_fr@hotmail.com>2025-09-15 01:07:58 +0200
commit967be9e750221ab2ab783f95df79bb26d290a45e (patch)
tree6802900a5e975f9f68b169f0f503f040056d6952 /ero1/src/generation/graph_generation.py
add: added projectsHEADmain
Diffstat (limited to 'ero1/src/generation/graph_generation.py')
-rw-r--r--ero1/src/generation/graph_generation.py17
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