https://github.com/developmentseed/josmmagicwand
JOSM Plugin allows select areas to label using a range of colors,
https://github.com/developmentseed/josmmagicwand
java josm josm-plugin magic-wand opencv
Last synced: 10 months ago
JSON representation
JOSM Plugin allows select areas to label using a range of colors,
- Host: GitHub
- URL: https://github.com/developmentseed/josmmagicwand
- Owner: developmentseed
- License: mit
- Created: 2022-09-21T16:28:50.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2025-02-04T15:14:35.000Z (about 1 year ago)
- Last Synced: 2025-02-04T15:28:35.150Z (about 1 year ago)
- Topics: java, josm, josm-plugin, magic-wand, opencv
- Language: Java
- Homepage:
- Size: 96.3 MB
- Stars: 23
- Watchers: 4
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# DS-annotate plugin for Java OpenStreetMap Editor
The DS-annotate plugin is an extension for the Java OpenStreetMap Desktop Editor (JOSM). Built upon ds-annotate, this plugin utilizes the [Segment Anything Service](https://github.com/developmentseed/segment-anything-services), which leverages Generative AI. Additionally, it allows users to label areas using a spectrum of colors, similar to a magic wand tool, enabling faster and more accurate mapping.

## Installation
1. Search the magic wand plugin.

2. Wait to download the plugin, sometimes it takes a few minutes, because the plugin is 100 MB in size.

3. Confirmation window.


## Usage
The JOSM Magic Wand plugin offers three functionalities:
- Generate Geometries
- Merge Geometries
- Simplify Geometries
### Generate geometries.
To generate geometries, you must have a base map activated and a data layer.
- You can press the shortcut `Ctrl + 1` or select directly in the mode bar (upper
left) ,
you will enter Magic Wand mode and you will see a wand on the
cursor 
.
- Click on the area.
- `ctrl + 2` to generate the geometry.
- To add or enhance the selection, you can press the `ctrl` button and `click` on new area.
- To subtract the selection, you can press the `switch` button and `click` on area.
### Merge geometries
This functionality allows you to merge several geometries into one, the geometries must intersects.

- Select one or more geometries.
- Press `ctrl + 3`.
### Simplify geometries.
This functionality allows you to simplify and smooth a geometry.
- Select one or more geometries.
- Press `ctrl + 4`.
## Requirements
- Java JDK 11+.
- JOSM 18193 or higher.
## Extra options


1. Select mode.
2. Open window.
3. In the window, you will find the following options:
- **Tolerance**: This option allows you to configure the color tolerance of the Magic Wand tool.
```
Higher values expand the tolerance to more colors.
Lower values make the tool more specific to colors.
```
- **Exterior contour**: This algorithm is specifically designed to simplify polygons while maintaining the shape and outer contour (hull) of the original polygon.
```
Higher values result in less simplification.
Lower values result in more simplification.
```
- **Vertices**: This algorithm focuses on the general simplification of polygons. Its goal is to reduce the number of vertices in a geometry while preserving its overall shape.
```
Higher values result in more simplification.
Lower values result in less simplification.
```
- **Topology**: This algorithm is used to simplify geometries while preserving their topology. Topology refers to the spatial relationship and connectivity between geometric elements.
```
Higher values result in more simplification.
Lower values result in less simplification.
```
- **Smooth Angle**: This option allows you to smooth very sharp angles. The value entered represents the minimum angle to be simplified.
- **add tag**: a pop-up window will appear, allowing you to enter the tag that will be added when generating or simplifying the geometry, the format its `key=value`.
To disable the algorithms, set the value to 0.
## Use cases
### Cases where it works well
| Image | Description |
|------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------|
|  | The edge of the lake has borders marked with the path. |
|  | The edge of the lake and the farm have marked borders. |
|  | Uniform color and sharp edges (contrast). |
|  | Uniform color and sharp edges (contrast). |
|  | Uniform color and sharp edges (contrast). |
|  | Uniform color and sharp edges (contrast). |
### Cases where it doesn't work well
| Image | Description |
|------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------|
|  | The two farms are separated by a very thin path of similar color. |
|  | Parts of the farm and the border have similar colors with the rest. |
|  | The borders of the farm with the road and the other farm have similar colors. |