Skip to content

Commit f0857c6

Browse files
committed
ORS modifications
1 parent 567a85a commit f0857c6

File tree

69 files changed

+2629
-183
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+2629
-183
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ android/libs/graphhopper-*-android.jar
2727
!/core/src/test/resources/com/graphhopper/reader/osm/*.pbf
2828
*.dem
2929
*.log
30+
core/TODO*.txt
31+
core/files/dem*
3032
/logs
3133
srtmprovider/
3234
cgiarprovider/

api/src/main/java/com/graphhopper/GHRequest.java

+30
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@
2626
import java.util.List;
2727
import java.util.Locale;
2828

29+
// ORS-GH MOD START
30+
// further imports
31+
import com.graphhopper.util.PMap;
32+
// ORS-GH MOD END
33+
2934
/**
3035
* Request object to perform routing with GraphHopper.
3136
*
@@ -47,6 +52,11 @@ public class GHRequest {
4752
private Locale locale = Locale.US;
4853
private CustomModel customModel;
4954

55+
// ORS-GH MOD START
56+
// add class member
57+
private double[] maxSearchDistances;
58+
// ORS-GH MOD END
59+
5060
public GHRequest() {
5161
this(5);
5262
}
@@ -276,4 +286,24 @@ public String toString() {
276286

277287
return res;
278288
}
289+
290+
// ORS-GH MOD START
291+
private PMap additionalHints;
292+
public void setAdditionalHints (PMap hints) {
293+
this.additionalHints = hints;
294+
}
295+
public PMap getAdditionalHints() {
296+
return this.additionalHints;
297+
}
298+
299+
// Modification by Maxim Rylov: Added getMaxSearchDistances method.
300+
public double[] getMaxSearchDistances() {
301+
return maxSearchDistances;
302+
}
303+
304+
// Modification by Maxim Rylov: Added setMaxSearchDistances method.
305+
public void setMaxSearchDistance(double[] distances) {
306+
maxSearchDistances = distances;
307+
}
308+
// ORS-GH MOD END
279309
}

api/src/main/java/com/graphhopper/GHResponse.java

+13
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,19 @@ public class GHResponse {
3434
private final List<ResponsePath> responsePaths = new ArrayList<>(5);
3535
private String debugInfo = "";
3636

37+
// ORS-GH MOD START - additional field used for extra info processing
38+
private final List<Object> objects = new ArrayList<>(1);
39+
40+
public GHResponse addReturnObject(Object obj) {
41+
this.objects.add(obj);
42+
return this;
43+
}
44+
45+
public List<Object> getReturnObjects() {
46+
return objects;
47+
}
48+
// ORS-GH MOD END
49+
3750
public GHResponse() {
3851
}
3952

api/src/main/java/com/graphhopper/util/Parameters.java

+12
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ public static final class Algorithms {
3636
* Unidirectional Dijkstra (not for CH)
3737
*/
3838
public static final String DIJKSTRA = "dijkstra";
39+
/**
40+
* Unidirectional time-dependent Dijkstra
41+
*/
42+
public static final String TD_DIJKSTRA = "td_dijkstra";
3943
/**
4044
* one to many Dijkstra (not yet for edge based #394, not yet for CH)
4145
*/
@@ -44,6 +48,10 @@ public static final class Algorithms {
4448
* Unidirectional A* (not for CH)
4549
*/
4650
public static final String ASTAR = "astar";
51+
/**
52+
* Unidirectional time-dependent A* (not for CH)
53+
*/
54+
public static final String TD_ASTAR = "td_astar";
4755
/**
4856
* Bidirectional A*
4957
*/
@@ -131,6 +139,10 @@ public static final class Routing {
131139
* a rectangle lat1,lon1,lat2,lon2
132140
*/
133141
public static final String BLOCK_AREA = "block_area";
142+
/**
143+
* time-dependent routing requires compatible algorithm and weighting
144+
*/
145+
public static final String TIME_DEPENDENT = "time_dependent";
134146
}
135147

136148
/**

core/pom.xml

+34-1
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,19 @@
5454
<artifactId>jts-core</artifactId>
5555
<version>1.15.1</version>
5656
</dependency>
57+
<dependency>
58+
<groupId>ch.poole</groupId>
59+
<artifactId>ConditionalRestrictionParser</artifactId>
60+
<!-- TODO ORS: where is this defined? <version>${crparser.version}</version> -->
61+
<version>0.3.1</version>
62+
</dependency>
63+
<dependency>
64+
<groupId>ch.poole</groupId>
65+
<artifactId>OpeningHoursParser</artifactId>
66+
<!-- TODO ORS: where is this defined? <version>${ohparser.version}</version> -->
67+
<version>0.25.0</version>
68+
</dependency>
69+
5770
<!-- for using CGIAR: elevation data importing via tif files-->
5871
<dependency>
5972
<groupId>org.apache.xmlgraphics</groupId>
@@ -91,6 +104,18 @@
91104
<version>${project.parent.version}</version>
92105
<scope>test</scope>
93106
</dependency>
107+
<dependency>
108+
<groupId>com.graphhopper</groupId>
109+
<artifactId>graphhopper-api</artifactId>
110+
<version>${project.parent.version}</version>
111+
<scope>compile</scope>
112+
</dependency>
113+
<dependency>
114+
<groupId>us.dustinj.timezonemap</groupId>
115+
<artifactId>timezonemap</artifactId>
116+
<version>3.2</version>
117+
</dependency>
118+
94119
</dependencies>
95120

96121
<build>
@@ -136,6 +161,14 @@
136161
<failOnUnableToExtractRepoInfo>false</failOnUnableToExtractRepoInfo>
137162
</configuration>
138163
</plugin>
164+
<plugin>
165+
<groupId>org.apache.maven.plugins</groupId>
166+
<artifactId>maven-compiler-plugin</artifactId>
167+
<configuration>
168+
<source>8</source>
169+
<target>8</target>
170+
</configuration>
171+
</plugin>
139172
</plugins>
140173

141174
<!-- make version available at runtime via version file -->
@@ -160,4 +193,4 @@
160193
</resource>
161194
</resources>
162195
</build>
163-
</project>
196+
</project>

0 commit comments

Comments
 (0)