hn.today

Let's Meet in the Middle

george.mand.is3 points0 comments
Screenshot of Let's Meet in the Middle

A small-tool philosophy motivates a practical way to find places to meet: combine command-line programs that each handle one task. whereami gets a device’s location and, on macOS, converts addresses into coordinates; nearme searches Apple Maps for businesses around supplied coordinates; jq averages two sets of coordinates. Piping these together can find, for example, bars near the geographic midpoint of two New York addresses, returning names, locations, contact details, and distances. The tools can also search between one address and the user’s current location. A shell function packages the pipeline into a reusable “middle” command, with options for the kind of place to find and the number of results.

The approach needs no API keys, browser, or account, but it depends on macOS features: nearme uses MapKit, and whereami’s address lookup is also macOS-only. It works best with street addresses or recognizable places, since some landmarks may not geocode. Its midpoint is a simple average of latitude and longitude, not a route-based or travel-time midpoint, and the result may fall somewhere inconvenient or across a geographic barrier. For short distances, however, the calculation is often sufficient to suggest nearby meeting spots. Both utilities and jq can be installed with Homebrew, and the author invites readers to share other useful combinations of small tools.

Read on george.mand.is0 comments on Hacker News

Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.

More in Programming

The daily digest

Today's best Hacker News stories, summarized and screenshotted, one email a day.