Skip to content
roguelite labsAnthony Spezzano ↗
← All work
Native

Giro

A native route recorder with local history and a smaller representation for drawing long routes.

Try the mechanism

Compare a recorded route with the smaller copy used to draw it.

The example uses synthetic inputs to isolate this behavior. It does not operate the underlying app.

The recorder preserves coordinates while RouteSimplifier returns a display copy. It thins points by distance and then applies a point budget, keeping the endpoints.

Inside the implementation

Giro/RouteSimplifier.swift · signature and distance check excerpts
static func displayCoordinates(
    from coordinates: [GeoCoordinate],
    minimumDistance: CLLocationDistance = 4,
    maximumPoints: Int = 1_200
) -> [CLLocationCoordinate2D]

// In the intermediate-point loop:
if location.distance(from: lastLocation) >= minimumDistance {
    thinned.append(coordinate)
    lastLocation = location
}
Read the explanation →

Implementation decisions

Built with

Swift · SwiftUI · Core Location