Skip to content

Commit

Permalink
Feature/distance map missing params (#152)
Browse files Browse the repository at this point in the history
* add no_holes to distance map

* update no holes readme for distance map
  • Loading branch information
MockusTravelTime authored Dec 12, 2024
1 parent 5808b19 commit 9a776c7
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,7 @@ Given origin coordinates, find shapes of zones reachable within corresponding tr
* [transportation](#transportation): Union - Transportation mode and related parameters.
* [level_of_detail](#level-of-detail): LevelOfDetail - When enabled, allows the user to specify how detailed the isochrones should be.
* [snapping](#snapping): Snapping - Adjusts the process of looking up the nearest roads from the departure / arrival points.
* [no_holes](#no_holes): No holes - Enable to remove holes from returned polygons.

#### Returns:

Expand Down
2 changes: 2 additions & 0 deletions traveltimepy/dto/requests/distance_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class DepartureSearch(BaseModel):
level_of_detail: Optional[LevelOfDetail] = None
snapping: Optional[Snapping] = None
polygons_filter: Optional[PolygonsFilter] = None
no_holes: Optional[bool] = None


class ArrivalSearch(BaseModel):
Expand All @@ -58,6 +59,7 @@ class ArrivalSearch(BaseModel):
level_of_detail: Optional[LevelOfDetail] = None
snapping: Optional[Snapping] = None
polygons_filter: Optional[PolygonsFilter] = None
no_holes: Optional[bool] = None


class Intersection(BaseModel):
Expand Down
3 changes: 3 additions & 0 deletions traveltimepy/mapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -696,6 +696,7 @@ def create_distance_map(
level_of_detail: Optional[LevelOfDetail],
snapping: Optional[Snapping],
polygons_filter: Optional[PolygonsFilter],
no_holes: Optional[bool],
) -> DistanceMapRequest:
if isinstance(time_info, ArrivalTime):
return DistanceMapRequest(
Expand All @@ -709,6 +710,7 @@ def create_distance_map(
level_of_detail=level_of_detail,
snapping=snapping,
polygons_filter=polygons_filter,
no_holes=no_holes,
)
for ind, cur_coordinates in enumerate(coordinates)
],
Expand All @@ -728,6 +730,7 @@ def create_distance_map(
level_of_detail=level_of_detail,
snapping=snapping,
polygons_filter=polygons_filter,
no_holes=no_holes,
)
for ind, cur_coordinates in enumerate(coordinates)
],
Expand Down
2 changes: 2 additions & 0 deletions traveltimepy/sdk.py
Original file line number Diff line number Diff line change
Expand Up @@ -804,6 +804,7 @@ async def distance_map_async(
level_of_detail: Optional[LevelOfDetail] = None,
snapping: Optional[Snapping] = None,
polygons_filter: Optional[PolygonsFilter] = None,
no_holes: Optional[bool] = None,
) -> List[TimeMapResult]:
time_info = get_time_info(departure_time, arrival_time)
resp = await send_post_async(
Expand All @@ -818,6 +819,7 @@ async def distance_map_async(
level_of_detail,
snapping,
polygons_filter,
no_holes,
),
self._sdk_params,
)
Expand Down

0 comments on commit 9a776c7

Please sign in to comment.