From 9d7d024cf40b8e5cc2c59bf99525cbeadf51d3b5 Mon Sep 17 00:00:00 2001 From: artemp Date: Thu, 21 Nov 2013 10:06:12 +0000 Subject: [PATCH] geojson parser : add phoenix v2 not_empty implementation --- .../json/geometry_generator_grammar.hpp | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/include/mapnik/json/geometry_generator_grammar.hpp b/include/mapnik/json/geometry_generator_grammar.hpp index 06aeab9ed..c9f3f72b3 100644 --- a/include/mapnik/json/geometry_generator_grammar.hpp +++ b/include/mapnik/json/geometry_generator_grammar.hpp @@ -177,6 +177,27 @@ struct multi_geometry_type return std::tuple(type, collection); } }; + + +struct not_empty +{ + template + struct result { typedef bool type; }; + + bool operator() (geometry_container const& cont) const + { + geometry_container::const_iterator itr = cont.begin(); + geometry_container::const_iterator end = cont.end(); + + for (; itr!=end; ++itr) + { + if (itr->size() > 0) return true; + } + return false; + } +}; + + #endif