Crossing a nogo polyline with weight should translate into a constant cost.
This commit is contained in:
parent
828227f59d
commit
fc97754c90
1 changed files with 5 additions and 1 deletions
|
@ -359,7 +359,11 @@ public final class RoutingContext
|
||||||
else if (((OsmNogoPolygon)nogo).intersects(lon1, lat1, lon2, lat2))
|
else if (((OsmNogoPolygon)nogo).intersects(lon1, lat1, lon2, lat2))
|
||||||
{
|
{
|
||||||
// nogo is a polygon, compute distance within the polygon
|
// nogo is a polygon, compute distance within the polygon
|
||||||
nogoCost = ((OsmNogoPolygon)nogo).distanceWithinPolygon(lon1, lat1, lon2, lat2) * nogo.nogoWeight;
|
if (((OsmNogoPolygon)nogo).isClosed) {
|
||||||
|
nogoCost = ((OsmNogoPolygon)nogo).distanceWithinPolygon(lon1, lat1, lon2, lat2) * nogo.nogoWeight;
|
||||||
|
} else {
|
||||||
|
nogoCost = nogo.nogoWeight;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue