route from/to level or area
This commit is contained in:
parent
69dab03148
commit
3faed6c316
1 changed files with 6 additions and 1 deletions
|
@ -12,7 +12,7 @@ from shapely import prepared
|
|||
from shapely.geometry import Point
|
||||
from shapely.ops import unary_union
|
||||
|
||||
from c3nav.mapdata.models import AltitudeArea, GraphEdge, Level, Space, WayType
|
||||
from c3nav.mapdata.models import AltitudeArea, Area, GraphEdge, Level, Space, WayType
|
||||
from c3nav.routing.route import Route
|
||||
|
||||
|
||||
|
@ -144,8 +144,13 @@ class Router:
|
|||
return pickle.load(open(cls.filename, 'rb'))
|
||||
|
||||
def get_locations(self, location):
|
||||
if isinstance(location, Level):
|
||||
return RouterLocation((self.levels[location.pk], ))
|
||||
if isinstance(location, Space):
|
||||
return RouterLocation((self.spaces[location.pk], ))
|
||||
if isinstance(location, Area):
|
||||
return RouterLocation((self.areas[location.pk], ))
|
||||
# todo: route from POI or custom location
|
||||
return RouterLocation()
|
||||
|
||||
def get_route(self, origin, destination):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue