[GraphHopper] Small patch for distance calculations in CH and translation to spanish
Peter K
peathal at yahoo.de
Fri Jul 19 09:45:32 UTC 2013
Hi Francisco,
what problems do you have?
Regards,
Peter.
> Hi Peter and all.
>
> I have a little patch to solve some problems I have with distance
> calculations when using CH. I don't know if it happens only to me,
> but... just in case.
>
> The change is simple, in Path4CH file:
> double dist = mainIter.getDistance(); // in repository =>
> calcDistance(mainIter);
>
> when mainIter is NOT a shortcut, getDistance directly.
>
> Hope it helps, and thank you very much for this excellent library!!.
>
> Fran.
>
>
> diff --git
> a/core/src/main/java/com/graphhopper/routing/ch/Path4CH.java
> b/core/src/main/java/com/graphhopper/routing/ch/Path4CH.java
> index fb4f440..50199f4 100644
> --- a/core/src/main/java/com/graphhopper/routing/ch/Path4CH.java
> +++ b/core/src/main/java/com/graphhopper/routing/ch/Path4CH.java
> @@ -60,7 +60,7 @@
> {
> if (!mainIter.isShortcut())
> {
> - double dist = calcDistance(mainIter);
> + double dist = mainIter.getDistance();
> //calcDistance(mainIter);
> distance += dist;
> int flags = mainIter.getFlags();
> time += calcTime(dist, flags);
> diff --git
> a/core/src/main/java/com/graphhopper/util/TranslationMap.java
> b/core/src/main/java/com/graphhopper/util/TranslationMap.java
> index f3c9dde..3ff3c12 100644
> --- a/core/src/main/java/com/graphhopper/util/TranslationMap.java
> +++ b/core/src/main/java/com/graphhopper/util/TranslationMap.java
> @@ -42,6 +42,19 @@
> de.put("turn %s", "%s abbiegen");
> de.put("turn %s onto %s", "%s abbiegen auf %s");
>
> + TranslationHashMap es = new TranslationHashMap();
> + translations.put("es", es);
> + es.put("sharp left", "izquierda");
> + es.put("sharp right", "derecha");
> + es.put("left", "izquierda");
> + es.put("right", "derecha");
> + es.put("slight left", "un poco a la izquierda");
> + es.put("slight right", "un poco a la derecha");
> + es.put("continue", "continue");
> + es.put("continue onto %s", "siga por %s");
> + es.put("turn %s", "gire por %s");
> + es.put("turn %s onto %s", "gire %s por %s");
> +
> TranslationHashMap en = new TranslationHashMap()
> {
> @Override
>
> --
> Francisco José Peñarrubia
>
> Software Colaborativo
> http://www.scolab.es
>
>
> _______________________________________________
> GraphHopper mailing list
> GraphHopper at openstreetmap.org
> http://lists.openstreetmap.org/listinfo/graphhopper
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/graphhopper/attachments/20130719/d2a678cd/attachment.html>
More information about the GraphHopper
mailing list