comparison schema/search_functions.sql @ 4389:5e38667f740c stretches-for-responsibility

Use stretches as areas of responsibility. This is heavily based on a patch by Tom Gottfried (read: >90% of the work was done by Tom).
author Sascha Wilde <wilde@intevation.de>
date Thu, 12 Sep 2019 18:13:47 +0200
parents b10f210af325
children 7cbe5d32a614
comparison
equal deleted inserted replaced
4371:4a5ed371011f 4389:5e38667f740c
147 INTO _result 147 INTO _result
148 FROM (SELECT id, 148 FROM (SELECT id,
149 objnam AS name, 149 objnam AS name,
150 ST_AsGeoJSON(ST_Envelope(area::geometry))::json AS geom, 150 ST_AsGeoJSON(ST_Envelope(area::geometry))::json AS geom,
151 'stretch' AS type 151 'stretch' AS type
152 FROM waterway.stretches 152 FROM users.stretches
153 WHERE objnam ILIKE '%' || search_string || '%' 153 WHERE objnam ILIKE '%' || search_string || '%'
154 OR nobjnam ILIKE '%' || search_string || '%' 154 OR nobjnam ILIKE '%' || search_string || '%'
155 ORDER BY name) r; 155 ORDER BY name) r;
156 RETURN _result; 156 RETURN _result;
157 END; 157 END;