Skip to content

Commit 6db7af9

Browse files
author
Peter
committed
merged master, moving to 0.5.0
2 parents cc19543 + d3fdc54 commit 6db7af9

Some content is hidden

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

41 files changed

+347
-306
lines changed

android/app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ configurations.all {
3535
**/
3636

3737
dependencies {
38-
compile(group: 'com.graphhopper', name: 'graphhopper', version: '0.5.0-RC1') {
38+
compile(group: 'com.graphhopper', name: 'graphhopper', version: '0.5.0') {
3939
exclude group: 'com.google.protobuf', module: 'protobuf-java'
4040
exclude group: 'org.openstreetmap.osmosis', module: 'osmosis-osm-binary'
4141
exclude group: 'org.apache.xmlgraphics', module: 'xmlgraphics-commons'

android/app/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<modelVersion>4.0.0</modelVersion>
55
<groupId>com.graphhopper</groupId>
66
<artifactId>graphhopper-android</artifactId>
7-
<version>0.5.0-RC1</version>
7+
<version>0.5.0</version>
88
<name>GraphHopper Android</name>
99
<packaging>apk</packaging>
1010
<organization>
@@ -16,7 +16,7 @@
1616
<relativePath>../..</relativePath>
1717
<groupId>com.graphhopper</groupId>
1818
<artifactId>graphhopper-parent</artifactId>
19-
<version>0.5.0-RC1</version>
19+
<version>0.5.0</version>
2020
</parent>
2121
<properties>
2222
<mapsforge.version>0.5.1</mapsforge.version>

core/files/map-sidewalk-no.osm.gz

96.1 KB
Binary file not shown.

core/files/update-translations.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ cd $HOME/..
33

44
destination=src/main/resources/com/graphhopper/util/
55

6-
translations="en_US SKIP ar bg ca cs_CZ de_DE el es fa fil fi fr gl he hsb hu_HU it ja lt_LT ne nl pl_PL pt_BR pt_PT ro ru si sk sv_SE tr uk vi_VI zh_CN"
6+
translations="en_US SKIP ar ast bg ca cs_CZ da_DK de_DE el es fa fil fi fr gl he hsb hu_HU it ja lt_LT ne nl pl_PL pt_BR pt_PT ro ru si sk sv_SE tr uk vi_VI zh_CN"
77
file=$1
88

99
# You can execute the following

core/pom.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<groupId>com.graphhopper</groupId>
77
<artifactId>graphhopper</artifactId>
88
<name>GraphHopper</name>
9-
<version>0.5.0-RC1</version>
9+
<version>0.5.0</version>
1010
<packaging>jar</packaging>
1111
<description>
1212
GraphHopper is a fast and memory efficient Java road routing engine
@@ -15,7 +15,7 @@
1515
<parent>
1616
<groupId>com.graphhopper</groupId>
1717
<artifactId>graphhopper-parent</artifactId>
18-
<version>0.5.0-RC1</version>
18+
<version>0.5.0</version>
1919
</parent>
2020

2121
<properties>
@@ -70,7 +70,7 @@
7070
<dependency>
7171
<groupId>org.apache.xmlgraphics</groupId>
7272
<artifactId>xmlgraphics-commons</artifactId>
73-
<version>1.5</version>
73+
<version>2.0.1</version>
7474
</dependency>
7575

7676
<dependency>
@@ -81,7 +81,7 @@
8181
<dependency>
8282
<groupId>org.openstreetmap.osmosis</groupId>
8383
<artifactId>osmosis-osm-binary</artifactId>
84-
<version>0.43.1</version>
84+
<version>0.44.1</version>
8585
</dependency>
8686

8787
<dependency>

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

Lines changed: 20 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ public GHRequest( int size )
6060

6161
/**
6262
* Set routing request from specified startPlace (fromLat, fromLon) to endPlace (toLat, toLon)
63-
* with a preferred start and end heading.
64-
* Headings are north based azimuth (clockwise) in (0, 360) or NaN for equal preference.
63+
* with a preferred start and end heading. Headings are north based azimuth (clockwise) in (0,
64+
* 360) or NaN for equal preference.
6565
*/
6666
public GHRequest( double fromLat, double fromLon, double toLat, double toLon,
6767
double startHeading, double endHeading )
@@ -77,10 +77,9 @@ public GHRequest( double fromLat, double fromLon, double toLat, double toLon )
7777
this(new GHPoint(fromLat, fromLon), new GHPoint(toLat, toLon));
7878
}
7979

80-
8180
/**
82-
* Set routing request from specified startPlace to endPlace with a preferred start and end heading.
83-
* Headings are north based azimuth (clockwise) in (0, 360) or NaN for equal preference
81+
* Set routing request from specified startPlace to endPlace with a preferred start and end
82+
* heading. Headings are north based azimuth (clockwise) in (0, 360) or NaN for equal preference
8483
*/
8584
public GHRequest( GHPoint startPlace, GHPoint endPlace, double startHeading, double endHeading )
8685
{
@@ -106,19 +105,19 @@ public GHRequest( GHPoint startPlace, GHPoint endPlace )
106105
this(startPlace, endPlace, Double.NaN, Double.NaN);
107106
}
108107

109-
110108
/**
111109
* Set routing request
112-
*
113-
* @param points List of stopover points in order: start, 1st stop, 2nd stop, ..., end
114-
* @param favoredHeadings List of favored headings for starting (start point) and arrival (via and end points)
115-
* Headings are north based azimuth (clockwise) in (0, 360) or NaN for equal preference
110+
* <p>
111+
* @param points List of stopover points in order: start, 1st stop, 2nd stop, ..., end
112+
* @param favoredHeadings List of favored headings for starting (start point) and arrival (via
113+
* and end points) Headings are north based azimuth (clockwise) in (0, 360) or NaN for equal
114+
* preference
116115
*/
117116
public GHRequest( List<GHPoint> points, List<Double> favoredHeadings )
118117
{
119118
if (points.size() != favoredHeadings.size())
120-
throw new IllegalArgumentException("Size of headings (" + favoredHeadings.size() +
121-
") must match size of points (" + points.size() + ")");
119+
throw new IllegalArgumentException("Size of headings (" + favoredHeadings.size()
120+
+ ") must match size of points (" + points.size() + ")");
122121

123122
for (Double heading : favoredHeadings)
124123
{
@@ -130,7 +129,7 @@ public GHRequest( List<GHPoint> points, List<Double> favoredHeadings )
130129

131130
/**
132131
* Set routing request
133-
*
132+
* <p>
134133
* @param points List of stopover points in order: start, 1st stop, 2nd stop, ..., end
135134
*/
136135
public GHRequest( List<GHPoint> points )
@@ -140,19 +139,18 @@ public GHRequest( List<GHPoint> points )
140139

141140
/**
142141
* Add stopover point to routing request.
143-
*
144-
* @param point geographical position (see GHPoint)
142+
* <p>
143+
* @param point geographical position (see GHPoint)
145144
* @param favoredHeading north based azimuth (clockwise) in (0, 360) or NaN for equal preference
146145
*/
147-
public GHRequest addPoint( GHPoint point, Double favoredHeading )
146+
public GHRequest addPoint( GHPoint point, double favoredHeading )
148147
{
149148
if (point == null)
150149
throw new IllegalArgumentException("point cannot be null");
151150

152-
153151
if (!possibleToAdd)
154152
throw new IllegalStateException("Please call empty constructor if you intent to use "
155-
+ "more than two places via addPlace method.");
153+
+ "more than two places via addPoint method.");
156154

157155
points.add(point);
158156
validateAzimuthValue(favoredHeading);
@@ -162,7 +160,7 @@ public GHRequest addPoint( GHPoint point, Double favoredHeading )
162160

163161
/**
164162
* Add stopover point to routing request.
165-
*
163+
* <p>
166164
* @param point geographical position (see GHPoint)
167165
*/
168166
public GHRequest addPoint( GHPoint point )
@@ -185,19 +183,16 @@ public double getFavoredHeading( int i )
185183
public boolean hasFavoredHeading( int i )
186184
{
187185
if (i >= favoredHeadings.size())
188-
throw new IndexOutOfBoundsException("Index: " + i + " too large for list of size " + favoredHeadings.size());
186+
return false;
189187

190188
return !Double.isNaN(favoredHeadings.get(i));
191189
}
192190

193-
// validate Azimuth entry
194-
private void validateAzimuthValue( Double heading )
191+
private void validateAzimuthValue( double heading )
195192
{
196-
// heading must be in (0, 360) oder Nan
193+
// heading must be in (0, 360) oder NaN
197194
if (!Double.isNaN(heading) && ((Double.compare(heading, 360) > 0) || (Double.compare(heading, 0) < 0)))
198-
{
199195
throw new IllegalArgumentException("Heading " + heading + " must be in range (0,360) or NaN");
200-
}
201196
}
202197

203198
public List<GHPoint> getPoints()

core/src/main/java/com/graphhopper/GraphHopper.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -748,7 +748,7 @@ public boolean load( String graphHopperFolder )
748748
if (chEnabled)
749749
{
750750
initCHAlgoFactories();
751-
ghStorage = new GraphHopperStorage(algoFactories.keySet(), dir, encodingManager, hasElevation(), ext);
751+
ghStorage = new GraphHopperStorage(new ArrayList<Weighting>(algoFactories.keySet()), dir, encodingManager, hasElevation(), ext);
752752
} else
753753
ghStorage = new GraphHopperStorage(dir, encodingManager, hasElevation(), ext);
754754

@@ -851,9 +851,7 @@ protected void postProcessing()
851851

852852
initLocationIndex();
853853
if (chEnabled)
854-
{
855854
createCHPreparations();
856-
}
857855

858856
if (!isPrepared())
859857
prepare();

core/src/main/java/com/graphhopper/routing/QueryGraph.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -407,11 +407,11 @@ public boolean enforceHeading( int nodeId, double favoredHeading, boolean incomi
407407

408408
if (Math.abs(delta) > 1.74) // penalize if a turn of more than 100°
409409
{
410-
edge.setVirtualEdgePreference(true, false);
410+
edge.setVirtualEdgePreference(true);
411411
modifiedEdges.add(edge);
412412
//also apply to opposite edge for reverse routing
413413
VirtualEdgeIteratorState reverseEdge = virtualEdges.get(virtNodeIDintern * 4 + getPosOfReverseEdge(edgePos));
414-
reverseEdge.setVirtualEdgePreference(true, true);
414+
reverseEdge.setVirtualEdgePreference(true);
415415
modifiedEdges.add(reverseEdge);
416416
enforcementOccured = true;
417417
}
@@ -435,9 +435,9 @@ public boolean enforceHeadingByEdgeId( int nodeId, int edgeId, boolean incoming
435435

436436
VirtualEdgeIteratorState incomingEdge = (VirtualEdgeIteratorState) getEdgeIteratorState(edgeId, nodeId);
437437
VirtualEdgeIteratorState reverseEdge = (VirtualEdgeIteratorState) getEdgeIteratorState(edgeId, incomingEdge.getBaseNode());
438-
incomingEdge.setVirtualEdgePreference(true, !incoming);
438+
incomingEdge.setVirtualEdgePreference(true);
439439
modifiedEdges.add(incomingEdge);
440-
reverseEdge.setVirtualEdgePreference(true, incoming);
440+
reverseEdge.setVirtualEdgePreference(true);
441441
modifiedEdges.add(reverseEdge);
442442
return true;
443443
}
@@ -449,10 +449,8 @@ public void clearUnfavoredStatus()
449449
{
450450
for (VirtualEdgeIteratorState edge : modifiedEdges)
451451
{
452-
edge.setVirtualEdgePreference(false, false);
453-
edge.setVirtualEdgePreference(false, true);
452+
edge.setVirtualEdgePreference(false);
454453
}
455-
456454
}
457455

458456
@Override

core/src/main/java/com/graphhopper/routing/VirtualEdgeIteratorState.java

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ public class VirtualEdgeIteratorState implements EdgeIteratorState, CHEdgeIterat
3535
private final int adjNode;
3636
private final int originalTraversalKey;
3737
// indication if edges are dispreferred as start/stop edge
38-
private boolean unfavoredReverseEdge;
3938
private boolean unfavored;
4039

4140
public VirtualEdgeIteratorState( int originalTraversalKey, int edgeId, int baseNode, int adjNode, double distance, long flags, String name, PointList pointList )
@@ -149,27 +148,18 @@ public EdgeIteratorState setName( String name )
149148
public boolean getBoolean( int key, boolean reverse, boolean _default )
150149
{
151150
if (key == EdgeIteratorState.K_UNFAVORED_EDGE)
152-
{
153-
if (reverse)
154-
return unfavoredReverseEdge;
155-
else
156-
return unfavored;
157-
}
151+
return unfavored;
152+
158153
// for non-existent keys return default
159154
return _default;
160155
}
161156

162157
/**
163158
* This method sets edge to unfavored status for routing from or to the start/stop points.
164-
* <p>
165-
* @param reverse indicates if forward or backward direction is affected
166159
*/
167-
public void setVirtualEdgePreference( boolean unfavored, boolean reverse )
160+
public void setVirtualEdgePreference( boolean unfavored )
168161
{
169-
if (reverse)
170-
unfavoredReverseEdge = unfavored;
171-
else
172-
this.unfavored = unfavored;
162+
this.unfavored = unfavored;
173163
}
174164

175165
@Override

core/src/main/java/com/graphhopper/routing/util/AbstractFlagEncoder.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ protected AbstractFlagEncoder( int speedBits, double speedFactor, int maxTurnCos
115115

116116
acceptedRailways.add("tram");
117117
acceptedRailways.add("abandoned");
118+
acceptedRailways.add("abandoned_tram");
118119
acceptedRailways.add("disused");
119120

120121
// http://wiki.openstreetmap.org/wiki/Demolished_Railway

0 commit comments

Comments
 (0)