File tree Expand file tree Collapse file tree 7 files changed +78
-1
lines changed
reports/multilevel_currentness Expand file tree Collapse file tree 7 files changed +78
-1
lines changed Original file line number Diff line number Diff line change 10
10
### New Features
11
11
12
12
- Improve Currentness indicator ([ #274 ] )
13
+ - Add new report ` MultilevelCurrentness ` ([ #403 ] )
13
14
14
15
[ #274 ] : https://github.com/GIScience/ohsome-quality-analyst/pull/274
16
+ [ #403 ] : https://github.com/GIScience/ohsome-quality-analyst/pull/403
15
17
[ #416 ] : https://github.com/GIScience/ohsome-quality-analyst/pull/416
16
18
17
19
82
84
[ #397 ] : https://github.com/GIScience/ohsome-quality-analyst/pull/397
83
85
[ #410 ] : https://github.com/GIScience/ohsome-quality-analyst/pull/410
84
86
85
-
86
87
## 0.10.1
87
88
88
89
### New Features
Original file line number Diff line number Diff line change @@ -107,6 +107,7 @@ <h3>2. Choose data quality report.</h3>
107
107
< option value ="BuildingReport "> Building Report</ option >
108
108
< option value ="RoadReport "> Road Report</ option >
109
109
< option value ="MultilevelMappingSaturation "> Multilevel Mapping Saturation</ option >
110
+ < option value ="MultilevelCurrentness "> Multilevel Currentness</ option >
110
111
</ select >
111
112
</ div >
112
113
</ div >
Original file line number Diff line number Diff line change @@ -97,6 +97,9 @@ class RasterDataset:
97
97
("Currentness" , "mapaction_rail_length" ),
98
98
("Currentness" , "mapaction_lakes_count" ),
99
99
("Currentness" , "mapaction_rivers_length" ),
100
+ ("Currentness" , "ideal_vgi_infrastructure" ),
101
+ ("Currentness" , "poi" ),
102
+ ("Currentness" , "lulc" ),
100
103
("PoiDensity" , "poi" ),
101
104
("TagsRatio" , "building_count" ),
102
105
("TagsRatio" , "major_roads_length" ),
Original file line number Diff line number Diff line change
1
+ ---
2
+ MultilevelCurrentness :
3
+ name : Multilevel Currentness
4
+ description : |
5
+ This report shows the currentness of four major map features (https://wiki.openstreetmap.org/wiki/Map_features):
6
+ buildings, land-use and land-cover, points of interest and infrastructure.
7
+ label_description :
8
+ red : |
9
+ The general currentness for major map features in this region is low indicating that most of the major map features have not been updated for many years.
10
+ yellow : |
11
+ The currentness of major map features in this region is mediocre. The results for each indicator should be reviewed
12
+ to determine the suitability of this region.
13
+ green : |
14
+ Most of the major map features were edited in recent years. This indicates a high currentness in this region.
15
+ undefined : |
16
+ The quality level could not be calculated.
Original file line number Diff line number Diff line change
1
+ from ohsome_quality_analyst .base .report import BaseReport , IndicatorLayer
2
+ from ohsome_quality_analyst .definitions import get_attribution
3
+
4
+
5
+ class MultilevelCurrentness (BaseReport ):
6
+ def set_indicator_layer (self ):
7
+ self .indicator_layer = (
8
+ IndicatorLayer ("Currentness" , "ideal_vgi_infrastructure" ),
9
+ IndicatorLayer ("Currentness" , "poi" ),
10
+ IndicatorLayer ("Currentness" , "lulc" ),
11
+ IndicatorLayer ("Currentness" , "building_count" ),
12
+ )
13
+
14
+ def combine_indicators (self ) -> None :
15
+ super ().combine_indicators ()
16
+
17
+ @classmethod
18
+ def attribution (cls ) -> str :
19
+ return get_attribution (["OSM" ])
Original file line number Diff line number Diff line change
1
+ import unittest
2
+ from unittest .mock import Mock
3
+
4
+ from ohsome_quality_analyst .reports .multilevel_currentness .report import (
5
+ MultilevelCurrentness ,
6
+ )
7
+
8
+ from .utils import get_geojson_fixture
9
+
10
+
11
+ class TestReportMultilevelCurrentness (unittest .TestCase ):
12
+ # TODO: Test case for indicator.result undefined
13
+ def test_combine_indicators_mean (self ):
14
+
15
+ geometry = get_geojson_fixture ("heidelberg-altstadt-geometry.geojson" )
16
+ report = MultilevelCurrentness (geometry )
17
+ report .set_indicator_layer ()
18
+
19
+ # Mock indicator objects with a fixed result value
20
+ for _ in report .indicator_layer :
21
+ indicator = Mock ()
22
+ indicator .result = Mock ()
23
+ indicator .result .value = 0.5
24
+ indicator .result .html = "foo"
25
+ report .indicators .append (indicator )
26
+
27
+ report .combine_indicators ()
28
+ report .create_html ()
29
+
30
+ self .assertIsNotNone (report .result .label )
31
+ self .assertIsNotNone (report .result .description )
32
+ self .assertIsNotNone (report .result .html )
33
+ self .assertEqual (report .result .value , 0.5 )
34
+
35
+
36
+ if __name__ == "__main__" :
37
+ unittest .main ()
You can’t perform that action at this time.
0 commit comments