diff --git a/plugins/input/osm/osm.cpp b/plugins/input/osm/osm.cpp index 0525024ff..3b911322a 100644 --- a/plugins/input/osm/osm.cpp +++ b/plugins/input/osm/osm.cpp @@ -251,15 +251,10 @@ bounds osm_way::get_bounds() bool osm_way::is_polygon() { - if (keyvals.find("building") != keyvals.end()) - { - return true; - } - for (unsigned int count = 0; count < ptypes.ptypes.size(); ++count) { if (keyvals.find(ptypes.ptypes[count].first) != keyvals.end() && - keyvals[ptypes.ptypes[count].first] == ptypes.ptypes[count].second) + (ptypes.ptypes[count].second.empty() || keyvals[ptypes.ptypes[count].first] == ptypes.ptypes[count].second)) { return true; } diff --git a/plugins/input/osm/osm.h b/plugins/input/osm/osm.h index 8efd99d27..d64cce469 100644 --- a/plugins/input/osm/osm.h +++ b/plugins/input/osm/osm.h @@ -49,6 +49,9 @@ public: polygon_types() { + ptypes.push_back(std::pair("water", "")); + ptypes.push_back(std::pair("aeroway", "")); + ptypes.push_back(std::pair("building", "")); ptypes.push_back(std::pair("natural", "wood")); ptypes.push_back(std::pair("natural", "water")); ptypes.push_back(std::pair("natural", "heath")); diff --git a/plugins/input/osm/osmparser.cpp b/plugins/input/osm/osmparser.cpp index f2b39cf51..d92ae54fd 100644 --- a/plugins/input/osm/osmparser.cpp +++ b/plugins/input/osm/osmparser.cpp @@ -66,6 +66,8 @@ void osmparser::startElement(xmlTextReaderPtr reader, const xmlChar *name) assert(xid); way->id = atol((char*)xid); cur_item = way; + // Prevent ways with no name being assigned a name of "true" + cur_item->keyvals["name"] = ""; xmlFree(xid); } else if (xmlStrEqual(name,BAD_CAST "nd")) diff --git a/tests/visual_tests/grids/line-offset-900-reference.json b/tests/visual_tests/grids/line-offset-900-reference.json index 485f0692d..258e146c0 100644 --- a/tests/visual_tests/grids/line-offset-900-reference.json +++ b/tests/visual_tests/grids/line-offset-900-reference.json @@ -1 +1 @@ -{"keys": ["", "-350", "-400", "-302", "-461", "-115", "-117", "-112", "-118"], "data": {}, "grid": [" ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " !! ## ", " !! !!!!!!!!!! ! ## ####### # ", " !!!!!!!! !!!!!!!!!!!!! ####### ############# ", " !!!!!!!! !!!!!!!!!!!!!! ######### ############## ", " $$$$ !! !!!!!!!!!!!!!!!!!!! !!!!!!! ## ####### ######## ## ####### %%%%%% ", " $$ $$ $$$$$$ !!!!!! !! ! !!!!!! ###### ## ## ##### %% %%% %%% ", " $$ $$$$$$$$$$$$ $$ !!!!!!!! !!!!!! ##### # ####### %% %%%%%%%%%%% % %% ", " $ $$$$$$$$$$$$$$$$$$$$ $$ !!!! ! !!! ###### #### % %%%%%%%%%% %%%%%%%%%%%% ", " $ $$$$$$$$$$$$$$$$$$ $$$ $ !!!!! ! ! ###### # # % %%%%%%%%%% %%%%%%%%%%%% % ", " $ $$$$$$$$ $$$$$$$$$$ $ !!!!!! ! !! ##### # # %%%%%% %%%%%%%% % ", " $ $$$$ $ $$$$$$$$ !!!!! !!!!! ##### ##### %% %%%%% % ", " $$$$$ $$$$$ $ !!! !!!!! #### ##### % %%%% % ", " $ $$$$ $$$ $ ! ! !!! # #### % %%%% % ", " $$$$$ $$$$$ !!!! ##### %%% %%% % ", " $$$$$ $$$ ! &&&& & & !!!!! ' ##### %%%% %%%%% ", " $$$$ (((( ((( ((( $$$$ &&&&& &&&& &&&&&&&&& !!!!! # '''''' '''''''' #### %%%% )))))) ))))) )) %%%%% ", " $ $$ (((((((((((((((((((((((((((((( !!!! &&&&&&&&&&&&&& !!! # ## '''''''''''''''' # %%%% )))))))))))))))))))))))))) ", " $ (((((((( (((( $$$$$ !!!! && && & ! !!! #### ''''''''' ' ' # ### %%%% ))))))))))) )) %%%%% ", " $ $$$$$ !!!! !!! #### # ### %%%% %%% % ", " $$$ $ !!! ! ! !!! ### # #### %%%%% %%% ", " $ $$ $$$ !!!! !!!! #### ##### %%%%% %%%%% ", " $ $$$ $$$ $ !!! ! !!!!! ### # # #### % %%%%% %%% %% ", " $ $$$$ $$$$$$$ !!!! ! !!!!!! #### # ###### %%% %%% %%%%%%% % ", " $$$$$$$$$ $ $$$$$$$$$$ !!!! ! !!!!!! #### # ###### % %%%%%%%%%% %%%%%%%%%% ", " $$$$$$$$$$$$$$$$$$$$$$$$$ $ !!!!! ! ! !!!! ##### # ## #### % %%%%%%%%%%%%%%%% %%%%% % ", " $ $$$$$$ $$$$$$$$$$$$$$ !!!!!! ! ! !! ### ### # ## ## %%%%%% %%%%%%%%%% %%% % ", " $$$$$$ $$$$$$$$$$$$ !!!!! ! !! !!!!! !!! !!! ##### ## # ## ## ## %%%%%%%%%%%%%% %% ", " $$$ $$$ !!!!!!!! !!!!!!!!!!! !!!! ######## ########## #### %%%%% %%%%%% ", " !!!!! !!! !!!!!!!!!!!!!! ###### ### ############## %%%%%% ", " !!! !!!!!!!!!! !!!!!! ### ########## ####### ", " !!!!!!!!!! !!!! ########## ##### ", " !!!!!!!!! ######### ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " "]} \ No newline at end of file +{"keys": ["", "-350", "-400", "-461", "-302", "-115", "-117", "-112", "-118"], "data": {}, "grid": [" ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " !! ## ", " !! !!!!!!!!!! ! ## ####### # ", " !!!!!!!! !!!!!!!!!!!!! ####### ############# ", " !!!!!!!! !!!!!!!!!!!!!! ######### ############## ", " !! !!!!!!!!!!!!!!!!!!! !!!!!!! ## ####### ######## ## ####### $$$$$$ ", " %% %% %%% !!!!!! !! ! !!!!!! ###### ## ## ##### $$ $$$ $$$ ", " %% %%%%%%%% %% !!!!!!!! !!!!!! ##### # ####### $$ $$$$$$$$$$$ $ $$ ", " % %%%%%%%%%%%%%%%%%%%% %% !!!! ! !!! ###### #### $ $$$$$$$$$$ $$$$$$$$$$$$ ", " % %%%%%%%%%%%%%%%%%% %%% % !!!!! ! ! ###### # # $ $$$$$$$$$$ $$$$$$$$$$$$ $ ", " % %%%%%%%% %%%%%%%%%% % !!!!!! ! !! ##### # # $$$$$$ $$$$$$$$ $ ", " % %%%% % %%%%%%%% !!!!! !!!!! ##### ##### $$ $$$$$ $ ", " %%%%% %%%%% % !!! !!!!! #### ##### $ $$$$ $ ", " % %%%% %%% % ! ! !!! # #### $ $$$$ $ ", " %%%%% %%%%% !!!! ##### $$$ $$$ $ ", " %%%%% %%% ! &&&& & & !!!!! ' ##### $$$$ $$$$$ ", " %%%% (((( ((( ((( %%%% &&&&& &&&& &&&&&&&&& !!!!! # '''''' '''''''' #### $$$$ )))))) ))))) )) $$$$$ ", " % %% (((((((((((((((((((((((((((((( !!!! &&&&&&&&&&&&&& !!! # ## '''''''''''''''' # $$$$ )))))))))))))))))))))))))) ", " % (((((((( (((( %%%%% !!!! && && & ! !!! #### ''''''''' ' ' # ### $$$$ ))))))))))) )) $$$$$ ", " % %%%%% !!!! !!! #### # ### $$$$ $$$ $ ", " %%% % !!! ! ! !!! ### # #### $$$$$ $$$ ", " % %% %%% !!!! !!!! #### ##### $$$$$ $$$$$ ", " % %%% %%% % !!! ! !!!!! ### # # #### $ $$$$$ $$$ $$ ", " % %%%% %%%%%%% !!!! ! !!!!!! #### # ###### $$$ $$$ $$$$$$$ $ ", " %%%%%%%%% % %%%%%%%%%% !!!! ! !!!!!! #### # ###### $ $$$$$$$$$$ $$$$$$$$$$ ", " %%%%%%%%%%%%%%%%%%%%%%%%% % !!!!! ! ! !!!! ##### # ## #### $ $$$$$$$$$$$$$$$$ $$$$$ $ ", " % %%%%%% %%%%%%%%%%%%%% !!!!!! ! ! !! ### ### # ## ## $$$$$$ $$$$$$$$$$ $$$ $ ", " %%%%%% %%%%%%%%%%%% !!!!! ! !! !!! !!! ##### ## ## ## $$$$$$$$$$$$$$ $$ ", " %%% %%% !!!!!!!! !!!!!!! !! !!!! ######## ######### #### $$$$$ $$$$$ ", " !!!!! !!! !!!!!!!!! ###### ### ######### ", " !!! !!!!!!!!!! !!!!!! ### ########## ####### ", " !!!!!!!!!! !!!! ########## ##### ", " !!!!!!!!! ######### ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " "]} \ No newline at end of file