diff --git a/data/flensburg_stadtteile.sql b/data/flensburg_stadtteile.sql index a3dae22..797d571 100644 --- a/data/flensburg_stadtteile.sql +++ b/data/flensburg_stadtteile.sql @@ -2,9 +2,9 @@ DROP TABLE IF EXISTS districts CASCADE; CREATE TABLE IF NOT EXISTS districts ( - "id" INT, - "name" VARCHAR, - "wkb_geometry" geometry, + id INT, + name VARCHAR NOT NULL, + geom GEOMETRY(POLYGON, 4326), PRIMARY KEY(id) ); diff --git a/tools/insert_districts.py b/tools/insert_districts.py index 19804ec..eb2c9a1 100755 --- a/tools/insert_districts.py +++ b/tools/insert_districts.py @@ -55,7 +55,7 @@ def update_district(cur, district_id, geometry): wkb_geometry = wkb.dumps(g, hex=True, srid=4326) - sql = '''UPDATE districts SET wkb_geometry = %s WHERE id = %s''' + sql = 'UPDATE districts SET geom = %s WHERE id = %s' cur.execute(sql, (wkb_geometry, district_id))