Skip to main content Link Search Menu Expand Document (external link)
This is the documentation for previous versions of GeoDesk (1.0 to 1.3). For the most recent version, please visit docs.geodesk.com.

Example: Mailbox Collection Times

The OpenStreetMap database contains far more information than what is visible on the map. Take public mailboxes, for instance: Aside from their locations, you can also discover when the letter you’ve dropped off will be picked up.

What are the most common mailbox collection times? Let’s find out:

import geodesk
from collections import Counter

world = geodesk.Features("world.gol")
post_boxes = world("na[amenity=post_box]")

counter = Counter([box.collection_times for box in post_boxes])
most_common = counter.most_common(10)

for collection_times, count in most_common:
    print(f"{count:>10} : {collection_times}")

Notes