[GraphHopper] GeoPoint into InstructionList

Дмитрий Пучков d-puchkov at mail.ru
Tue Aug 13 11:04:58 UTC 2013


 I do this:
GeoPoint first = routePoints.get(0);
int j = 1;
double dist = 0;
 for (Instruction inst : routeInstructions) {
       while (j < routePoints.size()) {
             float[] as = new float[3];
             Location.distanceBetween(first.latitude, first.longitude,
                            routePoints.get(j).latitude,
                            routePoints.get(j).longitude, as);
             dist += as[0];
             first = routePoints.get(j);
             if (Math.abs((dist - inst.getLen())) < 10) {
                        IinstructPoints.add(routePoints.get(j));
                        System.out.println("DIST:" + dist);
                        dist = 0;
                        j++;
                        break;
              }
              j++;
         }
}

it works, but this accuracy is present about 0-10 meters.
Is there another way?



Вторник, 13 августа 2013, 11:31 +04:00 от Дмитрий Пучков <d-puchkov at mail.ru>:
>Good day!
>How I can get the GeoPoint  in which the statement ?
>For example I have list of instructions " (0,,129.34), (2,улица Коммунаров,320.76), (-2,улица Пастухова,340.14)" and I want to get GeoPoint   for each  instruction. 
>
>Thank you!
>-- 
>Дмитрий Пучков
>_______________________________________________
>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/20130813/f293b73b/attachment.html>


More information about the GraphHopper mailing list