wiki:Download and load RHT topology

Version 2 (modified by celine, 14 years ago) (diff)

--

back to first page..
back to RHT - Download and load RHT
Go to CookBook join RHT-BDMAP

NTF_France_II_degrees / NTF Lambert zone II (srid 27572) --> ETRS1989-LAEA (srid 3035)

Integrating topology (rht_vs2_export_cjouanin_sept11.csv)

drop table  if exists rht.topologie_rht_sept2011;
CREATE TABLE rht.topologie_rht_sept2011
(
  ID_DRAIN integer,
  Xcdg numeric,
  Ycdg numeric,
  Xstart numeric,
  Ystart numeric,
  Lg numeric,
  Gridid integer,
  Fnode integer,
  Tnode integer,
  Long numeric
);

copy rht.topologie_rht_sept2011 from 'D:/CelineJouanin/RHT_Estimkart/rht_vs2_export_cjouanin_sept11.csv' with csv delimiter as ';' header; 
alter table rht.topologie_rht_sept2011 add constraint  pk_id_drain_topo primary key (id_drain);
set client_encoding to 'latin1';

id_drain 30000 sans topologie
Create a view rht_topology

ALTER TABLE rht.topologie_rht_sept2011 RENAME COLUMN id_drain TO id_draintopo;
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;

Integrating "noeuds"

--Celine
d:
cd D:\CelineJouanin\RHT_Estimkart
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 
(I can't convert this version into utf8 with notepad)
C:\"Program Files"\PostgreSQL\8.4\bin\psql -d eda2.0_RHT -h localhost -U postgres -p 5432 -f rht_noeud.sql 

alter table rht_noeud set schema rht;

CREATE INDEX indexnoeud
ON rht.rht_noeud
USING btree (node_id);

Topology de l'amont vers l'aval.

Noeuds mer

select * from rht.topologie_rht_sept2011 where tnode not in (select fnode from rht.topologie_rht_sept2011);
create view rht.noeudmer as
select * from rht.rht r left join rht.topologie_rht_sept2011 t on r.id_drain=t.id_draintopo;