Skip to content
/ osm-ad Public
forked from bousqi/osm-ad

Open Street Map - Assets Downloader (CLI & GUI)

License

Notifications You must be signed in to change notification settings

simrit1/osm-ad

 
 

Repository files navigation

Open Street Map - Assets Downloader (CLI & GUI)

OsmAnd Android application has a free version with a limitation on maps updates.

This repo was created for two Proofs of Concept, one Graphical application and one Command line application to define a set of map and feed the latest updates available. Those maps downloaded maps could be copied into your smartphone over ADB or any network share.

Summary

Usage

Graphical User Interface

  • About

  • Main Screen on Windows

  • Downloading on Linux

  • Settings

Command Line Interface

Usage: osmad_cli.py [OPTIONS] COMMAND [ARGS]...

Options:
  --version                     Show the version and exit.
  -ad, --asset-dir DIRECTORY    Path where to download assets
                                (value saved in config file)
  -ed, --extract-dir DIRECTORY  Path where to extract assets 
                                (value saved in config file)
  --help                        Show this message and exit.

Commands:
  list     List assets available in cache
  refresh  Refresh cache from OpenStreet Map server
  update   Download/Update assets based on watch list
  watch    Watch list management

This command line interface allows three basic operation :

  1. Listing assets available on server
Usage: osmad_cli.py list [OPTIONS]

  List assets available in cache

Options:
  -c, --cache                   Use cached file rather than online server
  -l, --list [ALL|AREAS|TYPES]  List assets available
  -t, --type TEXT               List only assets part of this type
  -a, --area TEXT               List only assets part of this area
  -d, --date TEXT               Retrieve date update for specified asset
  -s, --sort [name|size|date]   Order to use for list display
  --help                        Show this message and exit.
  1. Handling watch list
Usage: osmad_cli.py watch [OPTIONS]

  Watch list management

Options:
  -l, --list      List all assets to watch
  -c, --clear     Remove all assets from watch list
  -a, --add TEXT  Add specified asset to watch list
  -d, --del TEXT  Remove specified asset from watch list
  --help          Show this message and exit.
  1. Pulling updates available
Usage: osmad_cli.py update [OPTIONS]

  Download/Update assets based on watch list

Options:
  -n, --no-progress  Disable progress bar during download
  --help             Show this message and exit.

HowTo

Prepare env

Prepare a Vitrual environment for your project and install requirements

$ python -m venv venv

Switch to your venv

  • on linux $ source venv/bin/activate
  • on Windows $ .\venv\Scripts\activate.bat

Install dependencies

$ python -m pip install -r requirements_cli.txt
$ python -m pip install -r requirements_gui.txt

Using linux env, you might require deb packages to be installed

$ sudo apt install python3-pyqt5 pyqt5-dev-tools

Build

GUI

Before launching the application, you must build UIs and Resource file with the following commands

Generate UIs
$ pyuic5 src/ui/ui_main.ui -o src/ui/ui_main.py
Generate Res file
$ pyrcc5 src/resources.qrc -o src/resources_rc.py

Create native executable

In order to create a native executable (easier to deploy), you should proceed as following :

  1. Install dependencies $ python -m pip install pyinstaller
  2. Generate self-contained binaries

CLI

$ pyinstaller osmad_cli.spec
...
$ dist\osmad_cli.exe

GUI

$ pyinstaller osmad_gui.spec
...
$ dist\osmad_gui.exe

About

Open Street Map - Assets Downloader (CLI & GUI)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 98.0%
  • Makefile 2.0%