File tree Expand file tree Collapse file tree 1 file changed +23
-2
lines changed Expand file tree Collapse file tree 1 file changed +23
-2
lines changed Original file line number Diff line number Diff line change 1
- export function calculateStats ( geojson : any ) {
1
+ interface Stats {
2
+ tags : Record < string , number > ;
3
+ buildings : number ;
4
+ buildingsAdded : number ;
5
+ buildingsModified : number ;
6
+ buildingsDeleted : number ;
7
+ highways : number ;
8
+ highwaysAdded : number ;
9
+ highwaysModified : number ;
10
+ highwaysDeleted : number ;
11
+ other : number ;
12
+ otherAdded : number ;
13
+ otherModified : number ;
14
+ otherDeleted : number ;
15
+ users : Record < string , number > ;
16
+ }
17
+
18
+ export function calculateStats ( geojson : GeoJSON . FeatureCollection ) {
2
19
const stats = {
3
20
tags : { } ,
4
21
buildings : 0 ,
@@ -14,9 +31,13 @@ export function calculateStats(geojson: any) {
14
31
otherModified : 0 ,
15
32
otherDeleted : 0 ,
16
33
users : { } ,
17
- } ;
34
+ } as Stats ;
18
35
19
36
for ( const feature of geojson . features ) {
37
+ if ( ! feature . properties ) {
38
+ continue ;
39
+ }
40
+
20
41
const changeType = feature . properties . changeType ;
21
42
if (
22
43
changeType === "added" ||
You can’t perform that action at this time.
0 commit comments