| 1 | back to first page[..][[BR]] |
| 2 | back to ["RHT"], ["RHT PATE"], ["PATE Anguille"][[BR]] |
| 3 | |
| 4 | == Station hydrographique Banque HYDRO == |
| 5 | {{{ |
| 6 | #!sql |
| 7 | ---Creation du schéma Pate |
| 8 | create schema pate; |
| 9 | |
| 10 | ---Création de la table station_hydro pour récupérer ensuite les id_drain correspondants |
| 11 | drop table if exists pate.station_hydro; |
| 12 | create table pate.station_hydro ( |
| 13 | nom character varying(80), |
| 14 | X_lambertII numeric, |
| 15 | Y_lambertII numeric, |
| 16 | code_station character varying(30), |
| 17 | nom_station character varying(80) |
| 18 | ); |
| 19 | set client_encoding to 'latin1'; |
| 20 | copy pate.station_hydro from 'D:/CelineJouanin/PATE/Station_Hydro.csv' with csv header delimiter as ';' NULL AS 'NA';--20 lines |
| 21 | |
| 22 | select * from pate.station_hydro; ---problèmes tous les noms ne sont pas écrits |
| 23 | |
| 24 | update pate.station_hydro set code_station='J9300610' where nom_station='Vilaine_(Rieux)'; |
| 25 | |
| 26 | ---Changement de projections |
| 27 | ---Lambert II étendut (srid 27572) --> srid 3035 |
| 28 | SELECT AddGeometryColumn('pate', 'station_hydro','the_geom', 3035,'POINT',2); |
| 29 | UPDATE pate.station_hydro SET the_geom=ST_Transform(PointFromText('POINT(' || x_lambertii || ' ' || y_lambertii || ')',27572),3035) ; |
| 30 | }}} |