gps

command module
v0.0.0-...-b1362c9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 13, 2025 License: MIT Imports: 3 Imported by: 0

README

GPS

Go CLI tool that fetches (lat,lng) coordinates for search terms using the Nominatim API from OpenStreetMap.

Installation

$ go install github.com/marianogappa/gps@latest

Usage

$ echo "Berlin,London" | tr ',' '\n' | gps
52.5170365	13.3888599	Berlin
51.4893335	-0.14405508452768728	London
$

Or say you have a file:

$ cat countries.csv
Germany
UK
$ cat countries.csv | gps
51.1638175	10.4478313	Germany
6.3110548	20.5447525	UK
$

For CSV output:

$ echo "Berlin,London" | tr ',' '\n' | gps --separator comma
52.5170365,13.3888599,Berlin
51.4893335,-0.14405508452768728,London

Importing it as a library

  import "github.com/marianogappa/gps/pkg"

  ...

  pkg.GPSFromReader(
		os.Stdin,
		pkg.WithOutputSeparator("comma"),
		pkg.WithOutputToWriter(os.Stdout),
	)
  • Use WithOutputChannel(ch chan string) to output to a channel instead of a writer. Or both.
  • Use WithDialer(d proxy.Dialer) to bring your own Dialer.

Notes

  • It caches results in the system's temp folder to be nice to OpenStreetMap. Your system should® automatically evict it.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL