[general]
name=测量工具箱
qgisMinimumVersion=3.28
qgisMaximumVersion=4.99
description=Three map tools: measure distance and bearing between two points, draw an equidistant radius ring, and compute a terrain viewshed from a local or online (Terrarium XYZ) DEM.
about=The plugin provides three map tools, all activated from the toolbar and finished with right-click or Esc.<br><br>(1) Distance and bearing: click point A then point B; a label at point B shows the ellipsoidal distance, the initial bearing in degrees from true north (0-360) and its Chinese compass name. Moving the mouse after picking A previews the measurement live.<br><br>(2) Radius ring: click a centre point, move the mouse to grow an equidistant circle; the radius is labelled on the circle. Every direction has exactly the requested ground distance (Vincenty direct solution).<br><br>(3) Viewshed: choose a DEM once via "Set elevation (DEM) layer", then click an observation point and drag to set the view distance. The plugin reads the ground elevation at that point from the DEM and computes which cells are actually visible from it, drawing the result as a green overlay. Ray casting with a maximum-elevation test is used, with earth curvature correction.<br><br>Online elevation is supported for Terrarium-encoded XYZ tile layers (e.g. https://terrarium.nextgis.ru/{z}/{x}/{y}.png). Instead of reading online cells one by one, the plugin downloads only the few tiles covering the view circle, decodes elevations from RGB (elevation = R*256 + G + B/256 - 32768), caches them under D:\Temp\point_bearing_cache and stitches a local GeoTIFF that is then processed by the same viewshed algorithm. Cached tiles, stitched DEMs and viewshed results make repeated calculations instant; when the network is unavailable the tool fails fast with a clear message instead of freezing. Other online sources are still rejected.<br><br>All annotations are anchored to map coordinates and follow panning and zooming. No external dependencies; network access is only needed for online elevation sources.
version=1.4.3
author=xybdd1
email=xybdd@qq.com
license=GPLv2
homepage=https://github.com/xybdd1/point_bearing_tool
tracker=https://github.com/xybdd1/point_bearing_tool/issues
repository=https://github.com/xybdd1/point_bearing_tool
hasProcessingProvider=no
tags=measurement,distance,bearing,azimuth,radius,circle,viewshed,visibility,line of sight,DEM,annotation
category=Plugins
icon=icon.svg
experimental=False
deprecated=False
server=False

changelog=
  1.4.3
  - Cleared the security scan findings: SHA-1 cache key marked usedforsecurity=False; tile downloads restricted to http/https schemes; broad exception handlers narrowed to specific types
  1.4.2
  - Removed the deprecated supportsQt6 flag (QGIS 4 compatibility is now defined by qgisMaximumVersion=4.99)
  1.4.1
  - Plugin renamed to 测量工具箱 (Measuring Toolbox); package name point_bearing_tool unchanged
  - Author email corrected
  - Online Terrarium XYZ elevation for the viewshed: tiles covering the view circle are downloaded, decoded from RGB (elevation = R*256 + G + B/256 - 32768), cached under D:\Temp\point_bearing_cache and stitched into a local GeoTIFF processed by the existing viewshed algorithm; tile/DEM/result caching makes repeated calculations instant; network failures show a clear message instead of freezing; other online sources are still rejected
  - Observer height defaults to 30 m (base-station tower), configurable
  - Uniform translucent viewshed overlay without per-cell grid lines
  - New "Plugin settings…" dialog: observer/target height, tolerance, earth curvature, compute quality, and display styles for all three tools
  - Viewshed failures now explain the cause (DEM bounds and point coordinates, NoData) instead of failing silently
  - Fixed DEM block alignment and half-pixel sampling so the observer elevation is read from the correct cell
  1.4.0
  - Added the "Plugin settings…" dialog (wrench icon): observer height, target height, elevation tolerance, earth-curvature switch and compute quality (fast/standard/fine) in the Viewshed tab; colours, line widths and opacity for the viewshed fill, view-distance ring, measure line and radius circle in the Style tab. Settings are saved in QgsSettings and take effect on the next calculation; a "Restore defaults" button is included
  - Viewshed now supports online Terrarium XYZ elevation layers (e.g. terrarium.nextgis.ru): the few tiles covering the view circle are downloaded, decoded from RGB (elevation = R*256 + G + B/256 - 32768), cached under D:\Temp\point_bearing_cache and stitched into a local GeoTIFF that runs through the existing viewshed algorithm
  - Observer height now defaults to 30 m (simulating a base-station tower), so the observation point is DEM ground elevation + 30 m; still configurable in settings
  - Tiles, stitched DEMs and viewshed results are cached, so the second calculation on the same spot is instant; the cache can be deleted safely
  - Tile downloads use a short timeout and fail with a clear message instead of freezing QGIS; other online sources are still rejected
  - Fixed DEM block alignment and half-pixel sampling so the observer elevation is read from the correct DEM cell (local and online paths)
  - Clearer failure dialogs: a point outside the DEM shows the DEM bounds and the point coordinates; an unreadable elevation explains the likely causes instead of failing silently
  1.3.1
  - Reject online tile (XYZ/WMS/WCS) DEM layers in the viewshed tool to prevent QGIS from freezing
  1.3.0
  - Added the "Viewshed" tool: click an observation point, drag the view distance, and get the terrain-visible area computed from a DEM
  - Added "Set elevation (DEM) layer" - chosen once and remembered
  - Observer height, target height and tolerance are configurable
  - Supports both geographic (EPSG:4326) and projected DEMs
  1.2.1
  - The radius label now shows the radius only (diameter and circumference removed)
  1.2.0
  - Added the "Radius ring" tool
  - The circle is generated with Vincenty direct solutions, so the radius is exact in every direction
  1.1.0
  - Removed the dock panel; the result is now labelled directly on the map at the end point
  - Chinese compass names now use forms such as "东偏南"
  1.0.0
  - First release
