Merge pull request #138 from Phyks/nogopolygonsweight

Add support for nogo polygons / polylines weight in brouter server
This commit is contained in:
abrensch 2019-02-16 20:47:47 +01:00 committed by GitHub
commit fb0f05e043
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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();