Changes between Version 35 and Version 36 of import layers postgis


Ignore:
Timestamp:
Jul 13, 2018 1:43:29 PM (7 years ago)
Author:
maria
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • import layers postgis

    v35 v36  
    347347== Select some bassins to calculate topology == 
    348348{{{#!sh 
    349 set search_path to public, spain, european_wise2008 -- location of the tables in the scheme 
    350  
     349set search_path to public, spain, european_wise2008 ; -- location of the tables in the scheme 
     350 
     351-- First trial with two layers ("a_cuencas_rios_atl_norte" and "a_rios_v2") 
     352-- Function to select some bassins to calculate topology 
    351353-- Rivers 
    352354--select  * from a_rios_v2 limit 10;            -- visualize 10 first rows 
     
    363365   rio = SUBSTR(pfafrio, 6, 2) 
    364366 
    365 -- Test with '10037%' that  corresponds to the Biscay coast of Spain: 
    366 create table spain.biscay_coast_a_rios_v2 as select * from a_rios_v2 where pfafrio like '10037%'; 
    367  
    368367--SELECT *, pfafrio, (SUBSTR(pfafrio, 1, 5) = '10037%') FROM a_rios_v2; -- create a column boolean to say TRUE/FALSE  
    369368--SELECT *, SUBSTR(pfafrio, 1, 5) "pfafbas", SUBSTR(pfafrio, 6, 2) "rios" 
    370369--FROM a_rios_v2; 
     370 
     371 
     372-- Test with '10037%' that  corresponds to the Biscay coast of Spain: 
     373-- Table of Basins 
     374drop table if exists biscay_coast_cuenca; 
     375create table biscay_coast_cuenca as select * from a_cuencas_rios_atl_norte where pfafrio like '10037%'; 
     376 
     377CREATE INDEX biscay_coast_cuenca_geom_idx 
     378  ON biscay_coast_cuenca 
     379  USING gist 
     380  (geom); 
     381 
     382-- Table of rivers 
     383drop table if exists biscay_coast_a_rios_v2; 
     384create table biscay_coast_a_rios_v2 as select * from a_rios_v2 where pfafrio like '10037%'; 
     385 
     386CREATE INDEX biscay_coast_a_rios_v2_geom_idx 
     387  ON biscay_coast_a_rios_v2 
     388  USING gist 
     389  (geom); 
     390 
    371391}}} 
    372392 
    373393Check in QGis the rivers created according to the 6th and 7th position of code in pfafrio [[BR]] 
    374 [[Image(source:eda/data/Docs/trac/sudoang/test_biscay_coast.png,400px)]] 
     394[[Image(source:eda/data/Docs/trac/sudoang/test_biscay_coast.png,400px)]] [[BR]] 
     395 
     396pgRouting, configuration on table and ltree 
     397{{{#!sh 
     398ALTER TABLE biscay_coast_a_rios_v2 DROP COLUMN if exists source; 
     399ALTER TABLE biscay_coast_a_rios_v2 DROP COLUMN if exists target; 
     400ALTER TABLE biscay_coast_a_rios_v2 ADD COLUMN source integer; 
     401ALTER TABLE biscay_coast_a_rios_v2 ADD COLUMN target integer; 
     402CREATE INDEX biscay_coast_a_rios_v2_source_idx ON biscay_coast_a_rios_v2 (source); 
     403CREATE INDEX biscay_coast_a_rios_v2_target_idx ON biscay_coast_a_rios_v2 (target); 
     404 
     405--------------------------------------------------------------------- 
     406-- createTopology also creates biscay_coast_a_rios_v2_vertices_pgr 
     407------------------------------------------------------------------ 
     408SELECT pgr_createTopology('biscay_coast_a_rios_v2', 0.0001, 'geom', 'gid'); 
     409}}} 
     410 
     411Get error creating topology