Changes between Initial Version and Version 1 of Download and load RHT topology


Ignore:
Timestamp:
Oct 3, 2011 5:30:49 PM (14 years ago)
Author:
celine
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Download and load RHT topology

    v1 v1  
     1back to first page[..][[BR]] 
     2back to ["RHT"] - ["Download and load RHT"][[BR]] 
     3Go to ["CookBook join RHT-BDMAP"][[BR]] 
     4 
     5NTF_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 
     11drop table  if exists rht.topologie_rht_sept2011; 
     12CREATE 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 
     26copy rht.topologie_rht_sept2011 from 'D:/CelineJouanin/RHT_Estimkart/rht_vs2_export_cjouanin_sept11.csv' with csv delimiter as ';' header;  
     27alter table rht.topologie_rht_sept2011 add constraint  pk_id_drain_topo primary key (id_drain); 
     28set client_encoding to 'latin1'; 
     29}}} 
     30 
     31id_drain 30000 sans topologie [[BR]] 
     32Create a view rht_topology 
     33{{{ 
     34#!sql 
     35ALTER TABLE rht.topologie_rht_sept2011 RENAME COLUMN id_drain TO id_draintopo; 
     36CREATE 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 
     43d: 
     44cd D:\CelineJouanin\RHT_Estimkart 
     45C:\"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) 
     47C:\"Program Files"\PostgreSQL\8.4\bin\psql -d eda2.0_RHT -h localhost -U postgres -p 5432 -f rht_noeud.sql  
     48 
     49alter table rht_noeud set schema rht; 
     50 
     51CREATE INDEX indexnoeud 
     52ON rht.rht_noeud 
     53USING btree (node_id); 
     54}}} 
     55 
     56Topology de l'amont vers l'aval. 
     57 
     58=== Noeuds mer === 
     59{{{ 
     60#!sql 
     61select * from rht.topologie_rht_sept2011 where tnode not in (select fnode from rht.topologie_rht_sept2011); 
     62}}}