| 1 | back to first page[..][[BR]] |
| 2 | back to ["RHT"] - ["Download and load RHT"][[BR]] |
| 3 | Go to ["CookBook join RHT-BDMAP"][[BR]] |
| 4 | |
| 5 | NTF_France_II_degrees / NTF Lambert zone II (srid 27572) --> ETRS1989-LAEA (srid 3035) |
| 6 | |
| 7 | == Integrating topology (rht_vs2_export_cjouanin_sept11.csv) == |
| 8 | |
| 9 | {{{ |
| 10 | #!sql |
| 11 | drop table if exists rht.topologie_rht_sept2011; |
| 12 | CREATE TABLE rht.topologie_rht_sept2011 |
| 13 | ( |
| 14 | ID_DRAIN integer, |
| 15 | Xcdg numeric, |
| 16 | Ycdg numeric, |
| 17 | Xstart numeric, |
| 18 | Ystart numeric, |
| 19 | Lg numeric, |
| 20 | Gridid integer, |
| 21 | Fnode integer, |
| 22 | Tnode integer, |
| 23 | Long numeric |
| 24 | ); |
| 25 | |
| 26 | copy rht.topologie_rht_sept2011 from 'D:/CelineJouanin/RHT_Estimkart/rht_vs2_export_cjouanin_sept11.csv' with csv delimiter as ';' header; |
| 27 | alter table rht.topologie_rht_sept2011 add constraint pk_id_drain_topo primary key (id_drain); |
| 28 | set client_encoding to 'latin1'; |
| 29 | }}} |
| 30 | |
| 31 | id_drain 30000 sans topologie [[BR]] |
| 32 | Create a view rht_topology |
| 33 | {{{ |
| 34 | #!sql |
| 35 | ALTER TABLE rht.topologie_rht_sept2011 RENAME COLUMN id_drain TO id_draintopo; |
| 36 | CREATE VIEW rht.rht_topology AS select * from rht.rht r inner join rht.topologie_rht_sept2011 t on t.id_draintopo=r.id_drain; |
| 37 | }}} |
| 38 | |
| 39 | |
| 40 | == Integrating "noeuds" == |
| 41 | {{{ |
| 42 | --Celine |
| 43 | d: |
| 44 | cd D:\CelineJouanin\RHT_Estimkart |
| 45 | C:\"Program Files"\PostgreSQL\8.4\bin\shp2pgsql -s 27572 -c -g the_geom -W LATIN1 -I noeud_rhtot_3035.shp rht_noeud > rht_noeud.sql |
| 46 | (I can't convert this version into utf8 with notepad) |
| 47 | C:\"Program Files"\PostgreSQL\8.4\bin\psql -d eda2.0_RHT -h localhost -U postgres -p 5432 -f rht_noeud.sql |
| 48 | |
| 49 | alter table rht_noeud set schema rht; |
| 50 | |
| 51 | CREATE INDEX indexnoeud |
| 52 | ON rht.rht_noeud |
| 53 | USING btree (node_id); |
| 54 | }}} |
| 55 | |
| 56 | Topology de l'amont vers l'aval. |
| 57 | |
| 58 | === Noeuds mer === |
| 59 | {{{ |
| 60 | #!sql |
| 61 | select * from rht.topologie_rht_sept2011 where tnode not in (select fnode from rht.topologie_rht_sept2011); |
| 62 | }}} |