Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions geoengine_tools/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,13 @@ This module provides:
(``drawOnRecord``).
- Generic geometry / SRID utilities (``geo_utils``): WKB hex decoding,
Polygon → MultiPolygon normalization and SRID resolution helpers.
- A measure toolbox available to every user (read-only): live GPS
(WGS84) coordinates of the mouse on hover, a distance ruler, a polygon
surface/perimeter tool, a proximity check that flags pairs of objects
closer than a given threshold, and clipboard export of the last / all
measurements. Measurements are geodesic (``ol.sphere``), so they stay
correct in any map projection (e.g. EPSG:2056 with
``geoengine_swisstopo``).

**Table of contents**

Expand All @@ -65,6 +72,24 @@ panel and click the pencil button: the record switches to edit mode and
you can draw its new geometry on the map; it is saved automatically when
the drawing ends.

A measure toolbox is available on the right side of the map for every
user:

- **Coordinates** (crosshairs): toggle on, then move the mouse over the
map to read the live GPS (WGS84) coordinates. In a projected CRS the
native E/N coordinates are shown too.
- **Distance** (horizontal arrows): click to add points, double-click to
finish; the geodesic length of the line is displayed.
- **Surface** (square): click to draw a polygon, double-click to finish;
the geodesic area and perimeter are displayed.
- **Proximity** (compress): enter a minimum distance (e.g. 4 m); every
pair of map objects (parcels) closer than that threshold is
highlighted with the measured gap.
- **Copy last** (copy): copy the last measurement to the clipboard.
- **Copy all** (clipboard): copy every measurement taken to the
clipboard.
- **Eraser**: clear all measurements and return to normal selection.

For developers, the module patches ``GeoengineRenderer`` and exposes
``startDrawInteraction``, ``getGeometryFieldName`` and ``drawOnRecord``
on the prototype, plus generic helpers importable from
Expand Down
6 changes: 6 additions & 0 deletions geoengine_tools/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,9 @@ This module provides:
lets a user redraw the geometry of an existing record (`drawOnRecord`).
- Generic geometry / SRID utilities (`geo_utils`): WKB hex decoding,
Polygon → MultiPolygon normalization and SRID resolution helpers.
- A measure toolbox available to every user (read-only): live GPS (WGS84)
coordinates of the mouse on hover, a distance ruler, a polygon
surface/perimeter tool, a proximity check that flags pairs of objects closer
than a given threshold, and clipboard export of the last / all measurements.
Measurements are geodesic (`ol.sphere`), so they stay correct in any map
projection (e.g. EPSG:2056 with `geoengine_swisstopo`).
16 changes: 16 additions & 0 deletions geoengine_tools/readme/USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,22 @@ To edit the geometry of an existing record, expand it in the **Records** panel
and click the pencil button: the record switches to edit mode and you can draw
its new geometry on the map; it is saved automatically when the drawing ends.

A measure toolbox is available on the right side of the map for every user:

- **Coordinates** (crosshairs): toggle on, then move the mouse over the map to
read the live GPS (WGS84) coordinates. In a projected CRS the native E/N
coordinates are shown too.
- **Distance** (horizontal arrows): click to add points, double-click to
finish; the geodesic length of the line is displayed.
- **Surface** (square): click to draw a polygon, double-click to finish; the
geodesic area and perimeter are displayed.
- **Proximity** (compress): enter a minimum distance (e.g. 4 m); every pair of
map objects (parcels) closer than that threshold is highlighted with the
measured gap.
- **Copy last** (copy): copy the last measurement to the clipboard.
- **Copy all** (clipboard): copy every measurement taken to the clipboard.
- **Eraser**: clear all measurements and return to normal selection.

For developers, the module patches `GeoengineRenderer` and exposes
`startDrawInteraction`, `getGeometryFieldName` and `drawOnRecord` on the
prototype, plus generic helpers importable from
Expand Down
25 changes: 25 additions & 0 deletions geoengine_tools/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,13 @@ <h1>GeoEngine Tools</h1>
(<tt class="docutils literal">drawOnRecord</tt>).</li>
<li>Generic geometry / SRID utilities (<tt class="docutils literal">geo_utils</tt>): WKB hex decoding,
Polygon → MultiPolygon normalization and SRID resolution helpers.</li>
<li>A measure toolbox available to every user (read-only): live GPS
(WGS84) coordinates of the mouse on hover, a distance ruler, a polygon
surface/perimeter tool, a proximity check that flags pairs of objects
closer than a given threshold, and clipboard export of the last / all
measurements. Measurements are geodesic (<tt class="docutils literal">ol.sphere</tt>), so they stay
correct in any map projection (e.g. EPSG:2056 with
<tt class="docutils literal">geoengine_swisstopo</tt>).</li>
</ul>
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
Expand All @@ -411,6 +418,24 @@ <h2><a class="toc-backref" href="#toc-entry-1">Usage</a></h2>
panel and click the pencil button: the record switches to edit mode and
you can draw its new geometry on the map; it is saved automatically when
the drawing ends.</p>
<p>A measure toolbox is available on the right side of the map for every
user:</p>
<ul class="simple">
<li><strong>Coordinates</strong> (crosshairs): toggle on, then move the mouse over the
map to read the live GPS (WGS84) coordinates. In a projected CRS the
native E/N coordinates are shown too.</li>
<li><strong>Distance</strong> (horizontal arrows): click to add points, double-click to
finish; the geodesic length of the line is displayed.</li>
<li><strong>Surface</strong> (square): click to draw a polygon, double-click to finish;
the geodesic area and perimeter are displayed.</li>
<li><strong>Proximity</strong> (compress): enter a minimum distance (e.g. 4 m); every
pair of map objects (parcels) closer than that threshold is
highlighted with the measured gap.</li>
<li><strong>Copy last</strong> (copy): copy the last measurement to the clipboard.</li>
<li><strong>Copy all</strong> (clipboard): copy every measurement taken to the
clipboard.</li>
<li><strong>Eraser</strong>: clear all measurements and return to normal selection.</li>
</ul>
<p>For developers, the module patches <tt class="docutils literal">GeoengineRenderer</tt> and exposes
<tt class="docutils literal">startDrawInteraction</tt>, <tt class="docutils literal">getGeometryFieldName</tt> and <tt class="docutils literal">drawOnRecord</tt>
on the prototype, plus generic helpers importable from
Expand Down
94 changes: 94 additions & 0 deletions geoengine_tools/static/src/css/measure_tools.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
/* Measure toolbox — positioned on the right side so it never collides with
the core draw/select/edit controls (left side, shown only to admins). */
.geoengine-measure-coord-control {
top: 4em;
right: 0.5em;
}

.geoengine-measure-distance-control {
top: 6em;
right: 0.5em;
}

.geoengine-measure-area-control {
top: 8em;
right: 0.5em;
}

.geoengine-measure-proximity-control {
top: 10em;
right: 0.5em;
}

.geoengine-measure-copy-last-control {
top: 12em;
right: 0.5em;
}

.geoengine-measure-copy-all-control {
top: 14em;
right: 0.5em;
}

.geoengine-measure-clear-control {
top: 16em;
right: 0.5em;
}

/* Coordinate readout toggle stays highlighted independently of the
core controls (it does not use the shared .selected-control class). */
.geoengine-coord-active > i {
color: #71639e;
}

/* Live GPS / native coordinate readout. The .ol-control class is intentionally
omitted (no button chrome), so position must be declared explicitly here —
otherwise bottom/left/transform are ignored and the box renders off-screen. */
.geoengine-coord-box {
position: absolute;
z-index: 1000;
bottom: 0.5em;
left: 50%;
transform: translateX(-50%);
padding: 2px 8px;
font-family: monospace;
font-size: 12px;
white-space: nowrap;
color: #fff;
background-color: rgba(0, 0, 0, 0.7);
border-radius: 4px;
pointer-events: none;
}

/* Measurement tooltips that follow the geometry. */
.geoengine-measure-tooltip {
position: relative;
padding: 3px 7px;
font-size: 12px;
line-height: 1.3;
white-space: nowrap;
color: #fff;
background-color: rgba(0, 0, 0, 0.7);
border-radius: 4px;
pointer-events: none;
}

.geoengine-measure-tooltip-measuring {
opacity: 0.9;
font-weight: bold;
}

.geoengine-measure-tooltip-static {
background-color: #71639e;
color: #fff;
}

.geoengine-measure-tooltip-static::before {
content: "";
position: absolute;
bottom: -6px;
left: 50%;
margin-left: -6px;
border: 6px solid transparent;
border-top-color: #71639e;
}
Loading
Loading