Add support for nogo polygons/polylines custom weight in BRouter server.

This commit is contained in:
Phyks (Lucas Verney) 2019-01-05 13:55:33 +01:00
parent f70f19d697
commit 9fe0ce6bcb

View file

@ -271,7 +271,8 @@ public class ServerHandler extends RequestHandler {
if ( lonLatList.length > 1 )
{
OsmNogoPolygon polygon = new OsmNogoPolygon(closed);
for (int j = 0; j < lonLatList.length-1;)
int j;
for (j = 0; j < 2 * (lonLatList.length / 2) - 1;)
{
String slon = lonLatList[j++];
String slat = lonLatList[j++];
@ -279,6 +280,9 @@ public class ServerHandler extends RequestHandler {
int lat = (int)( ( Double.parseDouble(slat) + 90. ) *1000000. + 0.5);
polygon.addVertex(lon, lat);
}
if (j < lonLatList.length) {
polygon.nogoWeight = Double.parseDouble( lonLatList[j] );
}
if ( polygon.points.size() > 0 )
{
polygon.calcBoundingCircle();