Changes between Version 21 and Version 22 of import layers postgis


Ignore:
Timestamp:
Jun 23, 2018 8:36:13 PM (7 years ago)
Author:
cedric
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • import layers postgis

    v21 v22  
    107107$$ 
    108108BEGIN 
    109         RAISE NOTICE 'downstream segment for %', _id;    -- prints the selected segment 
    110         RETURN QUERY    
     109        RAISE NOTICE 'downstream segment for %', _id;                                 -- prints the selected segment 
     110        RETURN QUERY                                                                  -- RETURN QUERY allows to return a table without loop 
    111111             SELECT r.pfafcuen, r.lngtramo_m from  oria_a_rios_v2 r  
    112112                WHERE 
    113113                 substring(_id::text,1,char_length(_id::text)-1)=  
    114                    substring(r.pfafcuen::text,1,char_length(r.pfafcuen::text)-1)  
     114                   substring(r.pfafcuen::text,1,char_length(r.pfafcuen::text)-1)     -- the selection is done on a subset eg. 10011 10013  10015  10017  will be selected using string 1001 
    115115                AND 
    116                  _id>r.pfafcuen 
     116                 _id>r.pfafcuen                                                      -- we select only segments downstream from the current one 
    117117                AND 
    118                  (r.pfafcuen::numeric % 2) = 1  
    119                order by r.pfafcuen::numeric DESC;  -- even number                
     118                 (r.pfafcuen::numeric % 2) = 1                                       -- even number      
     119               order by r.pfafcuen::numeric DESC;        
    120120END 
    121121$$