Changes between Version 21 and Version 22 of import layers postgis
- Timestamp:
- Jun 23, 2018 8:36:13 PM (7 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
import layers postgis
v21 v22 107 107 $$ 108 108 BEGIN 109 RAISE NOTICE 'downstream segment for %', _id; -- prints the selected segment110 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 111 111 SELECT r.pfafcuen, r.lngtramo_m from oria_a_rios_v2 r 112 112 WHERE 113 113 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 115 115 AND 116 _id>r.pfafcuen 116 _id>r.pfafcuen -- we select only segments downstream from the current one 117 117 AND 118 (r.pfafcuen::numeric % 2) = 1 119 order by r.pfafcuen::numeric DESC; -- even number118 (r.pfafcuen::numeric % 2) = 1 -- even number 119 order by r.pfafcuen::numeric DESC; 120 120 END 121 121 $$