Skip to content

Commit f949f95

Browse files
committed
Fixing issues reported by rabbit
1 parent 2c36d57 commit f949f95

File tree

9 files changed

+30
-30
lines changed

9 files changed

+30
-30
lines changed

docs/basic/vehicle.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ Exercise 4: Vehicle routing without penalization
185185

186186
* From the "|place_3|" to "|place_1|"
187187

188-
.. image:: images/vehicle/vehicle_route_going.png
188+
.. image:: images/vehicle/vehicle_route_coming.png
189189
:scale: 25%
190190
:alt: From |place_3| to |place_1|
191191

@@ -227,7 +227,7 @@ Exercise 5: Vehicle routing with penalization
227227

228228
Change the cost values for the :code:`configuration` table, in such a way, that the
229229

230-
* Bicycle roads roads are not used.
230+
* Bicycle roads are not used.
231231

232232
* ``penalty < 0`` makes the road not to be included in the graph.
233233

docs/scripts/basic/graphs/graphs.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ SELECT component FROM all_components WHERE count = (SELECT max FROM max_componen
7979
\o create_vehicle_net1.txt
8080
-- DROP VIEW vehicle_net CASCADE;
8181

82-
CREATE VIEW vehicle_net AS
82+
CREATE OR REPLACE VIEW vehicle_net AS
8383

8484
WITH
8585
all_components AS (SELECT component, count(*) FROM ways GROUP BY component), -- line 6
@@ -105,7 +105,7 @@ SELECT count(*) FROM vehicle_net;
105105

106106
-- DROP VIEW taxi_net;
107107

108-
CREATE VIEW taxi_net AS
108+
CREATE OR REPLACE VIEW taxi_net AS
109109
SELECT
110110
id,
111111
source, target,

docs/scripts/basic/pedestrian/images.sql

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CREATE VIEW stars AS
1+
CREATE OR REPLACE VIEW stars AS
22
SELECT osm_id, id, geom,
33
CASE
44
WHEN osm_id = @OSMID_1@ THEN '@PLACE_1@'
@@ -11,7 +11,7 @@ FROM vertices
1111
WHERE osm_id IN (@OSMID_1@, @OSMID_2@, @OSMID_3@, @OSMID_4@, @OSMID_5@)
1212
ORDER BY osm_id;
1313

14-
CREATE VIEW pedestrian_one_to_one AS
14+
CREATE OR REPLACE VIEW pedestrian_one_to_one AS
1515
WITH dijkstra AS (
1616
SELECT * FROM pgr_dijkstra(
1717
'SELECT id, source, target,
@@ -23,7 +23,7 @@ SELECT * FROM pgr_dijkstra(
2323
)
2424
SELECT seq, start_vid, end_vid, geom AS geom FROM dijkstra JOIN walk_net ON(edge = id);
2525

26-
CREATE VIEW pedestrian_many_to_one AS
26+
CREATE OR REPLACE VIEW pedestrian_many_to_one AS
2727
WITH dijkstra AS (
2828
SELECT * FROM pgr_dijkstra(
2929
'SELECT id, source, target,
@@ -35,7 +35,7 @@ SELECT * FROM pgr_dijkstra(
3535
)
3636
SELECT seq, start_vid, end_vid, geom AS geom FROM dijkstra JOIN walk_net ON(edge = id);
3737

38-
CREATE VIEW pedestrian_one_to_many AS
38+
CREATE OR REPLACE VIEW pedestrian_one_to_many AS
3939
WITH dijkstra AS (
4040
SELECT * FROM pgr_dijkstra(
4141
'SELECT id, source, target,
@@ -47,7 +47,7 @@ SELECT * FROM pgr_dijkstra(
4747
)
4848
SELECT seq, start_vid, end_vid, geom AS geom FROM dijkstra JOIN walk_net ON(edge = id);
4949

50-
CREATE VIEW pedestrian_many_to_many AS
50+
CREATE OR REPLACE VIEW pedestrian_many_to_many AS
5151
WITH dijkstra AS (
5252
SELECT * FROM pgr_dijkstra(
5353
'SELECT id, source, target,
@@ -59,7 +59,7 @@ SELECT * FROM pgr_dijkstra(
5959
)
6060
SELECT seq, start_vid, end_vid, geom AS geom FROM dijkstra JOIN walk_net ON(edge = id);
6161

62-
CREATE VIEW pedestrian_combinations AS
62+
CREATE OR REPLACE VIEW pedestrian_combinations AS
6363
WITH dijkstra AS (
6464
SELECT * FROM pgr_dijkstra(
6565
'SELECT id, source, target,
@@ -73,7 +73,7 @@ WITH dijkstra AS (
7373
)
7474
SELECT seq, start_vid, end_vid, geom AS geom FROM dijkstra JOIN walk_net ON(edge = id);
7575

76-
CREATE VIEW pedestrian_dijkstraCost AS
76+
CREATE OR REPLACE VIEW pedestrian_dijkstraCost AS
7777
WITH dijkstra AS (
7878
SELECT start_vid, end_vid, round(agg_cost::numeric,2) AS agg_cost
7979
FROM pgr_dijkstraCost(

docs/scripts/basic/plpgsql_function/plpgsql_function.sql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,19 +187,19 @@ SELECT 1 AS id, ST_MakePoint(@POINT2_LON@, @POINT2_LAT@)
187187
SELECT * INTO points_on_the_fly
188188
FROM the_points;
189189

190-
CREATE VIEW ch8_using_vehicle AS
190+
CREATE OR REPLACE VIEW ch8_using_vehicle AS
191191
SELECT * FROM wrk_fromAtoB(
192192
'vehicle_net',
193193
@POINT1_LAT@, @POINT1_LON@,
194194
@POINT2_LAT@, @POINT2_LON@);
195195

196-
CREATE VIEW ch8_using_taxi AS
196+
CREATE OR REPLACE VIEW ch8_using_taxi AS
197197
SELECT * FROM wrk_fromAtoB(
198198
'taxi_net',
199199
@POINT1_LAT@, @POINT1_LON@,
200200
@POINT2_LAT@, @POINT2_LON@);
201201

202-
CREATE VIEW ch8_using_walk AS
202+
CREATE OR REPLACE VIEW ch8_using_walk AS
203203
SELECT *
204204
FROM wrk_fromAtoB(
205205
'walk_net',

docs/scripts/basic/sql_function/images.sql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,14 @@ ORDER BY seq;
5656
$BODY$
5757
LANGUAGE 'sql';
5858

59-
CREATE VIEW using_vehicle AS
59+
CREATE OR REPLACE VIEW using_vehicle AS
6060
SELECT *
6161
FROM wrk_image('vehicle_net', @CH7_OSMID_1@, @CH7_OSMID_2@);
6262

63-
CREATE VIEW using_taxi AS
63+
CREATE OR REPLACE VIEW using_taxi AS
6464
SELECT *
6565
FROM wrk_image('taxi_net', @CH7_OSMID_1@, @CH7_OSMID_2@);
6666

67-
CREATE VIEW using_walk AS
67+
CREATE OR REPLACE VIEW using_walk AS
6868
SELECT *
6969
FROM wrk_image('walk_net', @CH7_OSMID_1@, @CH7_OSMID_2@);

docs/scripts/basic/vehicles/images.sql

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
CREATE VIEW vehicle_route_going_png AS
2+
CREATE OR REPLACE VIEW vehicle_route_going_png AS
33
WITH dijkstra AS (
44
SELECT * FROM pgr_dijkstra(
55
'SELECT id, source, target, cost, reverse_cost
@@ -10,7 +10,7 @@ SELECT * FROM pgr_dijkstra(
1010
SELECT seq, start_vid, end_vid, geom FROM dijkstra JOIN vehicle_net ON(edge = id);
1111

1212

13-
CREATE VIEW vehicle_route_coming_png AS
13+
CREATE OR REPLACE VIEW vehicle_route_coming_png AS
1414
WITH dijkstra AS (
1515
SELECT * FROM pgr_dijkstra(
1616
'SELECT id, source, target, cost, reverse_cost
@@ -20,7 +20,7 @@ SELECT * FROM pgr_dijkstra(
2020
)
2121
SELECT seq, start_vid, end_vid, geom FROM dijkstra JOIN vehicle_net ON(edge = id);
2222

23-
CREATE VIEW vehicle_time_is_money_png AS
23+
CREATE OR REPLACE VIEW vehicle_time_is_money_png AS
2424
WITH dijkstra AS (
2525
SELECT * FROM pgr_dijkstra(
2626
'SELECT id, source, target,
@@ -33,7 +33,7 @@ SELECT seq, start_vid, end_vid, geom FROM dijkstra JOIN taxi_net ON(edge = id);
3333

3434
UPDATE configuration SET penalty=1;
3535

36-
CREATE VIEW vehicle_use_penalty_png AS
36+
CREATE OR REPLACE VIEW vehicle_use_penalty_png AS
3737
WITH dijkstra AS (
3838
SELECT * FROM pgr_dijkstra(
3939
'SELECT v.id, source, target,
@@ -47,7 +47,7 @@ SELECT seq, start_vid, end_vid, geom FROM dijkstra JOIN vehicle_net ON(edge = id
4747

4848
-- Not including cycleways
4949
UPDATE configuration SET penalty=-1.0
50-
WHERE tag_key IN ('cycleway');
50+
WHERE tag_key IN ('cycleway') OR tag_value IN ('cycleway');
5151

5252
-- Penalizing with 5 times the costs the unknown
5353
UPDATE configuration SET penalty=5 WHERE tag_value IN ('unclassified');
@@ -61,7 +61,7 @@ WHERE tag_value IN (
6161
'motorway','motorway_junction','motorway_link',
6262
'secondary');
6363

64-
CREATE VIEW vehicle_get_penalized_route_png AS
64+
CREATE OR REPLACE VIEW vehicle_get_penalized_route_png AS
6565
WITH dijkstra AS (
6666
SELECT * FROM pgr_dijkstra(
6767
'SELECT v.id, source, target,
@@ -73,7 +73,7 @@ SELECT * FROM pgr_dijkstra(
7373
)
7474
SELECT seq, geom AS geom FROM dijkstra JOIN vehicle_net ON(edge = id);
7575

76-
CREATE VIEW vehicle_penalty_routes AS
76+
CREATE OR REPLACE VIEW vehicle_penalty_routes AS
7777
WITH dijkstra AS (
7878
SELECT * FROM pgr_dijkstra(
7979
' SELECT gid AS id, source, target, cost_s * penalty AS cost, reverse_cost_s * penalty AS reverse_cost
@@ -94,7 +94,7 @@ SELECT seq,
9494
start_vid, end_vid, the_geom AS geom
9595
FROM dijkstra JOIN ways ON(edge = gid);
9696

97-
CREATE VIEW vehicle_no_penalty_routes AS
97+
CREATE OR REPLACE VIEW vehicle_no_penalty_routes AS
9898
WITH dijkstra AS (
9999
SELECT * FROM pgr_dijkstra(
100100
' SELECT gid AS id, source, target, cost_s AS cost, reverse_cost_s AS reverse_cost FROM ways ',
@@ -113,5 +113,5 @@ SELECT seq,
113113
start_vid, end_vid, the_geom AS geom
114114
FROM dijkstra JOIN ways ON(edge = gid);
115115

116-
CREATE VIEW pedestrian_only_roads AS
116+
CREATE OR REPLACE VIEW pedestrian_only_roads AS
117117
SELECT * FROM ways where tag_id in (119, 122, 114, 118);

docs/scripts/basic/vehicles/vehicles.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ SELECT * FROM pgr_dijkstra(
5353

5454
-- Not including cycleways
5555
UPDATE configuration SET penalty=-1.0
56-
WHERE tag_key IN ('cycleway');
56+
WHERE tag_key IN ('cycleway') OR tag_value IN ('cycleway');
5757

5858
-- Penalizing with 5 times the costs the unknown
5959
UPDATE configuration SET penalty=5 WHERE tag_value IN ('unclassified');
@@ -99,7 +99,7 @@ SELECT * FROM pgr_dijkstra(
9999

100100
\o penalized_view.txt
101101

102-
CREATE VIEW penalized AS
102+
CREATE OR REPLACE VIEW penalized AS
103103
SELECT
104104
v.id, source, target,
105105
cost * penalty AS cost,

locale/en/LC_MESSAGES/basic/vehicle.po

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ msgid ""
318318
msgstr ""
319319

320320
#: ../../build/docs/basic/vehicle.rst:230
321-
msgid "Bicycle roads roads are not used."
321+
msgid "Bicycle roads are not used."
322322
msgstr ""
323323

324324
#: ../../build/docs/basic/vehicle.rst:232

locale/pot/basic/vehicle.pot

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ msgid "Change the cost values for the :code:`configuration` table, in such a way
293293
msgstr ""
294294

295295
#: ../../build/docs/basic/vehicle.rst:230
296-
msgid "Bicycle roads roads are not used."
296+
msgid "Bicycle roads are not used."
297297
msgstr ""
298298

299299
#: ../../build/docs/basic/vehicle.rst:232

0 commit comments

Comments
 (0)