Add support for nogo polygons/polylines custom weight in BRouter server.
This commit is contained in:
parent
f70f19d697
commit
9fe0ce6bcb
1 changed files with 5 additions and 1 deletions
|
@ -271,7 +271,8 @@ public class ServerHandler extends RequestHandler {
|
||||||
if ( lonLatList.length > 1 )
|
if ( lonLatList.length > 1 )
|
||||||
{
|
{
|
||||||
OsmNogoPolygon polygon = new OsmNogoPolygon(closed);
|
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 slon = lonLatList[j++];
|
||||||
String slat = 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);
|
int lat = (int)( ( Double.parseDouble(slat) + 90. ) *1000000. + 0.5);
|
||||||
polygon.addVertex(lon, lat);
|
polygon.addVertex(lon, lat);
|
||||||
}
|
}
|
||||||
|
if (j < lonLatList.length) {
|
||||||
|
polygon.nogoWeight = Double.parseDouble( lonLatList[j] );
|
||||||
|
}
|
||||||
if ( polygon.points.size() > 0 )
|
if ( polygon.points.size() > 0 )
|
||||||
{
|
{
|
||||||
polygon.calcBoundingCircle();
|
polygon.calcBoundingCircle();
|
||||||
|
|
Loading…
Reference in a new issue