Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
-- Function: ershkus_fn_buildarea(geometry)
-- DROP FUNCTION ershkus_fn_buildarea(geometry);
CREATE OR REPLACE FUNCTION ershkus_fn_buildarea(geometry)
RETURNS geometry AS
$BODY$
BEGIN
RETURN (SELECT ST_BuildArea($1));
EXCEPTION
WHEN SQLSTATE 'XX000' THEN
RETURN null;
WHEN SQLSTATE '21000' THEN
RETURN null;
END;
$BODY$
LANGUAGE plpgsql VOLATILE
COST 100;
ALTER FUNCTION ershkus_fn_buildarea(geometry)
OWNER TO ershkus;
GRANT EXECUTE ON FUNCTION ershkus_fn_buildarea(geometry) TO public;
GRANT EXECUTE ON FUNCTION ershkus_fn_buildarea(geometry) TO ershkus;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment