Skip to content

Commit 1393871

Browse files
author
Nathaniel Henry
committed
Use point_pois() for the 30-minute-walk supermarkets in the first-map tutorial.
1 parent cd225d3 commit 1393871

1 file changed

Lines changed: 6 additions & 9 deletions

File tree

docs/tutorials/first_map.md

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ The quickest way to feel what Close gives you: read the walk times from a starti
1414
point, map the supermarkets you can reach on foot, then draw how far a 30-minute walk
1515
takes you. The example city is Providence, Rhode Island.
1616

17-
*Running this tutorial uses about 110 tokens.*
17+
*Running this tutorial uses about 90 tokens.*
1818

1919
```{code-cell} python
2020
:tags: [remove-cell]
@@ -63,18 +63,15 @@ walk_times.sort_values("travel_time")[["name", "travel_time"]]
6363
## Map the supermarkets within a 30-minute walk
6464

6565
A 30-minute walk is a travel-time question, not a distance one, so let the routing
66-
answer it. Take the 30-minute walk isochrone from the starting point, pull every
67-
supermarket in the city, and keep the ones that fall inside that walkshed.
66+
answer it directly: `point_pois` returns every POI reachable from the starting point
67+
within `max_minutes`, each carrying its walk time — no isochrone to overlay.
6868
`close_map()` draws the result on an interactive basemap in one line, with the city
6969
boundary behind it for context.
7070

7171
```{code-cell} python
72-
walkshed_30min = close.isochrone(lon = start_lon, lat = start_lat, mode = "walk",
73-
direction = "from", minutes = 30, format = "geojson")
74-
75-
city_supermarkets = close.place_pois(geoid = providence_ri["geoid"],
76-
type = supermarket_type)
77-
nearby_supermarkets = city_supermarkets[city_supermarkets.within(walkshed_30min.union_all())]
72+
nearby_supermarkets = close.point_pois(lat = start_lat, lon = start_lon,
73+
mode = "walk", type = supermarket_type,
74+
max_minutes = 30)
7875
7976
city_boundary = close.place_boundary(geoid = providence_ri["geoid"])
8077
close_map(nearby_supermarkets, color = "#e8590c", boundary = city_boundary, label = "name")

0 commit comments

Comments
 (0)