Fix for points getting None cost
Sometimes there's no route information for the point in a particular angle we're interested in. In this case it is better to use more points/angles and discard the ones we're not interested in.
This commit is contained in:
@@ -3,7 +3,7 @@ import logging
|
||||
|
||||
class MapzenIsolines:
|
||||
|
||||
NUMBER_OF_ANGLES = 12
|
||||
NUMBER_OF_ANGLES = 24
|
||||
MAX_ITERS = 5
|
||||
TOLERANCE = 0.1
|
||||
|
||||
@@ -77,7 +77,13 @@ class MapzenIsolines:
|
||||
|
||||
location_estimates[j] = self._calculate_dest_location(origin, angles[j], (rmax[j]+rmin[j])/2.0)
|
||||
|
||||
return location_estimates
|
||||
# delete points that got None
|
||||
location_estimates_filtered = []
|
||||
for i, c in enumerate(costs):
|
||||
if c <> isorange:
|
||||
location_estimates_filtered.append(location_estimates[i])
|
||||
|
||||
return location_estimates_filtered
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user