Permalink
Browse files

include zero distances as we'll remove them in cleanup stage

  • Loading branch information...
1 parent 897c392 commit 05bf6ab1f106d94bce51066d2cdad886f888c1e8 @karussell committed Jun 27, 2012
Showing with 14 additions and 5 deletions.
  1. +2 −0 README.md
  2. +3 −3 core/nbactions.xml
  3. +9 −2 core/src/main/java/de/jetsli/graph/reader/MMapGraphStorage.java
View
@@ -14,6 +14,8 @@ Download OSM file (40MB compressed, then 450MB uncompressed), build graph hopper
> cd core; ./run.sh unterfranken
+the resulting file will be around 30MB (still ways to improve it)
+
If you want to import a bigger OSM (Germany) then run:
* when executing the command again the OSM won't be parsed again, so the UI should pop up within 1 or 2 seconds.
View
@@ -18,7 +18,7 @@
</goals>
<properties>
<exec.classpathScope>runtime</exec.classpathScope>
- <exec.args>-Xms1000m -Xmx1000m -XX:PermSize=20m -XX:MaxPermSize=20m -classpath %classpath de.jetsli.graph.ui.MiniGraphUI debug=true dijkstra=true graph=graph-unterfranken.osm osm=/media/SAMSUNG/unterfranken.osm /media/SAMSUNG/germany.osm</exec.args>
+ <exec.args>-Xms1000m -Xmx1000m -XX:PermSize=20m -XX:MaxPermSize=20m -classpath %classpath de.jetsli.graph.reader.OSMReader debug=true dijkstra=true graph=graph-unterfranken.osm osm=/media/SAMSUNG/unterfranken.osm /media/SAMSUNG/germany.osm</exec.args>
<exec.executable>java</exec.executable>
</properties>
</action>
@@ -30,7 +30,7 @@
</goals>
<properties>
<exec.classpathScope>runtime</exec.classpathScope>
- <exec.args>-Xdebug -Xrunjdwp:transport=dt_socket,server=n,address=${jpda.address} -Xms1000m -Xmx1000m -XX:PermSize=20m -XX:MaxPermSize=20m -classpath %classpath de.jetsli.graph.ui.MiniGraphUI debug=true dijkstra=true graph=graph-unterfranken.osm osm=/media/SAMSUNG/unterfranken.osm /media/SAMSUNG/germany.osm</exec.args>
+ <exec.args>-Xdebug -Xrunjdwp:transport=dt_socket,server=n,address=${jpda.address} -Xms1000m -Xmx1000m -XX:PermSize=20m -XX:MaxPermSize=20m -classpath %classpath de.jetsli.graph.reader.OSMReader debug=true dijkstra=true graph=graph-unterfranken.osm osm=/media/SAMSUNG/unterfranken.osm /media/SAMSUNG/germany.osm</exec.args>
<jpda.listen>true</jpda.listen>
<exec.executable>java</exec.executable>
</properties>
@@ -42,7 +42,7 @@
<goal>org.codehaus.mojo:exec-maven-plugin:1.1.1:exec</goal>
</goals>
<properties>
- <exec.args>${profiler.args} -Xms1000m -Xmx1000m -XX:PermSize=20m -XX:MaxPermSize=20m -classpath %classpath de.jetsli.graph.ui.MiniGraphUI debug=true dijkstra=true graph=graph-unterfranken.osm osm=/media/SAMSUNG/unterfranken.osm /media/SAMSUNG/germany.osm</exec.args>
+ <exec.args>${profiler.args} -Xms1000m -Xmx1000m -XX:PermSize=20m -XX:MaxPermSize=20m -classpath %classpath de.jetsli.graph.reader.OSMReader debug=true dijkstra=true graph=graph-unterfranken.osm osm=/media/SAMSUNG/unterfranken.osm /media/SAMSUNG/germany.osm</exec.args>
<profiler.action>profile</profiler.action>
<exec.executable>${profiler.java}</exec.executable>
</properties>
@@ -61,6 +61,7 @@ public boolean addNode(int osmId, double lat, double lon) {
return true;
}
int counter = 0;
+ int zeroCounter = 0;
@Override
public boolean addEdge(int nodeIdFrom, int nodeIdTo, boolean reverse, CalcDistance callback) {
@@ -86,8 +87,14 @@ public boolean addEdge(int nodeIdFrom, int nodeIdTo, boolean reverse, CalcDistan
double lot = g.getLongitude(toIndex);
double dist = callback.calcDistKm(laf, lof, lat, lot);
if (dist == 0) {
- // dist = 0.001;
- return false;
+ // As investigation shows often two paths should have crossed via one identical point
+ // but end up in two very close points. add here here and later this will be
+ // removed/fixed while removing short edges where one node is of degree 2
+ zeroCounter++;
+ if (zeroCounter % 10 == 0)
+ logger.info(zeroCounter + " zero distances, from:" + nodeIdFrom + " to:" + nodeIdTo
+ + " (" + laf + ", " + lof + ")");
+ dist = 0.0001;
} else if (dist < 0) {
logger.info(counter + " - distances negative. " + fromIndex + " (" + laf + ", " + lof + ")->"
+ toIndex + "(" + lat + ", " + lot + ") :" + dist);

0 comments on commit 05bf6ab

Please sign in to comment.