comparison schema/search_functions.sql @ 3738:9f20d2b59d4c

Added ISRS code search for rhm.
author Sascha Wilde <wilde@intevation.de>
date Mon, 24 Jun 2019 11:56:38 +0200
parents e3f15a163823
children e1bd5391a4b8
comparison
equal deleted inserted replaced
3737:e3f15a163823 3738:9f20d2b59d4c
23 FROM (SELECT (location_code).hectometre || ' rhm' AS name, 23 FROM (SELECT (location_code).hectometre || ' rhm' AS name,
24 replace(concat(location_code), ',','') AS locationcode, 24 replace(concat(location_code), ',','') AS locationcode,
25 ST_AsGeoJSON(geom)::json AS geom, 'rhm' AS type 25 ST_AsGeoJSON(geom)::json AS geom, 'rhm' AS type
26 FROM waterway.distance_marks_virtual 26 FROM waterway.distance_marks_virtual
27 WHERE (location_code).hectometre = search_string::int) r; 27 WHERE (location_code).hectometre = search_string::int) r;
28 ELSIF is_ISRSstring(search_string) THEN
29 SELECT COALESCE(json_agg(r),'[]')
30 INTO _result
31 FROM (SELECT (location_code).hectometre || ' rhm' AS name,
32 replace(concat(location_code), ',','') AS locationcode,
33 ST_AsGeoJSON(geom)::json AS geom, 'rhm' AS type
34 FROM waterway.distance_marks_virtual
35 WHERE location_code = isrs_fromText(search_string)) r;
28 ELSE 36 ELSE
29 _result='[]'; 37 _result='[]';
30 END IF; 38 END IF;
31 RETURN _result; 39 RETURN _result;
32 END; 40 END;