From 4c46385bf6867004ea86c9795fbbece34cc746d8 Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Thu, 26 Jan 2012 17:40:02 -0500 Subject: [PATCH] Work around non-numeric input --- src/memory_datasource.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/memory_datasource.cpp b/src/memory_datasource.cpp index 11889fe63..a738ee683 100644 --- a/src/memory_datasource.cpp +++ b/src/memory_datasource.cpp @@ -72,7 +72,11 @@ void memory_datasource::push(feature_ptr feature) std::map::const_iterator it = fprops.begin(); std::map::const_iterator end = fprops.end(); for (; it != end; ++it) { - accumulators_[it->first](it->second.to_double()); + try { + accumulators_[it->first](it->second.to_double()); + } catch(boost::bad_lexical_cast &) { + // string values are not accumulated. + } } features_.push_back(feature); }