JOSM/Plugins/Scanaerial



Scanaerial is a package with python code to scan aerial pictures.
Requirements
- JOSM (current version)
 - Ext_tools plug-in for JOSM
 - Python & needed libraries (run library_check.py to find out if a library is missing)
 - Current Scanaerial-Script
 
Setup
Windows
- Install Python 3 (in our example 3.13.0):
- From official website
 - or via command: 
winget install Python.Python.3.13 
 - Install Scanaerial dependencies (Pillow, PyProj & future):
- use this command to install: 
C:\Users\user\AppData\Local\Programs\Python\Python313\Scripts\pip.exe install pillow pyproj future 
 - use this command to install: 
 - Install ext_tools Plugin in JOSM (more information on JOSM/Plugins#Installation) & Restart JOSM.
 - Extract the Scanaerial archive  and put it's files to 
%APPDATA%\JOSM\plugins\ext_tools\scanaerialdirectory. - In JOSM press F12 and go to Ext_Tools configuration.
 - Add a new tool by clicking the button saying so. Give the tool a good name (scanaerial would be an idea) and paste this as commandline:
 
C:\Users\user\AppData\Local\Programs\Python\Python313\python.exe scanaerial/scanaerial.py {lat} {lon} {TZoom}
To always use Config-File setting fixedzoomlevel, use it without {TZoom}:
C:\Users\user\AppData\Local\Programs\Python\Python313\python.exe scanaerial/scanaerial.py  {lat} {lon}
It will create a new menu item in the tools menu.
Verbose installation guide for Windows (outdated).
Linux
- Unzip the contents of the downloaded archive to the JOSM Plugin directory. Put it to: ~/.josm/plugins/ext_tools/scanaerial
 - Install Python + needed libraries:
- Fedora: 
yum install pyproj python-pillow - Ubuntu: 
sudo apt-get install python-pyproj python-pil 
 - Fedora: 
 - Install Ext_tools-Plugin in JOSM (more information on JOSM/Plugins#Installation) & Restart JOSM
 - In JOSM press F12 and go to Ext_tools configuration
 - Add a new tool by clicking the button saying so. Give the tool a good name (scanaerial would be an idea) and paste this as command line:
 
/home/<username>/.josm/plugins/ext_tools/scanaerial/scanaerial.py {lat} {lon} {TZoom}
It will create a new menu item in the tools menu. (NB: Syntax may change soon. Due to a bug in Ext_tools you can not write “~” instead of “home”).
Using Scanaerial
- To invoke scanaerial press Ctrl+K or select the new menu item. Now point the cursor on the area you want to trace and left-click.
 - For best result you may finetune the values in scanaerial.cfg
 
Multiple configurations
It is possible to configure Scanaerial to work with several distinct config files. To do so create a separate tool with distinct names for each configuration. The name of the configuration file is passed as the fourth argument to scanaerial.py
Example commandline:
/home/<username>/.josm/plugins/ext_tools/scanaerial/scanaerial.py {lat} {lon} {TZoom} myconfig1.cfg
Finetuning Config-File
| Key | Default value | Function | 
|---|---|---|
| fixedzoomlevel | 11 | use this zoomlevel, if Ext_tools did not tell via TZoom | 
| server_api | bing | access method of map server: wms, tms or bing | 
| server_name | Bing | name of the map server (only for the tag string) | 
| server_url | http://dev.virtualearth.net/... | half-link for WMS, JOSM-like address for TMS | 
| empty_tile_bytes | 1033 | size of empty tile (in bytes) for current map server | 
| empty_tile_checksum | -332268601 | checksum of empty tile file (algorithm: CRC32) | 
| projection | EPSG:3857 | projection that is used on the map server | 
| tile_sizex | 256 | leave it to 256 unless you know what you do | 
| tile_sizey | 256 | leave it to 256 unless you know what you do | 
| douglas_peucker_epsilon | 0.60 | maximum roughness for smoothening the line | 
| deactivate_simplifying | 0 | deactivate Douglas-Peucker algorithm (only for debugging) | 
| colour_str | 30 | colour sensitivity (depends on contrast of images) | 
| maxfilter_setting | 3 | median filter size (noise reduction strength) | 
| size_limit | 400 | maximum size of produced object | 
Available servers
Fun stuff
if you like scanaerial you can show others that you use it by putting
[[Category:Scanaerial User]]
in your Userpage.