Skip to content

Commit 2a0f8ea

Browse files
committed
Mention yaml syntax in documentation
1 parent 72b9f13 commit 2a0f8ea

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

docs/core/profiles.md

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -136,14 +136,21 @@ And there are others that take on a numeric value, like:
136136
*Important note: Whenever you want to use any of these categories for a custom profile you need to add them to
137137
`graph.encoded_values` in `config.yml`.*
138138

139-
### Creating the `custom_model_file`: Setting up a custom model
139+
### Setting up a custom model
140140

141141
As we saw in one of the previous sections, the custom weighting function has three parameters that you can adjust:
142142
speed, priority and distance_influence. You can set up rules that determine these parameters from the edge's properties.
143-
A set of such rules is called a 'custom model' and it is written in a dedicated YAML or JSON file,
144-
the `custom_model_file`. We will explain how to set up these rules. Customizing speed and priority is very similar, so
145-
we will explain most of the details you need to know for speed, but they can be applied very much the same way for
146-
priority as well.
143+
A set of such rules is called a 'custom model' and it is written in the YAML language. If you are not familiar with
144+
YAML don't panic. Just make sure you know the very basic concepts like strings, numbers, lists and objects and you
145+
should know enough to understand and use the custom model syntax. But be warned, YAML uses indentation to separate objects,
146+
lists etc. from each other and whitespace is an important part of the syntax.
147+
148+
In the following we will explain how to set up the custom model rules. The rules for speed and priority are very
149+
similar, so in our examples we will first concentrate on the speed rules, but as you will see they can be applied very
150+
much the same way for priority as well.
151+
152+
The custom model can be entered in the custom model box of the web UI or for server configuration it can either be written
153+
within the routing profiles or a dedicated file that is referenced from the routing profiles (`custom_model_file`).
147154

148155
#### The custom model language by the example of customizing `speed`
149156

web-bundle/src/main/resources/com/graphhopper/maps/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
<div id="custom-model-editor"></div>
7373
<div style="overflow: hidden">
7474
<div id="custom-model-util-buttons" class="small_text" style="float: left; padding-right: 10px">
75-
<a id="custom-model-docs" href="https://github.com/graphhopper/graphhopper/blob/master/docs/core/profiles.md#custom-weighting">Docs</a> |
75+
<a id="custom-model-docs" href="https://github.com/graphhopper/graphhopper/blob/master/docs/core/profiles.md#setting-up-a-custom-model">Help</a> |
7676
<button id="custom-model-example">Example</button> |
7777
<button id="custom-model-toggle"></button>
7878
</div>

0 commit comments

Comments
 (0)