aboutsummaryrefslogtreecommitdiff
path: root/src/db_handler.py
diff options
context:
space:
mode:
authoruser <user@node5.net>2024-04-07 23:10:05 +0200
committeruser <user@node5.net>2024-04-07 23:10:05 +0200
commit0d1ba0fc1bc2c64c7aaaf71f98fd96f35b8b1bab (patch)
tree60f40e6546332024d7ee32403e63edb00fd5756d /src/db_handler.py
parent8b16fb83788a04e806573ae3f80e28156a99f27b (diff)
add store heatmap
Diffstat (limited to 'src/db_handler.py')
-rw-r--r--src/db_handler.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/db_handler.py b/src/db_handler.py
index 0fd3ec1..5a2ab73 100644
--- a/src/db_handler.py
+++ b/src/db_handler.py
@@ -56,6 +56,19 @@ def get_supermarkets() -> (list[dict], list[str]):
return supermarkets
+def get_stores() -> (list[dict], list[str]):
+ with psycopg.connect(**db_con_params) as conn:
+ with conn.cursor() as cur:
+ cur.execute("""
+ SELECT
+ ST_Y(ST_Transform(geom, 4326)) AS lat, ST_X(ST_Transform(geom, 4326)) AS long
+ FROM shop;
+ """)
+
+ stores = cur.fetchall()
+ return stores
+
+
def voronoi_polygons() -> (list[dict], list[str]):
with psycopg.connect(**db_con_params, row_factory=psycopg.rows.dict_row) as conn:
with conn.cursor() as cur: