Skip to content

Commit

Permalink
#885 more fluff
Browse files Browse the repository at this point in the history
  • Loading branch information
chmnata authored and radumas committed Apr 22, 2024
1 parent 798a3d5 commit a12ee12
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ CREATE OR REPLACE FUNCTION gis_core.get_centreline_btwn_intersections(
OUT _node_start_out integer,
OUT _node_end integer,
OUT links text [],
OUT geom geometry)

OUT geom geometry
)

RETURNS record
LANGUAGE 'sql'
COST 100
Expand All @@ -27,7 +28,7 @@ $BODY$;
ALTER FUNCTION gis_core.get_centreline_btwn_intersections(integer, integer) OWNER TO gis_admins;

COMMENT ON FUNCTION gis_core.get_centreline_btwn_intersections(integer, integer)
IS 'Routing function for centreline, takes in start intersection_id and end intersection_id and returns an array of centreline_id, as well as one line geometry between two intersections.';
IS 'Routing function for centreline, takes in start intersection_id and end intersection_id and returns an array of centreline_id, as well as one line geometry between two intersections.';

GRANT EXECUTE ON FUNCTION gis_core.get_centreline_btwn_intersections(integer, integer) TO bdit_humans;

Expand Down
12 changes: 6 additions & 6 deletions gis/centreline/sql/create_matview_centreline_latest.sql
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
CREATE MATERIALIZED VIEW gis_core.centreline_latest AS
CREATE MATERIALIZED VIEW gis_core.centreline_latest AS

SELECT *
FROM gis_core.centreline
WHERE version_date = (SELECT MAX(version_date) FROM gis_core.centreline);
WHERE version_date = (SELECT MAX(version_date) FROM gis_core.centreline);

CREATE TRIGGER refresh_trigger
AFTER INSERT OR UPDATE OR DELETE
ON gis_core.centreline
FOR EACH STATEMENT
EXECUTE PROCEDURE gis_core.centreline_latest_trigger();
AFTER INSERT OR UPDATE OR DELETE
ON gis_core.centreline
FOR EACH STATEMENT
EXECUTE PROCEDURE gis_core.centreline_latest_trigger();

CREATE INDEX gis_core_centreline_latest_geom ON gis_core.centreline_latest USING gist (geom);

Expand Down
5 changes: 2 additions & 3 deletions gis/centreline/sql/create_trigger_centreline_latest.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
CREATE OR REPLACE FUNCTION gis_core.centreline_latest_trigger()
RETURNS trigger
RETURNS trigger
LANGUAGE 'plpgsql'
COST 100
VOLATILE NOT LEAKPROOF SECURITY DEFINER
Expand All @@ -14,5 +14,4 @@ $BODY$;

ALTER FUNCTION gis_core.centreline_latest_trigger() OWNER TO gis_admins;

COMMENT ON FUNCTION gis_core.centreline_latest_trigger() IS 'Trigger fuction that refreshes the centreline_latest mat view after an update.';

COMMENT ON FUNCTION gis_core.centreline_latest_trigger() IS 'Trigger fuction that refreshes the centreline_latest mat view after an update.';
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ WHERE centreline.oneway_dir_code = 0;
ALTER TABLE gis_core.routing_centreline_directional OWNER TO gis_admins;

COMMENT ON VIEW gis_core.routing_centreline_directional
IS 'A view that contains centreline streets for routing, with duplicated rows for two-way streets and flipped geometries when necessary. A new id has been assigned to each centreline to distinguish duplicated lines.';
IS 'A view that contains centreline streets for routing, with duplicated rows for two-way streets and flipped geometries when necessary. A new id has been assigned to each centreline to distinguish duplicated lines.';

GRANT SELECT ON TABLE gis_core.routing_centreline_directional TO bdit_humans;
GRANT ALL ON TABLE gis_core.routing_centreline_directional TO gis_admins;
Expand Down

0 comments on commit a12ee12

Please sign in to comment.