268 | | }}} |
| 268 | |
| 269 | --------------------------------------- |
| 270 | create table rht.proj1 as ( |
| 271 | select id_drain, st_buffer(the_geom,150) as the_geom from rht.rhtvs2); |
| 272 | |
| 273 | create table rht.proj2 as ( |
| 274 | select id_drain, st_exteriorring(st_buffer(the_geom,150)) as the_geom from rht.rhtvs2); ---105044 ms |
| 275 | |
| 276 | select * from bd_carthage2011.troncon_hydrographique limit 2 |
| 277 | |
| 278 | drop table if exists rht.proj3; |
| 279 | create table rht.proj3 as ( |
| 280 | select r.id_drain, id_bdcarth, id_bdcarth as idbdc, bdc.the_geom from rht.rhtvs2 r inner join rht.proj1 p on r.id_drain=p.id_drain join bd_carthage2011.troncon_hydrographique bdc |
| 281 | on st_intersects(bdc.the_geom,p.the_geom)); ----176730 ms |
| 282 | |
| 283 | comment on table rht.proj4 is 'Selection des id_bdcarthage à l''extérieur du buffer de 150m (proj1) qui intersect avec st_exteriorint' |
| 284 | |
| 285 | drop table if exists rht.proj4; |
| 286 | create table rht.proj4 as ( |
| 287 | select r.id_drain, id_bdcarth, id_bdcarth as idbdc, bdc.the_geom from rht.rhtvs2 r inner join rht.proj2 p on r.id_drain=p.id_drain join bd_carthage2011.troncon_hydrographique bdc |
| 288 | on st_intersects(bdc.the_geom,p.the_geom)); |
| 289 | }}} |