Skip to main content

Command-line JOSM plugin for digitizing indexed colors images

Project description

Lakkavokka is a JOSM plugin for digitizing indexed color images in a controlled manner. This tool is useful for semi-automated imports in ML/AI mapping pipelines.

Usage

The following steps requires you have JSOM ext_tools plugin installed.

  1. Make sure you have Python >3.8 and Pip installed:
$ python3 --version
Python 3.8.10

$ python3 -m pip --version
pip 20.0.2 from /usr/lib/python3/dist-packages/pip (python 3.8)
  1. Install Lakkavokka:
python3 -m pip install lakkavokka
  1. Setup external script in JOSM

Use Lakkavokka as a name and lakkavokka --lat {lat} --lon {lon} --zoom 16 --source /path/to/tiles/{zoom}/{x}/{y}.png as a command line.

Now, you can open your area in JOSM, enable Lakkavokka tool and click on the map. Lakkavokka will load the area around the clicked point and build a way nearest to the point. It doesn't matter if you click inside or outside the colored area. If the area is small enough, the way will be automatically closed. Otherwise, you can combine those line to the multipolygon later.

Command line options

--source TMS tiles source, can be either a file path template or URL template. Variables {zoom}, {x}, and {y} will be automatically substituted to tile coordinates

--buffer number of tiles around the clicked point to be loaded. Increasing this value will significantly increase required RAM and calculation time. You can adjust this setting according to your data. Most useful values are from 1 (default) to 3.

--simplify-factor simplification factor for the resulting geometry. You should adjust this setting according to your data if you're getting too many points or too coarse geometry.

--tags comma-separated list of tags to be added to generated ways. It's a good idea to add source tag to indicate other mappers that is an automated or semi-automated load of data.

--lat and --lon latitude and longitude of a clicked point

--zoom zoom of tiles will be processed. It may be different from the zoom level in JOSM but it should always match the best zoom of tiles.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lakkavokka-0.1.0.tar.gz (11.1 kB view hashes)

Uploaded Source

Built Distribution

lakkavokka-0.1.0-py3-none-any.whl (12.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page