diff options
Diffstat (limited to 'src/db_handler.py')
| -rw-r--r-- | src/db_handler.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/db_handler.py b/src/db_handler.py index 565819d..3f77366 100644 --- a/src/db_handler.py +++ b/src/db_handler.py @@ -11,9 +11,10 @@ def get_supermarkets() -> (list[dict], list[str]): with psycopg.connect(**db_con_params, row_factory=psycopg.rows.dict_row) as conn: with conn.cursor() as cur: cur.execute(""" - SELECT osm_type, osm_id, name, + SELECT name, + CASE WHEN brand ILIKE '%365%' THEN '365discount' ELSE BRAND END, ST_Y(ST_Transform(geom, 4326)) AS lat, ST_X(ST_Transform(geom, 4326)) AS long - FROM shop WHERE subclass = 'supermarket' AND name='Løvbjerg'; + FROM shop WHERE subclass = 'supermarket'; """) supermarkets = cur.fetchall() @@ -26,8 +27,7 @@ def voronoi_polygons() -> (list[dict], list[str]): cur.execute(""" SELECT ST_AsGeoJSON(ST_Transform(ST_VoronoiPolygons(ST_Collect(geom)), 4326)) as geojson FROM shop - WHERE subclass = 'supermarket' - AND name = 'Løvbjerg'; + WHERE subclass = 'supermarket'; """) voronoi_polygons = cur.fetchone()['geojson'] |
