no need to catch image_reader_exception any more during load map because all errors are now at runtime due to path expressions
This commit is contained in:
parent
531a25bbb7
commit
f866ab1f80
1 changed files with 88 additions and 153 deletions
|
@ -27,7 +27,6 @@
|
||||||
|
|
||||||
#include <mapnik/xml_tree.hpp>
|
#include <mapnik/xml_tree.hpp>
|
||||||
#include <mapnik/version.hpp>
|
#include <mapnik/version.hpp>
|
||||||
#include <mapnik/image_reader.hpp>
|
|
||||||
#include <mapnik/image_compositing.hpp>
|
#include <mapnik/image_compositing.hpp>
|
||||||
#include <mapnik/color.hpp>
|
#include <mapnik/color.hpp>
|
||||||
#include <mapnik/color_factory.hpp>
|
#include <mapnik/color_factory.hpp>
|
||||||
|
@ -898,8 +897,6 @@ void map_parser::parse_point_symbolizer(rule & rule, xml_node const & sym)
|
||||||
symbol.set_point_placement(placement);
|
symbol.set_point_placement(placement);
|
||||||
|
|
||||||
if (file)
|
if (file)
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
{
|
||||||
if(base)
|
if(base)
|
||||||
{
|
{
|
||||||
|
@ -941,20 +938,6 @@ void map_parser::parse_point_symbolizer(rule & rule, xml_node const & sym)
|
||||||
symbol.set_image_transform(tl);
|
symbol.set_image_transform(tl);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (image_reader_exception const & ex)
|
|
||||||
{
|
|
||||||
std::string msg("Failed to load image file '" + * file +
|
|
||||||
"': " + ex.what());
|
|
||||||
if (strict_)
|
|
||||||
{
|
|
||||||
throw config_error(msg);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
MAPNIK_LOG_WARN(load_map) << "map_parser: " << msg;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
parse_symbolizer_base(symbol, sym);
|
parse_symbolizer_base(symbol, sym);
|
||||||
rule.append(symbol);
|
rule.append(symbol);
|
||||||
}
|
}
|
||||||
|
@ -1099,8 +1082,6 @@ void map_parser::parse_line_pattern_symbolizer(rule & rule, xml_node const & sym
|
||||||
std::string file = sym.get_attr<std::string>("file");
|
std::string file = sym.get_attr<std::string>("file");
|
||||||
optional<std::string> base = sym.get_opt_attr<std::string>("base");
|
optional<std::string> base = sym.get_opt_attr<std::string>("base");
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
if(base)
|
if(base)
|
||||||
{
|
{
|
||||||
std::map<std::string,std::string>::const_iterator itr = file_sources_.find(*base);
|
std::map<std::string,std::string>::const_iterator itr = file_sources_.find(*base);
|
||||||
|
@ -1121,20 +1102,6 @@ void map_parser::parse_line_pattern_symbolizer(rule & rule, xml_node const & sym
|
||||||
parse_symbolizer_base(symbol, sym);
|
parse_symbolizer_base(symbol, sym);
|
||||||
rule.append(symbol);
|
rule.append(symbol);
|
||||||
}
|
}
|
||||||
catch (image_reader_exception const & ex)
|
|
||||||
{
|
|
||||||
std::string msg("Failed to load image file '" + file +
|
|
||||||
"': " + ex.what());
|
|
||||||
if (strict_)
|
|
||||||
{
|
|
||||||
throw config_error(msg);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
MAPNIK_LOG_WARN(load_map) << "map_parser: " << msg;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (const config_error & ex)
|
catch (const config_error & ex)
|
||||||
{
|
{
|
||||||
ex.append_context("in LinePatternSymbolizer", sym);
|
ex.append_context("in LinePatternSymbolizer", sym);
|
||||||
|
@ -1150,8 +1117,6 @@ void map_parser::parse_polygon_pattern_symbolizer(rule & rule,
|
||||||
std::string file = sym.get_attr<std::string>("file");
|
std::string file = sym.get_attr<std::string>("file");
|
||||||
optional<std::string> base = sym.get_opt_attr<std::string>("base");
|
optional<std::string> base = sym.get_opt_attr<std::string>("base");
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
if(base)
|
if(base)
|
||||||
{
|
{
|
||||||
std::map<std::string,std::string>::iterator itr = file_sources_.find(*base);
|
std::map<std::string,std::string>::iterator itr = file_sources_.find(*base);
|
||||||
|
@ -1189,20 +1154,6 @@ void map_parser::parse_polygon_pattern_symbolizer(rule & rule,
|
||||||
parse_symbolizer_base(symbol, sym);
|
parse_symbolizer_base(symbol, sym);
|
||||||
rule.append(symbol);
|
rule.append(symbol);
|
||||||
}
|
}
|
||||||
catch (image_reader_exception const & ex)
|
|
||||||
{
|
|
||||||
std::string msg("Failed to load image file '" + file +
|
|
||||||
"': " + ex.what());
|
|
||||||
if (strict_)
|
|
||||||
{
|
|
||||||
throw config_error(msg);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
MAPNIK_LOG_WARN(load_map) << "map_parser: " << msg;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (const config_error & ex)
|
catch (const config_error & ex)
|
||||||
{
|
{
|
||||||
ex.append_context("in PolygonPatternSymbolizer", sym);
|
ex.append_context("in PolygonPatternSymbolizer", sym);
|
||||||
|
@ -1314,8 +1265,6 @@ void map_parser::parse_shield_symbolizer(rule & rule, xml_node const& sym)
|
||||||
std::string image_file = sym.get_attr<std::string>("file");
|
std::string image_file = sym.get_attr<std::string>("file");
|
||||||
optional<std::string> base = sym.get_opt_attr<std::string>("base");
|
optional<std::string> base = sym.get_opt_attr<std::string>("base");
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
if(base)
|
if(base)
|
||||||
{
|
{
|
||||||
std::map<std::string,std::string>::const_iterator itr = file_sources_.find(*base);
|
std::map<std::string,std::string>::const_iterator itr = file_sources_.find(*base);
|
||||||
|
@ -1332,20 +1281,6 @@ void map_parser::parse_shield_symbolizer(rule & rule, xml_node const& sym)
|
||||||
throw mapnik::config_error("Failed to parse path_expression '" + image_file + "'");
|
throw mapnik::config_error("Failed to parse path_expression '" + image_file + "'");
|
||||||
}
|
}
|
||||||
shield_symbol.set_filename(expr);
|
shield_symbol.set_filename(expr);
|
||||||
}
|
|
||||||
catch (image_reader_exception const & ex)
|
|
||||||
{
|
|
||||||
std::string msg("Failed to load image file '" + image_file +
|
|
||||||
"': " + ex.what());
|
|
||||||
if (strict_)
|
|
||||||
{
|
|
||||||
throw config_error(msg);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
MAPNIK_LOG_WARN(load_map) << "map_parser: " << msg;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
rule.append(shield_symbol);
|
rule.append(shield_symbol);
|
||||||
}
|
}
|
||||||
catch (const config_error & ex)
|
catch (const config_error & ex)
|
||||||
|
|
Loading…
Reference in a new issue