Skip to content

Fahrenberg/smap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SMAP - Swiss Topo Map URL Generator

Command Line Tool to show image location on a SwissTopo Map.

Installation

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

Usage:

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.


Example for macOS Terminal with lochberg.jpg:

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

www.fahrenberg.app

About

Command Line Tool to print map URL (SwissTopo/OpenStreetMap) for an image.

Resources

License

Stars

Watchers

Forks

Packages

No packages published