The fastest path from orthophoto to vector polygon. Click anywhere on a raster and VoltGrid's magic-wand tool traces the color-similar region into a clean vector boundary — building footprints, fields, vegetation patches, water bodies, substation pads. No training, no GPU, no model weights. Pure CIELAB delta-E flood fill on the host CPU, with Visvalingam-Whyatt simplification baked in. A faithful port of the popular Kanahiro/MagicWand QGIS plugin.
Not a deep-learning model. The magic wand converts each pixel to CIELAB color space, computes delta-E (Euclidean LAB distance) from the seed pixels, and runs a run-based union-find flood fill with 4-connectivity. A gradient-grow pass then walks smooth color gradients outward, and Visvalingam-Whyatt simplification removes pixel staircasing from the resulting polygon.
// click on the rendered map → polygon { "width": 1024, "height": 768, "extent": { xmin, ymin, xmax, ymax }, "bgra": "<base64 screenshot>", "seeds": [{ x: 420, y: 312 }], "tolerance": 5.5 } → mask via union-find flood fill → polygonized + Visvalingam-Whyatt → returned in view CRS
Capture from whatever the map is currently showing — basemap, ImageServer export, your own tiles. The bridge calls view.takeScreenshot(), swaps RGBA→BGRA, base64-encodes, and POSTs the result + the view extent. Polygons come back in the view's CRS.
Capture from a registered Cloud-Optimized GeoTIFF directly. The host reads three bands via RasterWindowReader, downscales if > 2,000,000 analysis pixels, per-band min-max stretches to 0–255, and polygonizes against the COG's native bbox. Higher fidelity than the rendered screenshot path.
Trace structures from orthophotos — service drops, outbuildings, adjacent properties, before/after storm.
Capture canopy extent near a span to seed a NERC FAC-003 vegetation analysis.
Digitize flood inundation from satellite or drone captures for storm-response mapping.
Trace equipment pads, fence lines, and yard extents from substation orthophotos.
Capture right-of-way boundaries from corridor imagery to anchor plan-profile sheets.
Quick land-cover polygons without standing up a full supervised-classification workflow.
Confirm a magic-wand selection and it persists to <dataDir>/gpkg/magic_wand.gpkg — a valid GeoPackage alongside your structures, conductors, and bookmarks. Re-load, edit with the native Editor widget, or export to any format like any other layer.
| Endpoint | Verb | Purpose |
|---|---|---|
| /api/magicwand/select | POST | Stateless selection — render mask → polygons (no persistence). |
| /api/magicwand/save | POST | Persist a confirmed selection to magic_wand.gpkg. |
| /api/magicwand/selections | GET | List all saved selections. |
| /api/magicwand/selections | DELETE | Clear all saved selections. |
The Magic Wand algorithm performs CIELAB color space distance calculations, union-find flood fill, boundary polygonization, and Douglas-Peucker simplification in real time.
No model download, no GPU, no Python sidecar. Just open the panel, click, and confirm.