[general]
name=SWC Grid Slope (坵塊法坡度分析)
qgisMinimumVersion=3.22
qgisMaximumVersion=4.99
supportsQt6=True
description=Grid (cell) method slope analysis following Taiwan's Soil and Water Conservation Technical Regulations (水土保持技術規範, Articles 23, 25, 26); competent authority: the Agency of Rural Development and Soil and Water Conservation (ARDSWC), Ministry of Agriculture, Taiwan (農業部農村發展及水土保持署).
version=1.2.4
author=黃敏郎 (Min-Lang Huang)
email=yoshi.hml@gmail.com
about=Implements the "grid method" (坵塊法) slope analysis required by Taiwan's Soil and Water Conservation Technical Regulations (水土保持技術規範). The competent authority of the regulations is the Agency of Rural Development and Soil and Water Conservation, Ministry of Agriculture (ARDSWC, MOA; 農業部農村發展及水土保持署). This plugin is an independent tool and is not an official product of ARDSWC. Draw a rectangular analysis frame on the map (move / rotate / resize it interactively), choose a 10 m or 25 m cell, and the plugin fills the frame with square cells starting from the top-left corner, counts intersections between each cell edge and the contour lines, and computes the mean slope S = nπΔh/(8L)×100 and inclination θ for every cell. Slope grades 1–7 (Art. 23) and cell aspect (Art. 26) are written to attribute fields, and an aspect map (8-direction downslope arrows) is produced. When a plan boundary is given, the frame is kept large enough to contain it and only cells overlapping the boundary are generated. Terrain input can be contour lines or a DEM (contours are generated automatically). The plugin styles and labels the results like a conventional hand-drawn grid slope map, builds print layouts for the slope map and the aspect map (legend, north arrow, scale bar, statistics table, notes, signature box), and saves the whole project into an output folder as a new .qgz project file plus a GeoPackage holding all data. 依水土保持技術規範（主管機關：農業部農村發展及水土保持署）坵塊法計算坡度、分級、坡向並自動產製坵塊圖、版面與 GeoPackage 專案。
tracker=https://github.com/yoshihuang/swc_grid_slope/issues
repository=https://github.com/yoshihuang/swc_grid_slope
homepage=https://github.com/yoshihuang/swc_grid_slope
changelog=1.2.4 - Pass the plugins.qgis.org security and Qt6 scans: no try/except/pass (bandit B110, now logged to the QGIS message log), no deprecated unscoped enums in the source (QGIS 3 fallbacks looked up by name), no ambiguous variable names (E741). No functional change.
    1.2.3 - Fix metadata.txt for plugins.qgis.org (no bare percent signs in the changelog).
    1.2.2 - Larger labels on the 坵塊坡度分析 layer (text style 0.085 L → 0.155 L; big-grade style: grade 0.50 L, intersection count, slope percent and cell number enlarged); edge-count labels capped at 0.24 L so they do not cover the cell text.
    1.2.1 - Plan boundary (計畫範圍) is mandatory: drawing, editing and computing are blocked with a warning when none is selected or it has no features; computing is blocked when the grid frame does not fully contain the plan boundary (also in the Processing algorithm, where the plan input is now required).
    1.2.0 - Layer tree: main group 坵塊法坡度坡向分析 with sub-groups 坡度圖 and 坡向圖; intersection points hidden by default (layouts follow its visibility); edge layer renamed 坵塊邊界 with larger labels fitted to the layout scale; export names <QGIS project name>_坡度圖 / _坡向圖 (PDF or PNG); layout fits the produced cells with an automatic scale bar; adaptive aspect sampling (fewer 'flat' cells); GeoPackage primary key reused on re-save (no extra gpkg_fid columns); fix export hang of the aspect layout on QGIS 3.x.
    1.1.0 - Analysis frame must contain the plan boundary (auto-expanded with a warning after drawing / moving / rotating / resizing); only cells overlapping the plan boundary are generated and computed; aspect map (hollow 8-direction arrow point layer) with its own print layout and PDF/PNG export; button renamed to 產出坵塊並計算坡度及坡向; 'all local layers' option removed (results, inputs and memory layers are saved).
    1.0.1 - Fix saving when "all local layers" is checked: rasters stored inside a GeoPackage (e.g. after a previous save) are opened with their full source; Float64/Int32 single-band rasters are converted to Float32; multiband rasters GeoPackage cannot hold, and layers that fail, are reported and kept linked instead of aborting; fid / case-duplicate field clashes handled.
    1.0.0 - First public release: contour / DEM input, interactive rotated frame, 10/25 m cells, edge intersection counts, slope percent, angle, grade, aspect, print layout, save project to an output folder (.qgz + .gpkg). Supports QGIS 3.22 – 4.99 (Qt5 / Qt6).
tags=slope,grid,soil and water conservation,taiwan,contour,dem,水土保持,坵塊,坡度
category=Vector
icon=icons/icon.svg
experimental=False
deprecated=False
server=False
hasProcessingProvider=yes
