@@ -735,7 +735,7 @@ protected DataReader initDataReader(DataReader reader) {
735
735
}
736
736
737
737
/**
738
- * Opens existing graph.
738
+ * Opens existing graph folder .
739
739
*
740
740
* @param graphHopperFolder is the folder containing graphhopper files. Can be a compressed file
741
741
* too ala folder-content.ghz.
@@ -749,9 +749,7 @@ public boolean load(String graphHopperFolder) {
749
749
throw new IllegalStateException ("graph is already successfully loaded" );
750
750
751
751
if (graphHopperFolder .endsWith ("-gh" )) {
752
- // do nothing
753
- } else if (graphHopperFolder .endsWith (".osm" ) || graphHopperFolder .endsWith (".xml" )) {
754
- throw new IllegalArgumentException ("GraphHopperLocation cannot be the OSM file. Instead you need to use importOrLoad" );
752
+ // do nothing
755
753
} else if (!graphHopperFolder .contains ("." )) {
756
754
if (new File (graphHopperFolder + "-gh" ).exists ())
757
755
graphHopperFolder += "-gh" ;
@@ -1085,7 +1083,7 @@ private void checkIfPointsAreInBounds(List<GHPoint> points) {
1085
1083
}
1086
1084
1087
1085
private void checkNonChMaxWaypointDistance (List <GHPoint > points ) {
1088
- if (nonChMaxWaypointDistance == Integer .MAX_VALUE ){
1086
+ if (nonChMaxWaypointDistance == Integer .MAX_VALUE ) {
1089
1087
return ;
1090
1088
}
1091
1089
GHPoint lastPoint = points .get (0 );
@@ -1097,9 +1095,9 @@ private void checkNonChMaxWaypointDistance(List<GHPoint> points) {
1097
1095
dist = calc .calcDist (lastPoint .getLat (), lastPoint .getLon (), point .getLat (), point .getLon ());
1098
1096
if (dist > nonChMaxWaypointDistance ) {
1099
1097
Map <String , Object > detailMap = new HashMap <>(2 );
1100
- detailMap .put ("from" , i - 1 );
1098
+ detailMap .put ("from" , i - 1 );
1101
1099
detailMap .put ("to" , i );
1102
- throw new PointDistanceExceededException ("Point " + i + " is too far from Point " +( i - 1 )+ ": " + point , detailMap );
1100
+ throw new PointDistanceExceededException ("Point " + i + " is too far from Point " + ( i - 1 ) + ": " + point , detailMap );
1103
1101
}
1104
1102
lastPoint = point ;
1105
1103
}
0 commit comments