-
Notifications
You must be signed in to change notification settings - Fork 1.5k
/
Parameters.java
217 lines (198 loc) · 8.21 KB
/
Parameters.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
/*
* Licensed to GraphHopper GmbH under one or more contributor
* license agreements. See the NOTICE file distributed with this work for
* additional information regarding copyright ownership.
*
* GraphHopper GmbH licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.graphhopper.util;
/**
* @author Peter Karich
*/
public class Parameters {
/* Parameters with an 'INIT' prefix are used as defaults and/or are configured at start.*/
static final String ROUTING_INIT_PREFIX = "routing.";
/**
* Parameters that can be used for algorithm.
*/
public static final class Algorithms {
/**
* Bidirectional Dijkstra
*/
public static final String DIJKSTRA_BI = "dijkstrabi";
/**
* Unidirectional Dijkstra (not for CH)
*/
public static final String DIJKSTRA = "dijkstra";
/**
* one to many Dijkstra (not yet for edge based #394, not yet for CH)
*/
public static final String DIJKSTRA_ONE_TO_MANY = "dijkstra_one_to_many";
/**
* Unidirectional A* (not for CH)
*/
public static final String ASTAR = "astar";
/**
* Bidirectional A*
*/
public static final String ASTAR_BI = "astarbi";
/**
* alternative route algorithm (not yet for CH)
*/
public static final String ALT_ROUTE = "alternative_route";
/**
* round trip algorithm (not yet for CH)
*/
public static final String ROUND_TRIP = "round_trip";
/**
* All public properties for alternative routing.
*/
public static final class AltRoute {
public static final String MAX_PATHS = ALT_ROUTE + ".max_paths";
public static final String MAX_WEIGHT = ALT_ROUTE + ".max_weight_factor";
public static final String MAX_SHARE = ALT_ROUTE + ".max_share_factor";
}
public static final class AStar {
public static final String EPSILON = ASTAR + ".epsilon";
}
public static final class AStarBi {
public static final String EPSILON = ASTAR_BI + ".epsilon";
}
/**
* All public properties for round trip calculation.
*/
public static final class RoundTrip {
public static final String DISTANCE = ROUND_TRIP + ".distance";
public static final String SEED = ROUND_TRIP + ".seed";
public static final String POINTS = ROUND_TRIP + ".points";
public static final String INIT_MAX_RETRIES = ROUTING_INIT_PREFIX + ROUND_TRIP + ".max_retries";
}
}
/**
* Parameters that can be passed as hints and influence routing per request.
*/
public static final class Routing {
public static final String EDGE_BASED = "edge_based";
public static final String TURN_COSTS = "turn_costs";
public static final String U_TURN_COSTS = "u_turn_costs";
public static final String MAX_VISITED_NODES = "max_visited_nodes";
public static final String INIT_MAX_VISITED_NODES = ROUTING_INIT_PREFIX + "max_visited_nodes";
/**
* if true the response will contain turn instructions
*/
public static final String INSTRUCTIONS = "instructions";
/**
* if true the response will contain a point list
*/
public static final String CALC_POINTS = "calc_points";
/**
* configure simplification of returned point list
*/
public static final String WAY_POINT_MAX_DISTANCE = "way_point_max_distance";
public static final String INIT_WAY_POINT_MAX_DISTANCE = ROUTING_INIT_PREFIX + "way_point_max_distance";
/**
* true or false. If routes at via points should avoid u-turns. (not for CH) See related
* 'heading' parameter:
* https://github.com/graphhopper/graphhopper/blob/master/docs/core/routing.md#heading
*/
public static final String PASS_THROUGH = "pass_through";
public static final String POINT_HINT = "point_hint";
public static final String CURBSIDE = "curbside";
public static final String FORCE_CURBSIDE = "force_curbside";
public static final String SNAP_PREVENTION = "snap_prevention";
/**
* default heading penalty in seconds
*/
public static final double DEFAULT_HEADING_PENALTY = 300;
public static final String HEADING_PENALTY = "heading_penalty";
/**
* block road access via a point in the format lat,lon or an area defined by a circle lat,lon,radius or
* a rectangle lat1,lon1,lat2,lon2
*/
public static final String BLOCK_AREA = "block_area";
}
/**
* Possible values of {@link Parameters.Routing#CURBSIDE}
*/
public static final class CurbSides {
public static final String CURBSIDE_LEFT = "left";
public static final String CURBSIDE_RIGHT = "right";
public static final String CURBSIDE_ANY = "any";
}
/**
* Properties for routing with contraction hierarchies speedup
*/
public static final class CH {
public static final String PREPARE = "prepare.ch.";
/**
* This property name in HintsMap configures at runtime if CH routing should be ignored.
*/
public static final String DISABLE = "ch.disable";
/**
* This property name configures at start if the DISABLE parameter can have an effect.
*/
public static final String INIT_DISABLING_ALLOWED = ROUTING_INIT_PREFIX + "ch.disabling_allowed";
/**
* The property name in HintsMap if heading should be used for CH regardless of the possible
* routing errors.
*/
public static final String FORCE_HEADING = "ch.force_heading";
}
/**
* Properties for routing with landmark speedup
*/
public static final class Landmark {
public static final String PREPARE = "prepare.lm.";
/**
* This property name in HintsMap configures at runtime if CH routing should be ignored.
*/
public static final String DISABLE = "lm.disable";
/**
* Specifies how many active landmarks should be used when routing
*/
public static final String ACTIVE_COUNT = "lm.active_landmarks";
/**
* Default for active count
*/
public static final String ACTIVE_COUNT_DEFAULT = ROUTING_INIT_PREFIX + ACTIVE_COUNT;
/**
* Specifies how many landmarks should be created
*/
public static final String COUNT = PREPARE + "landmarks";
/**
* This property name configures at start if the DISABLE parameter can have an effect.
*/
public static final String INIT_DISABLING_ALLOWED = ROUTING_INIT_PREFIX + "lm.disabling_allowed";
}
/**
* Properties for non-CH routing
*/
public static final class NON_CH {
private static final String NON_CH_PREFIX = "non_ch.";
/**
* Describes the maximum allowed distance between two consecutive waypoints of a non-CH request. Distance is in meter.
*/
public static final String MAX_NON_CH_POINT_DISTANCE = ROUTING_INIT_PREFIX + NON_CH_PREFIX + "max_waypoint_distance";
}
/**
* Properties for the details response
*/
public static final class Details {
public static final String PATH_DETAILS = "details";
public static final String AVERAGE_SPEED = "average_speed";
public static final String STREET_NAME = "street_name";
public static final String EDGE_ID = "edge_id";
public static final String TIME = "time";
public static final String DISTANCE = "distance";
}
}