Command Line Tool to show image location on a SwissTopo Map.
Download source code from Github, compile and run it with the Swift compiler:
git clone https://github.com/Fahrenberg/smap.git
cd smap
swift run smap Sources/lochberg.jpg
smap [-o <output>] [-b] <image-file-path>
ARGUMENTS: <image-file-path>
OPTIONS:
-o <output> type of map URL for <output> :
swiss | s = Swiss Topo
osm | o = Open Street Map
placeholder | p = Placeholder Image
-b, --browser Open Map-URL in Browser
-h, --help Show help information.
Reads file from <image-file-path>
and extracts GPS coordinates.
Returns either URL string for the selected map type
or opens the location in the default browser.
Default is printing URL for Swiss Topo (-o=swiss).
URL can be piped and will be "" enclosed.
File lochberg.jpg
Terminal:
smap lochberg.jpg
Result:
"https://map.geo.admin.ch/?swisssearch=46.623938333333335,8.469063333333333"
Opens file lochberg.jpg
in the default browser (e.g. Safari):
smap lochberg.jpg | xargs open
or
smap -b lochberg.jpg
(c) Jean-Nicolas Fahrenberg