Skip to content
This repository has been archived by the owner on Jan 22, 2021. It is now read-only.

Commit

Permalink
tasks: fix the SRID projection problem when normalizing the station t…
Browse files Browse the repository at this point in the history
…able

also update the configuration file where the SRID for Bordeaux was wrong.
  • Loading branch information
garaud committed May 25, 2018
1 parent 29db89b commit 711c782
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion config.ini.sample
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 11 additions & 3 deletions jitenshea/tasks/city.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
";")

Expand Down

0 comments on commit 711c782

Please sign in to comment.