Skip to content
AccidentalAntenna
All projects

1 min read

Building a pocket terrain map

An offline map experiment that turns elevation samples into a compact preview for weekend hikes.

Aerial view of rocky mountain ridges above green alpine valleys
Alpine ridgelines and valleys illustrate the elevation changes the map is designed to convey. Photo by Ilia Bronskiy

Start with one patch of terrain

I began with one elevation grid and a route I already knew. Instead of building a full map renderer, I made a small offline page that shows a shaded terrain preview next to an elevation profile. Limiting the first version to one area made it easy to compare the output with a paper map.

Thin the elevation profile

The raw profile had more points than the small screen could show. I split it into groups and kept the lowest and highest samples in each group. That reduced the size without hiding short, steep climbs.

def elevation_envelope(samples, step):
    if step < 1:
        raise ValueError("step must be positive")

    for start in range(0, len(samples), step):
        chunk = samples[start:start + step]
        yield min(chunk), max(chunk)

Check it away from Wi-Fi

I put the phone into airplane mode and opened the preview from a local file. The map loaded, but my first export had an unlabeled elevation axis. I added units and tick marks before testing on a second route.

Comments

Share a thought about this project. Comments appear after approval.

    Loading comments…