Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Oct 15, 2024. It is now read-only.

Commit 4bbfd98

Browse files
author
Timothy Ellersiek
authored
Fixing broken image links
1 parent 7fa7a14 commit 4bbfd98

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

‎pgrouting/pgrouting-pleasant-hiking.md‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# How to Guide Routing Algorithms Towards Pleasant Hiking
22

3-
![Coastal Walk From Coogee to Bondi in Sydney](https://raw.githubusercontent.com/gis-ops/tutorials/pgr-hiking/pgrouting/static/img/sydney-coastal-walk.jpg "Coastal Walk From Coogee to Bondi in Sydney")
3+
![Coastal Walk From Coogee to Bondi in Sydney](https://github.com/gis-ops/tutorials/blob/master/pgrouting/static/img/sydney-coastal-walk.jpg "Coastal Walk From Coogee to Bondi in Sydney")
44

55
*source: [sydneycoastwalks.com.au](https://www.sydneycoastwalks.com.au)*
66

@@ -43,7 +43,7 @@ Alternatively, feel free to download the output of this step [here](https://gith
4343

4444
As mentioned above, we will use *osm2po* to generate the topology from the OSM data we generated in the previous step. It is important to understand that OSM data is not routable in its raw form. The geniality of this software is that it isn't only a light-weight routing engine, it also processes the OSM data and outputs a SQL file which can directly be imported to your PostgreSQL database and be used with **pgRouting**. For this tutorial our task is to make sure we output a topology including all highways in the area of interest as we will want to post-process these in the database.
4545

46-
![OpenStreetMap not Routable](https://raw.githubusercontent.com/gis-ops/tutorials/pgr-hiking/pgrouting/static/img/osm2po-topology.jpg "OpenStreetMap data in its pure form is not routable")
46+
![OpenStreetMap not Routable](https://github.com/gis-ops/tutorials/blob/master/pgrouting/static/img/osm2po-topology.jpg "OpenStreetMap data in its pure form is not routable")
4747

4848
*source: [osm2po](http://osm2po.de/)*
4949

@@ -102,7 +102,7 @@ Objective of this tutorial is to guide Dijkstra's algorithm along the coast of S
102102

103103
The choice being Sydney's coastal walk is quite convenient. There exist many roads you could walk on which are more or less parallel to the coastal footpaths, obviously getting you faster to the destination. The reason is straightforward: the distance is shorter. If you take a quick glimpse at what common routing services usually compute, such as [Google Maps](https://maps.google.com/), you will understand what we mean and why you may want to do some customizing.
104104

105-
![Google Maps from Coogee to Bondi](https://raw.githubusercontent.com/gis-ops/tutorials/pgr-hiking/pgrouting/static/img/google-coogee-bondi.jpg "Google Maps from Coogee to Bondi")
105+
![Google Maps from Coogee to Bondi](https://github.com/gis-ops/tutorials/blob/master/pgrouting/static/img/google-coogee-bondi.jpg "Google Maps from Coogee to Bondi")
106106

107107
*source: [Google Maps](https://maps.google.com/)*
108108

@@ -147,7 +147,7 @@ JOIN syd_2po_4pgr AS pt
147147

148148
...your result should look like the following (which is very similar to what we got using Google Maps up top):
149149

150-
![pgRouting from Coogee to Bondi using the ST_Length](https://raw.githubusercontent.com/gis-ops/tutorials/pgr-hiking/pgrouting/static/img/pgr_shortest_path.jpg "pgRouting from Coogee to Bondi using the ST_Length")
150+
![pgRouting from Coogee to Bondi using the ST_Length](https://github.com/gis-ops/tutorials/blob/master/pgrouting/static/img/pgr_shortest_path.jpg "pgRouting from Coogee to Bondi using the ST_Length")
151151

152152
Well, it's the shortest path and we aren't satisfied with this result as we want to see the coast non-stop. This is where we will exploit the nature of the algorithm and guide it onto footpaths as much as we can (and guess what: the coastal tracks are foopaths). If you remember we imported the OpenStreetMap data at the beginning which we will now join to the topology allowing us to decrease the cost of the edges in question. To this end, we will add an auxiliary column `cost_updated` to our topology table (which will be consumed by pgRouting later on). Subsequently we will populate this column using a very straightforward logic. If the source osm_id of the record (edge) is tagged `footway, pedestrian, living_street, cycleway, track` or `steps` (in `planet_osm_line` or `planet_osm_polygon`), we will divide the length of the edge by 1000, otherwise the cost remains the metric length. The division ultimately makes the cost very cheap, i.e. the algorithm will be guided onto this subset of edges.
153153

@@ -184,7 +184,7 @@ WHERE t.osm_id = l.osm_id;
184184

185185
Executing the query once again from above and instead of using `ST_Length(ST_Transform(geom_way, 3857)) AS cost` but `cost_updated AS cost`, your route will look something like this - enjoy the walk!
186186

187-
![pgRouting from Coogee to Bondi Guiding Dijkstra along the Coast](https://raw.githubusercontent.com/gis-ops/tutorials/pgr-hiking/pgrouting/static/img/pgr_adapted_least_cost_path.jpg "pgRouting from Coogee to Bondi Guiding the Algorithm along the Coast")
187+
![pgRouting from Coogee to Bondi Guiding Dijkstra along the Coast](https://github.com/gis-ops/tutorials/blob/master/pgrouting/static/img/pgr_adapted_least_cost_path.jpg "pgRouting from Coogee to Bondi Guiding the Algorithm along the Coast")
188188

189189
### Wrap-up
190190

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /