| 214 | Station WRBD (Western River Basin District) |
| 215 | {{{ |
| 216 | CREATE SCHEMA wrbd; |
| 217 | |
| 218 | drop table if exists wrbd.station_st; |
| 219 | create table wrbd.station_st ( |
| 220 | st_foliono character varying(50), |
| 221 | st_id character varying(10), |
| 222 | st_district character varying(30), |
| 223 | st_catchment character varying(15), |
| 224 | st_river character varying(40), |
| 225 | st_sitetributary character(5), |
| 226 | st_eastings numeric, |
| 227 | st_northing numeric, |
| 228 | st_location text, |
| 229 | st_x numeric, |
| 230 | st_y numeric |
| 231 | ); |
| 232 | alter table wrbd.station_st add constraint pk_st_id primary key (st_id); |
| 233 | set client_encoding to 'latin1'; |
| 234 | copy wrbd.station_st from 'D:/CelineJouanin/POSEProject/Ireland/DataIreland/Station_14_Eel_Db_MI_Rivers.csv' with csv delimiter as ';' header; |
| 235 | -- projection sur le SRID 3035 |
| 236 | SELECT AddGeometryColumn('wrbd', 'station_st','the_geom', 3035,'POINT',2); |
| 237 | UPDATE wrbd.station_st SET the_geom=ST_Transform(PointFromText('POINT(' || st_x || ' ' || st_y || ')',29901),3035); |
| 238 | ALTER TABLE wrbd.station_st SET WITH OIDS; |
| 239 | |
| 240 | --srid =29903 or srid=29901 |
| 241 | |
| 242 | CREATE INDEX indexstation_st ON wrbd.station_st |
| 243 | USING GIST ( the_geom GIST_GEOMETRY_OPS ); |
| 244 | }}} |
| 245 | |