@@ -23,25 +23,25 @@ static const struct
2323{
2424 int offset;
2525 char const *highway;
26- int roads;
27- } layers[] = {{1 , " proposed" , 0 }, {2 , " construction" , 0 },
28- {10 , " steps" , 0 }, {10 , " cycleway" , 0 },
29- {10 , " bridleway" , 0 }, {10 , " footway" , 0 },
30- {10 , " path" , 0 }, {11 , " track" , 0 },
31- {15 , " service" , 0 },
32-
33- {24 , " tertiary_link" , 0 }, {25 , " secondary_link" , 1 },
34- {27 , " primary_link" , 1 }, {28 , " trunk_link" , 1 },
35- {29 , " motorway_link" , 1 },
36-
37- {30 , " raceway" , 0 }, {31 , " pedestrian" , 0 },
38- {32 , " living_street" , 0 }, {33 , " road" , 0 },
39- {33 , " unclassified" , 0 }, {33 , " residential" , 0 },
40- {34 , " tertiary" , 0 }, {36 , " secondary" , 1 },
41- {37 , " primary" , 1 }, {38 , " trunk" , 1 },
42- {39 , " motorway" , 1 }};
43-
44- void add_z_order (taglist_t &tags, int *roads)
26+ bool roads;
27+ } layers[] = {{1 , " proposed" , false }, {2 , " construction" , false },
28+ {10 , " steps" , false }, {10 , " cycleway" , false },
29+ {10 , " bridleway" , false }, {10 , " footway" , false },
30+ {10 , " path" , false }, {11 , " track" , false },
31+ {15 , " service" , false },
32+
33+ {24 , " tertiary_link" , false }, {25 , " secondary_link" , true },
34+ {27 , " primary_link" , true }, {28 , " trunk_link" , true },
35+ {29 , " motorway_link" , true },
36+
37+ {30 , " raceway" , false }, {31 , " pedestrian" , false },
38+ {32 , " living_street" , false }, {33 , " road" , false },
39+ {33 , " unclassified" , false }, {33 , " residential" , false },
40+ {34 , " tertiary" , false }, {36 , " secondary" , true },
41+ {37 , " primary" , true }, {38 , " trunk" , true },
42+ {39 , " motorway" , true }};
43+
44+ void add_z_order (taglist_t &tags, bool *roads)
4545{
4646 std::string const *const layer = tags.get (" layer" );
4747 std::string const *const highway = tags.get (" highway" );
@@ -54,7 +54,7 @@ void add_z_order(taglist_t &tags, int *roads)
5454
5555 int l = layer ? (int )strtol (layer->c_str (), nullptr , 10 ) : 0 ;
5656 z_order = 100 * l;
57- *roads = 0 ;
57+ *roads = false ;
5858
5959 if (highway) {
6060 for (const auto &layer : layers) {
@@ -68,11 +68,11 @@ void add_z_order(taglist_t &tags, int *roads)
6868
6969 if (railway && !railway->empty ()) {
7070 z_order += 35 ;
71- *roads = 1 ;
71+ *roads = true ;
7272 }
7373 /* Administrative boundaries are rendered at low zooms so we prefer to use the roads table */
7474 if (boundary && *boundary == " administrative" ) {
75- *roads = 1 ;
75+ *roads = true ;
7676 }
7777
7878 if (bridge) {
@@ -145,8 +145,8 @@ bool c_tagtransform_t::check_key(std::vector<taginfo> const &infos,
145145 return false ;
146146}
147147
148- bool c_tagtransform_t::filter_tags (osmium::OSMObject const &o, int *polygon,
149- int *roads, taglist_t &out_tags)
148+ bool c_tagtransform_t::filter_tags (osmium::OSMObject const &o, bool *polygon,
149+ bool *roads, taglist_t &out_tags)
150150{
151151 // assume we dont like this set of tags
152152 bool filter = true ;
@@ -196,7 +196,7 @@ bool c_tagtransform_t::filter_tags(osmium::OSMObject const &o, int *polygon,
196196 if (add_area_tag) {
197197 /* If we need to force this as a polygon, append an area tag */
198198 out_tags.add_tag_if_not_exists (" area" , " yes" );
199- *polygon = 1 ;
199+ *polygon = true ;
200200 } else {
201201 auto const *area = o.tags ()[" area" ];
202202 if (area) {
@@ -216,7 +216,7 @@ bool c_tagtransform_t::filter_tags(osmium::OSMObject const &o, int *polygon,
216216
217217bool c_tagtransform_t::filter_rel_member_tags (
218218 taglist_t const &rel_tags, osmium::memory::Buffer const &,
219- rolelist_t const &, int *make_boundary, int *make_polygon, int *roads,
219+ rolelist_t const &, bool *make_boundary, bool *make_polygon, bool *roads,
220220 taglist_t &out_tags)
221221{
222222 std::string const *type = rel_tags.get (" type" );
@@ -323,12 +323,12 @@ bool c_tagtransform_t::filter_rel_member_tags(
323323 - Linear features will end up in the line and roads tables (useful for admin boundaries)
324324 - Polygon features also go into the polygon table (useful for national_forests)
325325 The edges of the polygon also get treated as linear fetaures allowing these to be rendered seperately. */
326- *make_boundary = 1 ;
326+ *make_boundary = true ;
327327 } else if (is_multipolygon && out_tags.contains (" boundary" )) {
328328 /* Treat type=multipolygon exactly like type=boundary if it has a boundary tag. */
329- *make_boundary = 1 ;
329+ *make_boundary = true ;
330330 } else if (is_multipolygon) {
331- *make_polygon = 1 ;
331+ *make_polygon = true ;
332332 }
333333
334334 add_z_order (out_tags, roads);
0 commit comments