The 3-30-300 rule (Konijnendijk 2023) asks that every resident sees at least 3 trees from home, lives in a neighbourhood with at least 30 percent tree canopy, and has a public green space within 300 m. Measuring it needs three GIS techniques at once: line of sight from homes to individual trees, canopy mapping from imagery or canopy-height data, and network distance to qualifying parks (Browning et al. 2024).
02GreenRule carries such a study from open data to a neighbourhood scorecard. It fetches OpenStreetMap buildings, trees, parks and paths and an open canopy source for the study area; derives a canopy mask (Meta/WRI 1 m canopy height, ESA WorldCover 10 m, a Sentinel-2 NDVI median with an Otsu or fixed threshold, or your own raster); detects tree tops; counts the trees in line of sight from the facade viewpoints of every home; computes the canopy share per neighbourhood, home buffer or grid cell; computes the pedestrian-network distance to qualifying parks; and reports population-weighted compliance, inequality (Gini, concentration index, quintile gaps, Theil decomposition), Gaussian E2SFCA park supply, planting need, and a self-contained HTML report that typesets every formula and lists every reference.
The same chain is available in the lab dock (page by page, with charts, cards and styled layers) and in the Processing provider (one algorithm per step plus a full-run algorithm, usable in models and batch runs). Only qgis.core, GDAL, NumPy and PyQt are required; SciPy is used when present, with identical results without it.
Why it exists: the one QGIS plugin built for the rule, Análise 3-30-300 para QGIS, replaces "visible" with "mapped trees within a radius", measures straight-line distance and needs a ready-made canopy layer; it has no visibility model, no canopy detection, no network and no equity analysis. Other Hub plugins cover single pieces (street-level green view from paid Street View imagery, NDVI coverage per census sector, green space factor), and the R packages GreenExp_R and greenR live outside QGIS.
/vsicurl/ takes the QGIS proxy when one is set. Everything fetched is cached in the QGIS profile folder zero2greenrule/cache, so a repeated run works offline.All metric work happens in a projected CRS in metres. If the buildings are geographic, not in metres, or Web Mercator (EPSG:3857 family, whose metres are stretched by ), every input is reprojected to the UTM zone of the area centre (EPSG:326xx north, 327xx south); otherwise the input CRS is kept. Every raster (your raster, Meta heights in EPSG:3857, WorldCover in EPSG:4326, Sentinel-2 in its own UTM zone) is warped onto one grid in the working CRS: masks and classes with nearest neighbour, heights and NDVI with bilinear resampling. The default cell is 1 m for sources of 2 m or finer, else the source resolution (10 m). When the canopy cell is coarser than 1 m, line of sight runs on its own 1 m building surface. Hard limits: study area at most 50 km² (OpenStreetMap fetches warn above 16 km²) and at most 64 million cells per grid, with a coarser cell proposed. The run log and the report state every reprojection and resampling.
The dock has a dark icon rail on the left; each page runs only its own step in a QGIS background task (progress bar and Cancel button; the dock stays responsive). Results go to a 02GreenRule layer group. Every control has a tooltip with its unit and reference.
Study area from the map extent, a polygon layer or the neighbourhood layer. Figures: area and padded area (km²), the cell size and the working CRS with the reason it was chosen. Load demo district adds the synthetic district of section 8.
Buildings (height and storeys fields), homes (optional address points, or a residential filter expression on the buildings, and a residents field), paths and streets, parks (access field), trees (height field), park entrances, neighbourhoods (id, name and residents fields) and an optional terrain model. Fetch missing layers downloads the ticked layers from OpenStreetMap for the padded area (the attribution line is shown). When Overpass is busy, Fetch with 02AgentOSM runs that plugin's Processing algorithm if it is installed.
Source chips: Meta 1 m height, WorldCover 10 m, Sentinel-2 NDVI, or My raster (height, 0/1 mask or NDVI). Per source: the minimum tree height; the season and maximum cloud cover; the NDVI threshold (Otsu or fixed) with a histogram that marks ; the cell size. Build canopy and detect tree tops adds the canopy raster (two-class style, water in blue) and the tree tops. Figures: canopy share of land, tree tops, cell, source note.
Mode: line of sight or within distance; trees required (3), radius (50 m), viewpoint floor (ground, middle, top), eye height (1.6 m), viewpoint spacing (10 m), storey height and default building height; optional visible greenness (VGVI). Count trees in view adds the homes layer. Figures: residents passing, median trees, the change if trees within counted instead of visible trees, homes. Show view fan of the selected home draws the sight lines of one home (visible green, blocked red) on the map.
Neighbourhood: zones, a home buffer (250 m) or a square grid (500 m); target (30 percent) and minimum valid share (50 percent). Compute canopy share reuses the Canopy page settings. Figures: residents passing, median canopy share, area canopy, zones below target; a histogram and a gauge per zone.
Minimum merged park size (0.5 ha, 1 ha or custom), park kinds, distance (300 m), snap limit (100 m), network or straight line. Measure park access runs the part. Figures: residents within, median distance, unreachable homes, qualifying parks, mean detour; a distance histogram.
Population basis (floor area, footprint, equal), the equity variable and its direction (higher is more deprived, or better off), the park supply catchment . Run the rule and equity runs every part. Charts: Lorenz curves with Gini, the concentration index with a plain reading, pass shares per quintile, the Theil split and Style homes by park supply (a map of E2SFCA park area per resident).
Run all (canopy, 3, 30, 300, equity, cards). A card for the study area and one per neighbourhood: grade, three gauges, residents, trees needed, homes beyond 300 m, the weakest part. A ranked table; Homes by score (0 to 3) and Zones by grade style the map. Export: Write HTML report, GeoPackage + GeoTIFF (every layer and the canopy raster), CSV tables.
A short guide, the method references, the data licences, and links to this manual and the repository. The visible greenness here is geometric (a viewshed over the canopy mask); street-level photo indices are a different measure.
The equations carry the same numbers in the HTML report. Symbols: trees required, canopy target, distance threshold, view radius, trees visible from home , canopy share of its neighbourhood, its park distance.
Meta/WRI 1 m canopy height (Tolan et al. 2024): cells at or above the minimum height (3 m) are canopy; tiles are the zoom-9 quadkeys of the area; 255 is treated as no data. ESA WorldCover 10 m 2021 v200 (Zanaga et al. 2022): class 10 is canopy, class 80 water. Sentinel-2 L2A: reflectance from the item's own scale and offset, SCL classes 0, 1, 3, 8, 9 and 10 masked, the per-pixel median NDVI of up to six leaf-on scenes (Earth Search collection 1; the earlier collection is the fallback).
Eq. (1) Normalised difference vegetation index Tucker 1979
Eq. (2) Otsu threshold Otsu 1979
The mask codes are 0 land without canopy, 1 canopy, 254 water (valid data, outside the land share), 255 no data. For a neighbourhood with cell area :
Eq. (3) Canopy share of a neighbourhood Konijnendijk 2023
is NULL when is below the minimum valid share. Ten-metre NDVI does not separate trees from grass, so this source is called "vegetation (NDVI)" in the dock and the report.
Local maxima of the canopy height model with a window that grows with height (Popescu & Wynne 2004), heights at least the minimum, tops closer than 2 m thinned; merged with inventory or OpenStreetMap trees (duplicates within 2 m, the point wins). Without tree points or heights, canopy patches give tree equivalents (patch area / crown area) and the 3 part runs in radius mode and is labelled an estimate.
Eq. (4) Variable search window for tree tops Popescu & Wynne 2004
Facade viewpoints lie every spacing metres along each home's outline, 0.5 m outside; viewpoints inside another building (shared walls) are dropped. With storeys of height and eye height :
Eq. (5) Viewpoint height Franklin & Ray 1994
The building surface is the terrain (or flat ground) plus building heights (height field, else storeys times storey height, else the default height). A tree at horizontal distance is visible when the surface stays below the sight line at every sample (step half a cell, from 1 m on), Franklin & Ray (1994):
Eq. (6) Line of sight to a tree Franklin & Ray 1994
is the crown top; the sight line to the top lies above the line to mid-crown, so "top or mid-crown visible" equals "top visible". Vegetation is not an obstacle. trees_vis counts distinct trees visible from any viewpoint of the home; trees_near counts trees within (the radius-only proxy). Optional visible greenness (Labib et al. 2021) uses a radial viewshed with a running maximum elevation angle; is the set of visible cells, the canopy mask:
Eq. (7) Visible greenness Labib et al. 2021
Qualifying parks: polygons of the chosen kinds whose access is not private or no, merged when they touch or lie within 5 m, with a merged area of at least 0.5 ha (the lower bound in Konijnendijk 2023; the WHO indicator uses 1 ha, Annerstedt van den Bosch et al. 2016). Access points: your entrances, else boundary points every 20 m within 25 m of a path, plus network nodes inside the park (distance 0); a park with none gets its nearest boundary point (kind "fallback", logged). The pedestrian graph keeps every highway except motorway, trunk and their links and access=no; lines connect where they share a vertex (within 0.5 m); edge weight is planar length. Crossings of lines without a shared vertex are counted and named in the run log: a street layer that is not split at its intersections falls apart into corridors (Processing: Split with lines); in OpenStreetMap such crossings are bridges and tunnels. One multi-source Dijkstra (1959) run from all access points gives at every node; a home snapped at offset to edge of length at fraction :
Eq. (8) Network distance of a snapped home Dijkstra 1959
Homes beyond the snap limit or on a component without a park are NULL. d300_euc is the straight-line distance to the nearest qualifying park polygon (0 inside) and detour = d300_net / d300_euc.
Eq. (9) Rule score Konijnendijk 2023
Eq. (10) Green Rule Index (plugin composite) Konijnendijk 2023
all_three is 1 when every part passes and 0 when any known part fails; and the Green Rule Index (a plugin composite, not part of the published rule) are NULL when a part is NULL. Population weights: the residents field; else the zone residents split over its homes by floor area (footprint times storeys), footprint or equally; else 1 per home.
Indicators: trees_vis, canopy_pct, access and gri. With and the cumulative population and value shares of the Lorenz curve (Nesbitt et al. 2019 use Lorenz curves and Gini for green equity):
Eq. (11) Population-weighted Gini from the Lorenz curve Nesbitt et al. 2019
The concentration index (Kakwani, Wagstaff & van Doorslaer 1997) ranks residents by the equity variable from most deprived () to least deprived (), ties at their mid-rank; means greenness is concentrated among the advantaged:
Eq. (12) Concentration index Kakwani et al. 1997
Theil T splits into a within-zone and a between-zone part (Theil 1967; Shorrocks 1980), being the group's share of the total:
Eq. (13) Theil decomposition Theil 1967; Shorrocks 1980
Quintiles of the population by the equity variable give pass shares per part and the Q5 - Q1 difference and Q5/Q1 ratio. Park supply is the Gaussian two-step floating catchment area (Luo & Wang 2003; Dai 2011) with network distances from bounded Dijkstra runs per park:
Eq. (14) Gaussian E2SFCA park supply Luo & Wang 2003; Dai 2011
Per neighbourhood: residents, homes, pass shares, mean visible trees, canopy percent, median distance, share meeting all three, a grade (A at least 80 percent, B 60, C 40, D 20, else E; a plugin convention), homes beyond the distance, the weakest part, and the planting need with land area , canopy area and crown area :
Eq. (15) Planting need Konijnendijk 2023
The report also gives the population-weighted share of residents meeting none, one, two and all three parts, over the homes whose three parts are known (the score field). A city where most residents meet two parts needs a different programme from one where many meet none.
The thresholds 3, 30 percent and 300 m are a rule of thumb (Konijnendijk 2023). The report adds the population-weighted share of residents passing each part at neighbouring thresholds: 1 to 6 trees, 20 to 40 percent canopy, and 200, 300, 400, 500 and 800 m, with the run's own threshold in bold. The study-area card and its planting need count only the cells inside the study area; the working grid itself is padded by the view or buffer radius.
Provider zero2greenrule, groups Data and canopy, 3-30-300 rule and Equity and scorecard. Every algorithm copies its inputs, reprojects them to the working CRS and writes its outputs with real field types (integers for ids and flags, doubles for measures, NULL where a value is undefined). Parameters marked advanced are under Advanced parameters. From Python: processing.run("zero2greenrule:<id>", {...}). The equation numbers in the help refer to section 5.
Id: zero2greenrule:fetch_osm
Downloads buildings, trees (natural=tree nodes), public green spaces (leisure park, garden, nature_reserve, common; landuse recreation_ground, village_green) and paths/streets (every highway way) from the Overpass API for the extent and writes them in the working CRS. Building height comes from height (m or ft) or building:levels x 3 m and is NULL when neither is tagged. Answers are cached by request in the cache folder, so a repeated run works offline. Keep the extent below about 16 km2 (Overpass fair use); the request carries a User-Agent naming the plugin.
Output fields: buildings osm_id, height, levels, building; trees osm_id, height, source; parks osm_id, kind, name, access; paths osm_id, highway, access.
Data licences: Map data (c) OpenStreetMap contributors, ODbL 1.0. Meta and World Resources Institute High Resolution Canopy Height Maps, CC BY 4.0. ESA WorldCover 10 m 2021 v200, CC BY 4.0. Contains modified Copernicus Sentinel data (free and open).
| Parameter | Description | Type | Default | Notes |
|---|---|---|---|---|
EXTENT | Extent to fetch | Extent | - | |
LAYERS | Layers | Choice | buildings, trees, parks, paths | Options: buildings; trees; parks; paths. Several allowed. |
CACHE | Cache folder (empty: the profile cache) optional | Folder | - | |
URL | Overpass interpreter URL optional advanced | String | https://overpass-api.de/api/interpreter | |
BUILDINGS | OSM buildings | Feature sink (output) | - | |
TREES | OSM trees | Feature sink (output) | - | |
PARKS | OSM parks | Feature sink (output) | - | |
PATHS | OSM paths | Feature sink (output) | - | |
N_BUILDINGS | Number of osm buildings | Output number | - | Returned in the result dictionary. |
N_TREES | Number of osm trees | Output number | - | Returned in the result dictionary. |
N_PARKS | Number of osm parks | Output number | - | Returned in the result dictionary. |
N_PATHS | Number of osm paths | Output number | - | Returned in the result dictionary. |
Id: zero2greenrule:canopy_mask
Builds the canopy mask of the 30 part on a grid in the working CRS: 0 land without canopy, 1 canopy, 254 water (left out of the land share), 255 no data. Sources: Meta/WRI 1 m canopy height (cells at or above the minimum height), ESA WorldCover 10 m (class 10 tree cover, class 80 water), a Sentinel-2 L2A NDVI median of up to six leaf-on scenes (SCL classes 0, 1, 3, 8, 9, 10 masked) or your own raster. Online sources stream through GDAL /vsicurl/. NDVI is thresholded at a fixed value or by Otsu; 10 m NDVI does not separate trees from grass, so it is labelled 'vegetation (NDVI)'.
NDVI = (NIR - Red) / (NIR + Red), reflectance = DN * scale + offset (manual Eq. 1)
t* = argmax_t omega0(t) omega1(t) [mu0(t) - mu1(t)]^2 (manual Eq. 2)
Cell size 0 takes the source resolution (1 m for Meta, 10 m for WorldCover and Sentinel-2, the pixel size of a projected user raster).
Data licences: Map data (c) OpenStreetMap contributors, ODbL 1.0. Meta and World Resources Institute High Resolution Canopy Height Maps, CC BY 4.0. ESA WorldCover 10 m 2021 v200, CC BY 4.0. Contains modified Copernicus Sentinel data (free and open).
| Parameter | Description | Type | Default | Notes |
|---|---|---|---|---|
EXTENT | Study area extent | Extent | - | |
SOURCE | Canopy source | Choice | My raster: 0/1 mask | Options: Meta/WRI 1 m canopy height (online); ESA WorldCover 10 m (online); Sentinel-2 NDVI median (online); My raster: canopy height; My raster: 0/1 mask; My raster: NDVI. |
RASTER | My raster (for the 'My raster' sources) optional | Raster layer | - | |
MIN_HEIGHT | Minimum canopy height (m) | Number | 3.0 | Min 0. |
NDVI_THRESHOLD | NDVI threshold (empty: Otsu) optional | Number | - | Min -1. Max 1. |
CELL | Cell size (m, 0: from the source) | Number | 0.0 | Min 0. |
MAX_CLOUD | Sentinel-2 maximum cloud cover (percent) advanced | Number | 20.0 | Min 0. Max 100. |
SEASON | Sentinel-2 season 'YYYY-MM-DD/YYYY-MM-DD' (empty: leaf-on of the last full year) optional | String | - | |
OUTPUT | Canopy mask | Raster (output) | - | |
CANOPY_SHARE | Canopy share of land (0..1) | Output number | - | Returned in the result dictionary. |
THRESHOLD | Threshold used (m or NDVI) | Output number | - | Returned in the result dictionary. |
Id: zero2greenrule:detect_tree_tops
Tree tops from a canopy height model by local maxima with a window whose diameter grows with the height (pooled deciduous/pine fit of Popescu & Wynne 2004), clamped to 3-15 m. Cells below the minimum height are ignored; a plateau of equal tops keeps the cell nearest its centre; tops closer than the minimum spacing are thinned, the taller kept. SciPy is used when present, with an identical numpy fallback.
w(h) = 2.51503 + 0.00901 h^2 [m], 3 <= w <= 15 (manual Eq. 4)
Output fields: tree_id, height (m), source = detected. A geographic or Web Mercator CHM is warped (bilinear) to the UTM zone of its centre first.
| Parameter | Description | Type | Default | Notes |
|---|---|---|---|---|
CHM | Canopy height model (m) | Raster layer | - | |
EXTENT | Extent (empty: the whole raster) optional | Extent | - | |
MIN_HEIGHT | Minimum tree height (m) | Number | 3.0 | Min 0. |
MIN_SPACING | Minimum spacing between tops (m) | Number | 2.0 | Min 0. |
CELL | Cell size (m, 0: the raster's own) advanced | Number | 0.0 | Min 0. |
OUTPUT | Tree tops | Feature sink (output) | - | |
TREES | Number of tree tops | Output number | - | Returned in the result dictionary. |
Id: zero2greenrule:trees_in_view
The 3 part: how many distinct trees each home sees. Facade viewpoints are placed every spacing metres along each home's outline, 0.5 m outside (viewpoints inside another building are dropped). A tree within the radius is visible when no cell of the building surface (terrain plus building heights) rises above the sight line from the viewpoint to the crown top. Trees come from the tree points, from tops detected on the canopy height model, or both (duplicates within 2 m merged, points win).
z_v = z_terrain + f s + e, f in {0, floor(L/2), L - 1} (manual Eq. 5)
visible(v, t) iff max over samples (DSM(s) - z_v) / d_s < (z_t - z_v) / D, D <= R (manual Eq. 6)
Output fields: trees_vis (distinct trees visible from any viewpoint), trees_near (trees within the radius, the radius-only proxy), pass_3 = trees_vis >= required, pop_w; the other rule fields stay NULL. Mode 'radius' counts trees within the radius without the line-of-sight test.
Geographic or Web Mercator input is reprojected to the UTM zone of its centre; every distance and area is planar metres there. Values that cannot be computed are NULL, never a sentinel.
| Parameter | Description | Type | Default | Notes |
|---|---|---|---|---|
BUILDINGS | Building footprints | Vector features | - | |
RESIDENTIAL | Residential filter (expression on buildings; empty: every building is a home) optional | Expression | - | |
HEIGHT_FIELD | Building height field (m) optional | Field | - | Field of BUILDINGS. |
LEVELS_FIELD | Building storeys field optional | Field | - | Field of BUILDINGS. |
POP_FIELD | Residents per building field (empty: zone population or 1 per home) optional | Field | - | Field of BUILDINGS. |
STOREY | Storey height (m) advanced | Number | 3.0 | Min 1. Max 10. |
DEFAULT_HEIGHT | Height of buildings without height or storeys (m) advanced | Number | 9.0 | Min 1. |
TREES | Tree points (optional) optional | Vector features | - | |
TREE_HEIGHT_FIELD | Tree height field (m) optional | Field | - | Field of TREES. |
CHM | Canopy height model for tree tops (optional) optional | Raster layer | - | |
EXTENT | Study area extent (empty: the extent of the buildings) optional | Extent | - | |
TREES_REQUIRED | Trees required | Number | 3 | Min 1. |
MODE | Counting mode | Choice | Line of sight | Options: Line of sight; Within the radius. |
RADIUS | View radius (m) | Number | 50.0 | Min 1. |
FLOOR | Viewpoint floor | Choice | Ground | Options: Ground; Middle; Top. |
EYE_HEIGHT | Eye height above the floor (m) | Number | 1.6 | Min 0. |
SPACING | Viewpoint spacing along facades (m) | Number | 10.0 | Min 1. |
TREE_HEIGHT | Height of trees without a height (m) advanced | Number | 8.0 | Min 0.5. |
MIN_HEIGHT | Minimum tree height on the CHM (m) advanced | Number | 3.0 | Min 0. |
OUTPUT | Homes - trees in view | Feature sink (output) | - | |
SHARE_PASS | Population share passing the 3 part | Output number | - | Returned in the result dictionary. |
MEDIAN_VISIBLE | Median visible trees per home | Output number | - | Returned in the result dictionary. |
Id: zero2greenrule:canopy_share
The 30 part: the canopy share of the neighbourhood of every home. The neighbourhood is the zone holding the home, a disc of the buffer radius around it, or a generated square grid. Land is every valid cell that is not water; a unit whose valid share is below the minimum gets a NULL share. The canopy raster is a 0/1 mask (for instance the output of 'Canopy mask'), a canopy height model (threshold) or NDVI (fixed threshold or Otsu).
c_u = sum canopy cells * a / sum land cells * a, v_u = valid cells / all cells (manual Eq. 3)
Output: homes with canopy_pct, canopy_valid, pass_30 = canopy_pct >= target; neighbourhoods with canopy_pct, valid_share, canopy_m2, land_m2, pass_30 (in buffer mode the neighbourhood table uses the zones, or the grid when none are given).
Geographic or Web Mercator input is reprojected to the UTM zone of its centre; every distance and area is planar metres there. Values that cannot be computed are NULL, never a sentinel.
| Parameter | Description | Type | Default | Notes |
|---|---|---|---|---|
BUILDINGS | Building footprints | Vector features | - | |
RESIDENTIAL | Residential filter (expression on buildings; empty: every building is a home) optional | Expression | - | |
HEIGHT_FIELD | Building height field (m) optional | Field | - | Field of BUILDINGS. |
LEVELS_FIELD | Building storeys field optional | Field | - | Field of BUILDINGS. |
POP_FIELD | Residents per building field (empty: zone population or 1 per home) optional | Field | - | Field of BUILDINGS. |
STOREY | Storey height (m) advanced | Number | 3.0 | Min 1. Max 10. |
DEFAULT_HEIGHT | Height of buildings without height or storeys (m) advanced | Number | 9.0 | Min 1. |
CANOPY | Canopy raster | Raster layer | - | |
KIND | Canopy raster holds | Choice | 0/1 canopy mask (254 = water) | Options: 0/1 canopy mask (254 = water); Canopy height (CHM, metres); NDVI (-1..1). |
MIN_HEIGHT | Minimum canopy height for a CHM (m) | Number | 3.0 | Min 0. |
NDVI_THRESHOLD | NDVI threshold (empty: Otsu) optional | Number | - | Min -1. Max 1. |
ZONES | Neighbourhood zones (optional) optional | Vector features | - | |
ZONE_ID_FIELD | Zone id field optional | Field | - | Field of ZONES. |
ZONE_NAME_FIELD | Zone name field optional | Field | - | Field of ZONES. |
ZONE_POP_FIELD | Zone residents field (split over its homes) optional | Field | - | Field of ZONES. |
NEIGHBOURHOOD | Neighbourhood | Choice | Zones | Options: Zones; Home buffer; Square grid. |
BUFFER | Buffer radius (m) | Number | 250.0 | Min 10. |
GRID_SIZE | Grid cell size (m) | Number | 500.0 | Min 50. |
TARGET | Canopy target (percent) | Number | 30.0 | Min 0. Max 100. |
MIN_VALID | Minimum valid share of a unit advanced | Number | 0.5 | Min 0. Max 1. |
EXTENT | Study area extent (empty: the extent of the buildings) optional | Extent | - | |
OUTPUT | Homes - canopy share | Feature sink (output) | - | |
ZONES_OUT | Neighbourhood canopy | Feature sink (output) | - | |
SHARE_PASS | Population share passing the 30 part | Output number | - | Returned in the result dictionary. |
CANOPY_SHARE | Canopy share of land in the grid (0..1) | Output number | - | Returned in the result dictionary. |
Id: zero2greenrule:park_access
The 300 part: distance from every home to the nearest qualifying public green space. Parks of the chosen kinds whose access is not private/no are merged when they touch or lie within the merge gap; a merged park qualifies from the minimum size (0.5 ha by default, the lower bound in Konijnendijk 2023; 1 ha is the WHO indicator). Access points are your entrances, else boundary points every 20 m within 25 m of a path, plus network nodes inside the park. One multi-source Dijkstra run on the pedestrian network (motorway, trunk and access=no excluded; lines connect where they share a vertex) gives the network distance; homes beyond the snap distance or on a component without a park are NULL.
d_i = s_i + min(d(u) + t_i L, d(v) + (1 - t_i) L) (manual Eq. 8)
Output: homes with d300_net, d300_euc (straight line to the park polygon, 0 inside), detour = d300_net / d300_euc, park_id, pass_300; qualifying parks (park_id, area_ha, kind, name, n_access); access points (park_id, kind = entrance | edge | inside | fallback). Without a path layer the straight-line distance is used.
Geographic or Web Mercator input is reprojected to the UTM zone of its centre; every distance and area is planar metres there. Values that cannot be computed are NULL, never a sentinel.
| Parameter | Description | Type | Default | Notes |
|---|---|---|---|---|
BUILDINGS | Building footprints | Vector features | - | |
RESIDENTIAL | Residential filter (expression on buildings; empty: every building is a home) optional | Expression | - | |
HEIGHT_FIELD | Building height field (m) optional | Field | - | Field of BUILDINGS. |
LEVELS_FIELD | Building storeys field optional | Field | - | Field of BUILDINGS. |
POP_FIELD | Residents per building field (empty: zone population or 1 per home) optional | Field | - | Field of BUILDINGS. |
STOREY | Storey height (m) advanced | Number | 3.0 | Min 1. Max 10. |
DEFAULT_HEIGHT | Height of buildings without height or storeys (m) advanced | Number | 9.0 | Min 1. |
PARKS | Green spaces | Vector features | - | |
KIND_FIELD | Green space kind field optional | Field | kind | Field of PARKS. |
KINDS | Qualifying kinds (comma separated; empty: all) optional | String | park,garden,nature_reserve,recreation_ground,village_green,common | |
ACCESS_FIELD | Access field (private/no excluded) optional | Field | access | Field of PARKS. |
STREETS | Paths and streets (optional) optional | Vector features | - | |
ENTRANCES | Park entrances (optional) optional | Vector features | - | |
MIN_HA | Minimum park size (ha) | Number | 0.5 | Min 0. |
DISTANCE | Distance threshold (m) | Number | 300.0 | Min 1. |
MODE | Distance | Choice | Network | Options: Network; Straight line. |
SNAP_MAX | Maximum snap distance to the network (m) advanced | Number | 100.0 | Min 1. |
MERGE_GAP | Merge parks closer than (m) advanced | Number | 5.0 | Min 0. |
EXTENT | Study area extent (empty: the extent of the buildings) optional | Extent | - | |
OUTPUT | Homes - park access | Feature sink (output) | - | |
PARKS_OUT | Qualifying parks | Feature sink (output) | - | |
ACCESS_OUT | Park access points | Feature sink (output) | - | |
SHARE_PASS | Population share passing the 300 part | Output number | - | Returned in the result dictionary. |
PARKS_QUALIFYING | Qualifying parks | Output number | - | Returned in the result dictionary. |
Id: zero2greenrule:green_rule_3_30_300
The whole 3-30-300 study in one run: canopy mask, tree tops, trees in view (3), canopy share (30), park access (300), the combined score and Green Rule Index, population-weighted equity indicators and a card per neighbourhood. The output folder receives greenrule.gpkg (every layer), canopy_mask.tif, homes.csv, neighbourhoods.csv and greenrule_report.html, a self-contained report that typesets every formula and lists every reference and data licence.
S_i = 1[n_i >= N] + 1[c_i >= C] + 1[d_i <= D] (manual Eq. 9)
GRI_i = (min(n_i/N, 1) + min(c_i/C, 1) + clip(1 - (d_i - D)/D, 0, 1)) / 3 (manual Eq. 10)
The Green Rule Index is a plugin composite, not part of the published rule. all_three is 1 when every part passes and 0 when any known part fails; score and gri are NULL when a part is NULL. Population weights: the residents field, else the zone residents split over its homes by floor area, else 1 per home. Without tree points or heights the 3 part runs in radius mode on canopy-patch tree equivalents and is reported as an estimate.
Geographic or Web Mercator input is reprojected to the UTM zone of its centre; every distance and area is planar metres there. Values that cannot be computed are NULL, never a sentinel.
Data licences: Map data (c) OpenStreetMap contributors, ODbL 1.0. Meta and World Resources Institute High Resolution Canopy Height Maps, CC BY 4.0. ESA WorldCover 10 m 2021 v200, CC BY 4.0. Contains modified Copernicus Sentinel data (free and open).
| Parameter | Description | Type | Default | Notes |
|---|---|---|---|---|
BUILDINGS | Building footprints | Vector features | - | |
RESIDENTIAL | Residential filter (expression on buildings; empty: every building is a home) optional | Expression | - | |
HEIGHT_FIELD | Building height field (m) optional | Field | - | Field of BUILDINGS. |
LEVELS_FIELD | Building storeys field optional | Field | - | Field of BUILDINGS. |
POP_FIELD | Residents per building field (empty: zone population or 1 per home) optional | Field | - | Field of BUILDINGS. |
STOREY | Storey height (m) advanced | Number | 3.0 | Min 1. Max 10. |
DEFAULT_HEIGHT | Height of buildings without height or storeys (m) advanced | Number | 9.0 | Min 1. |
STREETS | Paths and streets optional | Vector features | - | |
PARKS | Green spaces | Vector features | - | |
KIND_FIELD | Green space kind field optional | Field | kind | Field of PARKS. |
KINDS | Qualifying kinds (comma separated; empty: all) optional | String | park,garden,nature_reserve,recreation_ground,village_green,common | |
ACCESS_FIELD | Access field (private/no excluded) optional | Field | access | Field of PARKS. |
ENTRANCES | Park entrances (optional) optional | Vector features | - | |
TREES | Tree points (optional) optional | Vector features | - | |
TREE_HEIGHT_FIELD | Tree height field (m) optional | Field | - | Field of TREES. |
ZONES | Neighbourhood zones (optional) optional | Vector features | - | |
ZONE_ID_FIELD | Zone id field optional | Field | - | Field of ZONES. |
ZONE_NAME_FIELD | Zone name field optional | Field | - | Field of ZONES. |
ZONE_POP_FIELD | Zone residents field optional | Field | - | Field of ZONES. |
SOURCE | Canopy source | Choice | Meta/WRI 1 m canopy height (online) | Options: Meta/WRI 1 m canopy height (online); ESA WorldCover 10 m (online); Sentinel-2 NDVI median (online); My raster: canopy height; My raster: 0/1 mask; My raster: NDVI. |
RASTER | My raster (for the 'My raster' sources) optional | Raster layer | - | |
DEM | Terrain model (optional) optional | Raster layer | - | |
EXTENT | Study area extent (empty: the extent of the buildings) optional | Extent | - | |
TREES_REQUIRED | Trees required | Number | 3 | Min 1. |
TARGET | Canopy target (percent) | Number | 30.0 | Min 0. Max 100. |
DISTANCE | Park distance threshold (m) | Number | 300.0 | Min 1. |
MODE | Counting mode | Choice | Line of sight | Options: Line of sight; Within the radius. |
RADIUS | View radius (m) | Number | 50.0 | Min 1. |
FLOOR | Viewpoint floor | Choice | Ground | Options: Ground; Middle; Top. |
NEIGHBOURHOOD | Neighbourhood | Choice | Zones | Options: Zones; Home buffer; Square grid. |
BUFFER | Buffer radius (m) | Number | 250.0 | Min 10. |
GRID_SIZE | Grid cell size (m) | Number | 500.0 | Min 50. |
DIST_MODE | Park distance | Choice | Network | Options: Network; Straight line. |
MIN_HA | Minimum park size (ha) | Number | 0.5 | Min 0. |
MIN_HEIGHT | Minimum canopy height (m) advanced | Number | 3.0 | Min 0. |
NDVI_THRESHOLD | NDVI threshold (empty: Otsu) optional advanced | Number | - | Min -1. Max 1. |
EYE_HEIGHT | Eye height above the floor (m) advanced | Number | 1.6 | Min 0. |
SPACING | Viewpoint spacing along facades (m) advanced | Number | 10.0 | Min 1. |
TREE_HEIGHT | Height of trees without a height (m) advanced | Number | 8.0 | Min 0.5. |
MIN_VALID | Minimum valid share of a unit advanced | Number | 0.5 | Min 0. Max 1. |
SNAP_MAX | Maximum snap distance to the network (m) advanced | Number | 100.0 | Min 1. |
MERGE_GAP | Merge parks closer than (m) advanced | Number | 5.0 | Min 0. |
D0 | Park supply catchment d0 (m) advanced | Number | 1000.0 | Min 50. |
CROWN_AREA | Crown area per planted tree (m2) advanced | Number | 50.0 | Min 1. |
EQUITY_FIELD | Equity variable (field on buildings or zones) optional | Field | - | Field of BUILDINGS. |
HIGHER_DEPRIVED | Higher equity values mean more deprived | Boolean | yes | |
VGVI | Compute visible greenness (VGVI) advanced | Boolean | no | |
FOLDER | Output folder (report, GeoPackage, CSV, canopy GeoTIFF) optional | Folder (output) | - | |
OUTPUT | 3-30-300 homes | Feature sink (output) | - | |
ZONES_OUT | 3-30-300 neighbourhoods | Feature sink (output) | - | |
TREES_OUT | Trees used | Feature sink (output) | - | |
PARKS_OUT | Qualifying parks | Feature sink (output) | - | |
ACCESS_OUT | Park access points | Feature sink (output) | - | |
REPORT | 3-30-300 report | Output HTML file | - | Returned in the result dictionary. |
SHARE_3 | Population share passing 3 | Output number | - | Returned in the result dictionary. |
SHARE_30 | Population share passing 30 | Output number | - | Returned in the result dictionary. |
SHARE_300 | Population share passing 300 | Output number | - | Returned in the result dictionary. |
SHARE_ALL | Population share passing all three | Output number | - | Returned in the result dictionary. |
Id: zero2greenrule:equity_indicators
Population-weighted inequality of the 3-30-300 results, read from the homes output of the full run (or of a layer with the same fields). Indicators: trees_vis, canopy_pct, access = 1 / (1 + d / D) with d the distance the run tested pass_300 on (network, or straight line for a straight-line run), and gri. For each: the Gini from the Lorenz curve, the Theil T split into between-zone and within-zone parts, and, with an equity variable, the concentration index ranked from most deprived to least deprived (C > 0: greenness is concentrated among the advantaged). Population quintiles of the equity variable give pass shares per part and the Q5 - Q1 gap.
G = 1 - sum (P_i - P_(i-1)) (L_i + L_(i-1)) (manual Eq. 11)
C = 2 cov_w(h, r) / mu_h (manual Eq. 12)
T = sum_g s_g T_g + sum_g s_g ln(mu_g / mu) (manual Eq. 13)
The equity variable is a field of the homes layer, or of a polygon layer (census areas, buildings) holding the homes. Zones for the Theil split are optional (one group without them).
| Parameter | Description | Type | Default | Notes |
|---|---|---|---|---|
HOMES | 3-30-300 homes | Vector features | - | |
POP_FIELD | Population weight field optional | Field | pop_w | Field of HOMES. |
EQUITY_FIELD | Equity variable on the homes optional | Field | - | Field of HOMES. |
EQUITY_LAYER | Polygons holding the equity variable (optional) optional | Vector features | - | |
EQUITY_LAYER_FIELD | Equity variable on the polygons optional | Field | - | Field of EQUITY_LAYER. |
HIGHER_DEPRIVED | Higher equity values mean more deprived | Boolean | yes | |
ZONES | Zones for the Theil split (optional) optional | Vector features | - | |
DISTANCE | Park distance threshold D (m) | Number | 300.0 | Min 1. |
OUTPUT | Equity indicators | Feature sink (output) | - | |
QUINTILES | Equity quintiles | Feature sink (output) | - | |
GINI_GRI | Gini of the Green Rule Index | Output number | - | Returned in the result dictionary. |
CONC_GRI | Concentration index of the Green Rule Index | Output number | - | Returned in the result dictionary. |
GAP_ALL | Q5 - Q1 difference of all three | Output number | - | Returned in the result dictionary. |
Id: zero2greenrule:neighbourhood_scorecard
One card per neighbourhood from the homes output of the full run: residents, homes, the population share passing each part and all three, mean visible trees, canopy percent, median park distance, a grade (A at least 80 percent of residents meet all three, B 60, C 40, D 20, else E; a plugin convention), homes beyond the distance threshold, the weakest part and, with a canopy mask, the planting need and the trees it takes.
P_u = max(0, C A_land - A_canopy), trees = ceil(P_u / a_crown) (manual Eq. 15)
Without a canopy mask the canopy percent is the population-weighted mean of the homes' canopy_pct and the planting need is NULL. Output fields: zone_id, name, population, homes, share_3, mean_trees, canopy_pct, share_30, share_300, median_d300, share_all, grade, planting_need_m2, trees_needed, homes_beyond_300, weakest.
| Parameter | Description | Type | Default | Notes |
|---|---|---|---|---|
HOMES | 3-30-300 homes | Vector features | - | |
POP_FIELD | Population weight field optional | Field | pop_w | Field of HOMES. |
ZONES | Neighbourhoods | Vector features | - | |
ZONE_ID_FIELD | Zone id field optional | Field | - | Field of ZONES. |
ZONE_NAME_FIELD | Zone name field optional | Field | - | Field of ZONES. |
CANOPY | Canopy mask (optional, from 'Canopy mask') optional | Raster layer | - | |
TARGET | Canopy target (percent) | Number | 30.0 | Min 0. Max 100. |
DISTANCE | Park distance threshold (m) | Number | 300.0 | Min 1. |
CROWN_AREA | Crown area per planted tree (m2) | Number | 50.0 | Min 1. |
MIN_VALID | Minimum valid share of a zone advanced | Number | 0.5 | Min 0. Max 1. |
OUTPUT | Neighbourhood scorecard | Feature sink (output) | - | |
SHARE_ALL | Population share meeting all three | Output number | - | Returned in the result dictionary. |
TREES_NEEDED | Trees needed in all zones | Output number | - | Returned in the result dictionary. |
| Field | Meaning |
|---|---|
home_id, bld_id | Home number (1..n) and the 0-based position of its building (negative for a home point outside every footprint). |
pop_w | Residents (population weight). |
trees_vis, trees_near, vgvi, pass_3 | Distinct trees visible, trees within , visible greenness (0..1, NULL unless computed), 3 part passed (1/0). |
canopy_pct, canopy_valid, pass_30 | Canopy percent of the neighbourhood, its valid share (0..1), 30 part passed. |
d300_net, d300_euc, detour, park_id, pass_300 | Network and straight-line distance (m), their ratio, nearest qualifying park, 300 part passed. |
score, all_three, gri, equity_q | Parts met (0..3), all three met, Green Rule Index (0..1), equity quintile (1 = most deprived). |
trees_short, d300_over | Gap to the thresholds: trees short of the 3 part and metres beyond the 300 part (NULL when unknown); a planting or park-access programme can start with the homes that miss by little. |
zone_id, name, population, homes, share_3, mean_trees, canopy_pct, share_30, share_300, median_d300, share_all, grade, planting_need_m2, trees_needed, homes_beyond_300, weakest. Shares are fractions 0..1, canopy_pct is a percentage.
Trees used (tree_id, height, source = inventory, osm, detected or canopy patch), qualifying parks (park_id, area_ha, kind, name, n_access), park access points (park_id, kind = entrance, edge, inside or fallback). The data attribution lines are written into every output layer's metadata.
An output folder holds greenrule.gpkg (tables homes, neighbourhoods, trees, parks, park_access), canopy_mask.tif (codes 0/1/254/255), homes.csv, neighbourhoods.csv and greenrule_report.html: a self-contained page (no network needed) with the summary, the cards, Lorenz and quintile charts, every equation of section 5 typeset with KaTeX, the parameters, the run log, the references and the data licences.
Load demo district (Area page) or core.demo.make_demo_district() builds a district in EPSG:32635 whose answers are known by construction. Streets run every 150 m (x 0 to 900 m, y 0 to 600 m) plus one isolated footway; a motorway crosses the grid diagonally and must be dropped by the pedestrian filter. Four blocks hold green spaces: two parks of 1.96 ha with entrances on the surrounding streets, a 0.2 ha garden (too small) and a private park. Every other block holds one 10 m x 10 m home of 9 m; one more home sits by the isolated footway. Home gets trees 15 m north of its facade in open view, a tree behind a 30 m wall when and a tree just beyond m when . The West zone has 40.0 percent canopy, the East zone 10.0 percent.
With the residential filter "resid" = 1, the residents field pop, the trees, the zones, the canopy mask, the entrances and the equity variable dep_idx (higher is more deprived), the full run gives:
| Measure | Study area | West | East |
|---|---|---|---|
| Homes / residents | 21 / 672 | 11 / 378 | 10 / 294 |
| Share passing 3 (residents) | 38.7 % | 39.4 % | 37.8 % |
| Canopy / share passing 30 | 25.0 % / 56.3 % | 40.0 % / 100 % | 10.0 % / 0 % |
| Share passing 300 / median distance | 35.1 % / 330 m | 30.6 % / 330 m | 40.5 % / 255 m |
| Share meeting all three / grade | 3.4 % / E | 6.1 % / E | 0 % / E |
| Planting need / trees needed | 36 000 m² / 720 | 0 / 0 | 72 000 m² / 1 440 |
| Weakest part | 300 | 300 | 30 |
Every home's visible trees equal its planted open-view trees (0 to 5): the walled tree is never seen, the far tree never counted; in radius mode the walled tree is counted, which is the difference the 3 page reports. The network distances are the planted grid distances (30 to 480 m); the isolated home is NULL, not a large number. The East planting need is , or 1 440 trees of 50 m². Equity: the Gini of visible trees is 0.473, of canopy percent 0.275; the concentration index of the Green Rule Index is 0.017; the canopy inequality lies entirely between the two zones (Theil within part 0), and the Q5 - Q1 gap of residents meeting all three is 12.9 percentage points.
The smoke tests of the plugin check these values: per-home results against the planted truth, zone canopy, hand-computed straight-line distances, an independent pairwise Gini and concentration index, translation invariance (+137 km, +211 km) and identical results through the dock, the core and Processing.
Overpass API (overpass-api.de) answers only requests with a User-Agent, which the plugin sends; keep fetches below about 16 km². Meta/WRI canopy height tiles are stripped GeoTIFFs: for areas taller than about 1 km the whole quadkey tile is downloaded to the cache once (its size is shown first). ESA WorldCover and Sentinel-2 are cloud-optimised and read by window.
Eminoğlu, Y. (2026). 02GreenRule - 3-30-300 Green Equity Lab (version 0.1.1) [QGIS plugin]. https://gitlab.com/geophilo1/zero2greenrule. https://doi.org/10.5281/zenodo.24263658. The DOI 10.5281/zenodo.24263658 always resolves to the latest version; version 0.1.1 has DOI https://doi.org/10.5281/zenodo.24263659.
Licence: GNU General Public License v2.0 or later. Source and issues: gitlab.com/geophilo1/zero2greenrule (tracker work items). Homepage: geophilo.com/zero2greenrule.