From 566ae578bb1ecebec81a0642aecfd7831d4653d5 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Sat, 7 Apr 2012 17:55:41 -0700 Subject: [PATCH 1/3] scons: do not use -rdynamic flag on os x --- SConstruct | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/SConstruct b/SConstruct index 1ae2fe675..30930b7f8 100644 --- a/SConstruct +++ b/SConstruct @@ -1432,7 +1432,8 @@ if not preconfigured: # Add rdynamic to allow using statics between application and plugins # http://stackoverflow.com/questions/8623657/multiple-instances-of-singleton-across-shared-libraries-on-linux - env.MergeFlags('-rdynamic') + if env['PLATFORM'] != 'Darwin': + env.MergeFlags('-rdynamic') # Customizing the C++ compiler flags depending on: # (1) the C++ compiler used; and From 0015a68e196936ae6e5ab5d9963b610d31aaba00 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Sat, 7 Apr 2012 17:56:18 -0700 Subject: [PATCH 2/3] throw during zoom_all if a proj_init error is encountered --- src/map.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/map.cpp b/src/map.cpp index 5f908f402..aa22d1725 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -28,6 +28,7 @@ #include #include #include +#include #include // for PROJ_ENVELOPE_POINTS // boost @@ -444,7 +445,7 @@ void Map::zoom_all() } catch (proj_init_error & ex) { - mapnik::log() << "map: proj_init_error=" << ex.what(); + throw mapnik::config_error(std::string("Projection error during map.zoom_all: ") + ex.what()); } } } From 31303ff341d26f233272467e1cf16b92904447a0 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Sat, 7 Apr 2012 17:56:58 -0700 Subject: [PATCH 3/3] shape plugin: only add feature value if parsing is successful --- plugins/input/shape/dbfile.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/plugins/input/shape/dbfile.cpp b/plugins/input/shape/dbfile.cpp index 4af77c654..2161482f0 100644 --- a/plugins/input/shape/dbfile.cpp +++ b/plugins/input/shape/dbfile.cpp @@ -156,16 +156,18 @@ void dbf_file::add_attribute(int col, mapnik::transcoder const& tr, Feature & f) double val = 0.0; const char *itr = record_+fields_[col].offset_; const char *end = itr + fields_[col].length_; - qi::phrase_parse(itr,end,double_,ascii::space,val); - f.put(name,val); + bool r = qi::phrase_parse(itr,end,double_,ascii::space,val); + if (r && (itr == end)) + f.put(name,val); } else { int val = 0; const char *itr = record_+fields_[col].offset_; const char *end = itr + fields_[col].length_; - qi::phrase_parse(itr,end,int_,ascii::space,val); - f.put(name,val); + bool r = qi::phrase_parse(itr,end,int_,ascii::space,val); + if (r && (itr == end)) + f.put(name,val); } break; }