Created
February 13, 2015 16:29
-
-
Save rmarianski/198ce34d12ebbb05923c to your computer and use it in GitHub Desktop.
migrate waterway dock
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BEGIN; | |
ALTER TABLE planet_osm_polygon DISABLE TRIGGER USER; | |
COMMIT; | |
BEGIN; | |
CREATE OR REPLACE FUNCTION mz_calculate_is_water( | |
waterway_val text, natural_val text, landuse_val text) | |
RETURNS BOOLEAN AS $$ | |
BEGIN | |
RETURN ( | |
waterway_val IN ('riverbank', 'dock') | |
OR natural_val IN ('water') | |
OR landuse_val IN ('basin', 'reservoir') | |
); | |
END; | |
$$ LANGUAGE plpgsql IMMUTABLE; | |
COMMIT; | |
BEGIN; | |
UPDATE planet_osm_polygon | |
SET mz_is_water = TRUE | |
WHERE mz_is_water IS NOT TRUE AND waterway='dock'; | |
COMMIT; | |
BEGIN; | |
ALTER TABLE planet_osm_polygon ENABLE TRIGGER USER; | |
COMMIT; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment