Manage field mapping in SQL declaratively
Simplify some of the OSM->OMT field value mappings using declarative syntax. This approach is not for all cases, but in many it removes the need of storing the same field in both the .yaml and .sql files. TODO: support more complex AND/OR cases
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
CREATE OR REPLACE FUNCTION water_class(waterway TEXT) RETURNS TEXT AS $$
|
||||
SELECT CASE
|
||||
WHEN waterway='' THEN 'lake'
|
||||
WHEN waterway='lake' THEN 'lake'
|
||||
WHEN waterway='dock' THEN 'dock'
|
||||
%%FIELD_MAPPING: class %%
|
||||
ELSE 'river'
|
||||
END;
|
||||
$$ LANGUAGE SQL IMMUTABLE;
|
||||
|
||||
Reference in New Issue
Block a user