diff --git a/config.ini.sample b/config.ini.sample index 131e336..b179029 100644 --- a/config.ini.sample +++ b/config.ini.sample @@ -31,7 +31,7 @@ feature_status = status [bordeaux] schema = bordeaux table = timeserie -srid = 4326 +srid = 2154 typename = TB_STVEL_P # station geoloc variable names feature_id = numstat diff --git a/jitenshea/tasks/city.py b/jitenshea/tasks/city.py index f555699..5b8d3df 100644 --- a/jitenshea/tasks/city.py +++ b/jitenshea/tasks/city.py @@ -195,11 +195,19 @@ class NormalizeStationTable(PostgresQuery): password = None query = ("DROP TABLE IF EXISTS {schema}.stations; " - "CREATE TABLE {schema}.stations" - " AS " + "CREATE TABLE {schema}.stations (" + "id varchar," + "name varchar(250)," + "address varchar(500)," + "city varchar(100)," + "nb_stations int," + "geom geometry(POINT, 4326)" + "); " + "INSERT INTO {schema}.stations " "SELECT {id} AS id, {name} AS name, " "{address} AS address, {city} AS city, " - "{nb_stations} AS nb_stations, geom " + "{nb_stations}::int AS nb_stations, " + "st_transform(st_force2D(geom), 4326) as geom " "FROM {schema}.raw_stations" ";")