Changes between Version 9 and Version 10 of Noeud - parcours RHT


Ignore:
Timestamp:
Jan 4, 2012 4:20:39 PM (13 years ago)
Author:
celine
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Noeud - parcours RHT

    v9 v10  
    6868}}} 
    6969 
     70== Joining ROE with RHT == 
     71Projection spatiale des obstacles (points) sur le RHT (lignes) avec un buffer de 300 m [[BR]] 
     72{{{ 
     73#!sql 
     74DROP TABLE IF EXISTS rht.rhtvs2_roev2; 
     75CREATE TABLE rht.rhtvs2_roev2 as ( 
     76        SELECT distinct on (id_roe) id_roe, id_drain, min(distance) as distance, the_geom FROM ( 
     77               SELECT id_roe, id_drain ,CAST(distance(r.the_geom, s.the_geom) as  decimal(15,1)) as distance, s.the_geom  
     78               FROM roe_v2.roe_v2 As s 
     79               INNER JOIN  rht.rhtvs2 r ON ST_DWithin(r.the_geom, s.the_geom,300) 
     80               WHERE s.the_geom IS NOT NULL 
     81               ORDER BY id_roe) AS sub  
     82        GROUP BY id_roe, distance,id_drain, the_geom  ---49269 lines 
     83);  
     84alter table rht.rhtvs2_roev2 add column id serial; 
     85-- mise à jour de la table geometry_columns 
     86INSERT INTO geometry_columns(f_table_catalog, f_table_schema, f_table_name, f_geometry_column, coord_dimension, srid, "type") 
     87SELECT '', 'rht', 'rhtvs2_roev2', 'the_geom', ST_CoordDim(the_geom), ST_SRID(the_geom), GeometryType(the_geom) 
     88FROM rht.rhtvs2_roev2 LIMIT 1; 
    7089 
    71 #A FINIR !!  
     90-- creation d'index, clé primaire, et constraintes qui vont bien 
     91alter table rht.rhtvs2_roev2 add CONSTRAINT enforce_dims_the_geom CHECK (ndims(the_geom) = 2); 
     92alter table rht.rhtvs2_roev2 add  CONSTRAINT enforce_geotype_the_geom CHECK (geometrytype(the_geom) = 'POINT'::text OR the_geom IS NULL); 
     93alter table rht.rhtvs2_roev2 add  CONSTRAINT enforce_srid_the_geom CHECK (srid(the_geom) = 3035); 
     94alter table rht.rhtvs2_roev2 ADD CONSTRAINT pk_idroe PRIMARY KEY(id); 
     95alter table rht.rhtvs2_roev2 drop CONSTRAINT pk_idroe; 
     96CREATE INDEX indexroev2_rhtvs2 ON rht.rhtvs2_roev2 
     97  USING GIST ( the_geom GIST_GEOMETRY_OPS ); 
     98}}} 
     99 
     100 
     101#A FINIR ci-dessous !!  
    72102== Comment aller chercher les infos sur le nombre de barrages et la distance mer, les données sont dans la ccm ? == 
    73103