add restricted areas in routing options schema
This commit is contained in:
parent
d4b7e2bc38
commit
73c0bdc92f
1 changed files with 12 additions and 0 deletions
|
@ -40,6 +40,12 @@ class WalkSpeed(StrEnum):
|
||||||
FAST = "fast"
|
FAST = "fast"
|
||||||
|
|
||||||
|
|
||||||
|
class RestrictedAreas(StrEnum):
|
||||||
|
""" whether to prefer or avoid restricted areas """
|
||||||
|
NORMAL = "normal"
|
||||||
|
PREFER = "prefer"
|
||||||
|
AVOID = "avoid"
|
||||||
|
|
||||||
class LevelWayTypeChoice(StrEnum):
|
class LevelWayTypeChoice(StrEnum):
|
||||||
""" route preferences for way types that are level """
|
""" route preferences for way types that are level """
|
||||||
ALLOW = "allow"
|
ALLOW = "allow"
|
||||||
|
@ -70,6 +76,11 @@ class UpdateRouteOptionsSchema(BaseSchema):
|
||||||
default=None,
|
default=None,
|
||||||
title="walk speed",
|
title="walk speed",
|
||||||
)
|
)
|
||||||
|
restrictions: Union[
|
||||||
|
Annotated[RestrictedAreas, APIField(title="restricted areas",
|
||||||
|
description="whether to route through restricted areas")],
|
||||||
|
Annotated[None, APIField(title="null", description="don't change restricted areas routing")],
|
||||||
|
]
|
||||||
way_types: dict[
|
way_types: dict[
|
||||||
Annotated[NonEmptyStr, APIField(title="waytype")],
|
Annotated[NonEmptyStr, APIField(title="waytype")],
|
||||||
Union[
|
Union[
|
||||||
|
@ -86,6 +97,7 @@ class RouteOptionsSchema(BaseSchema):
|
||||||
# todo: default is wrong, this should be optional
|
# todo: default is wrong, this should be optional
|
||||||
mode: RouteMode = APIField(name="routing mode")
|
mode: RouteMode = APIField(name="routing mode")
|
||||||
walk_speed: WalkSpeed = APIField(name="walk speed")
|
walk_speed: WalkSpeed = APIField(name="walk speed")
|
||||||
|
restrictions: RestrictedAreas = APIField(title="restricted areas")
|
||||||
way_types: dict[
|
way_types: dict[
|
||||||
Annotated[NonEmptyStr, APIField(title="waytype")],
|
Annotated[NonEmptyStr, APIField(title="waytype")],
|
||||||
Union[
|
Union[
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue