1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
pub struct PolygonFeature {
    pub key: &'static str,
    pub polygon: &'static str,
    pub values: Vec<&'static str>,
}

impl PolygonFeature {
    fn new(
        key: &'static str,
        polygon: &'static str,
        values: Option<Vec<&'static str>>,
    ) -> PolygonFeature {
        let mut parsed_values = vec![];
        if values.is_some() {
            parsed_values = values.unwrap()
        };

        return PolygonFeature {
            key: key,
            polygon: polygon,
            values: parsed_values,
        };
    }
}

pub fn get_polygon_features() -> Vec<PolygonFeature> {
    return vec![
        PolygonFeature::new("building", "all", None),
        PolygonFeature::new(
            "highway",
            "whitelist",
            Some(vec!["services", "rest_area", "escape", "elevator"]),
        ),
        PolygonFeature::new(
            "natural",
            "blacklist",
            Some(vec!["coastline", "cliff", "ridge", "arete", "tree_row"]),
        ),
        PolygonFeature::new("landuse", "all", None),
        PolygonFeature::new(
            "waterway",
            "whitelist",
            Some(vec!["riverbank", "dock", "boatyard", "dam"]),
        ),
        PolygonFeature::new("amenity", "all", None),
        PolygonFeature::new("leisure", "all", None),
        PolygonFeature::new(
            "barrier",
            "whitelist",
            Some(vec![
                "city_wall",
                "ditch",
                "hedge",
                "retaining_wall",
                "wall",
                "spikes",
            ]),
        ),
        PolygonFeature::new(
            "railway",
            "whitelist",
            Some(vec!["station", "turntable", "roundhouse", "platform"]),
        ),
        PolygonFeature::new("area", "all", None),
        PolygonFeature::new("boundary", "all", None),
        PolygonFeature::new(
            "man_made",
            "blacklist",
            Some(vec!["cutline", "embankment", "pipeline"]),
        ),
        PolygonFeature::new(
            "power",
            "whitelist",
            Some(vec!["plant", "substation", "generator", "transformer"]),
        ),
        PolygonFeature::new("place", "all", None),
        PolygonFeature::new("shop", "all", None),
        PolygonFeature::new("aeroway", "blacklist", Some(vec!["taxiway"])),
        PolygonFeature::new("tourism", "all", None),
        PolygonFeature::new("historic", "all", None),
        PolygonFeature::new("public_transport", "all", None),
        PolygonFeature::new("office", "all", None),
        PolygonFeature::new("building:part", "all", None),
        PolygonFeature::new("military", "all", None),
        PolygonFeature::new("ruins", "all", None),
        PolygonFeature::new("area:highway", "all", None),
        PolygonFeature::new("craft", "all", None),
        PolygonFeature::new("golf", "all", None),
        PolygonFeature::new("indoor", "all", None),
    ];
}