Skip to content

Commit

Permalink
#884 update routing centreline id
Browse files Browse the repository at this point in the history
  • Loading branch information
chmnata committed Mar 11, 2024
1 parent 33cbb07 commit 691e0dc
Showing 1 changed file with 27 additions and 20 deletions.
47 changes: 27 additions & 20 deletions gis/centreline/sql/create_view_routing_centreline_directional.sql
Original file line number Diff line number Diff line change
@@ -1,25 +1,32 @@
CREATE OR REPLACE VIEW gis_core.routing_centreline_directional AS

SELECT
centreline.centreline_id,
concat(centreline.centreline_id, 0)::integer AS id,
centreline.from_intersection_id AS source,
centreline.to_intersection_id AS target,
centreline.shape_length AS cost,
centreline.geom
FROM gis_core.centreline_latest AS centreline

UNION

SELECT
centreline.centreline_id,
concat(centreline.centreline_id, 1)::integer AS id,
centreline.to_intersection_id AS source,
centreline.from_intersection_id AS target,
centreline.shape_length AS cost,
st_reverse(centreline.geom) AS geom
FROM gis_core.centreline_latest AS centreline
WHERE centreline.oneway_dir_code = 0;
SELECT

Check notice on line 3 in gis/centreline/sql/create_view_routing_centreline_directional.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT01: Unnecessary trailing whitespace.
centreline_id,
row_number() OVER () AS id,

Check notice on line 5 in gis/centreline/sql/create_view_routing_centreline_directional.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT01: Unnecessary trailing whitespace.
source,
target,
cost,
geom

FROM (
SELECT
centreline.centreline_id,
centreline.from_intersection_id AS source,
centreline.to_intersection_id AS target,
centreline.shape_length AS cost,

Check failure on line 16 in gis/centreline/sql/create_view_routing_centreline_directional.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

RF04: Keywords should not be used as identifiers.
centreline.geom
FROM gis_core.centreline_latest AS centreline

UNION

SELECT
centreline.centreline_id,
centreline.to_intersection_id AS source,
centreline.from_intersection_id AS target,
centreline.shape_length AS cost,

Check failure on line 26 in gis/centreline/sql/create_view_routing_centreline_directional.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

RF04: Keywords should not be used as identifiers.
st_reverse(centreline.geom) AS geom
FROM gis_core.centreline_latest AS centreline
WHERE centreline.oneway_dir_code = 0) AS dup;

Check failure on line 29 in gis/centreline/sql/create_view_routing_centreline_directional.sql

View workflow job for this annotation

GitHub Actions / SQLFluff Lint

SQLFluff

LT02: Expected line break and no indent before ')'.

ALTER TABLE gis_core.routing_centreline_directional OWNER TO gis_admins;

Expand Down

0 comments on commit 691e0dc

Please sign in to comment.