diff --git a/Makefile b/Makefile index c4e07e68c..de9564ebb 100755 --- a/Makefile +++ b/Makefile @@ -14,10 +14,10 @@ endif all: mapnik install: - @python scons/scons.py -j$(JOBS) --config=cache --implicit-cache --max-drift=1 install + python scons/scons.py -j$(JOBS) --config=cache --implicit-cache --max-drift=1 install mapnik: - @python scons/scons.py -j$(JOBS) --config=cache --implicit-cache --max-drift=1 + python scons/scons.py -j$(JOBS) --config=cache --implicit-cache --max-drift=1 clean: @python scons/scons.py -j$(JOBS) -c --config=cache --implicit-cache --max-drift=1 diff --git a/SConstruct b/SConstruct index 31807d71b..4a4f0d9d5 100644 --- a/SConstruct +++ b/SConstruct @@ -400,6 +400,7 @@ opts.AddVariables( BoolVariable('PGSQL2SQLITE', 'Compile and install a utility to convert postgres tables to sqlite', 'False'), BoolVariable('SHAPEINDEX', 'Compile and install a utility to generate shapefile indexes in the custom format (.index) Mapnik supports', 'True'), BoolVariable('SVG2PNG', 'Compile and install a utility to generate render an svg file to a png on the command line', 'False'), + BoolVariable('NIK2IMG', 'Compile and install a utility to generate render a map to an image', 'True'), BoolVariable('COLOR_PRINT', 'Print build status information in color', 'True'), BoolVariable('SAMPLE_INPUT_PLUGINS', 'Compile and install sample plugins', 'False'), BoolVariable('BIGINT', 'Compile support for 64-bit integers in mapnik::value', 'True'), @@ -767,16 +768,20 @@ def FindBoost(context, prefixes, thread_flag): if BOOST_LIB_DIR: msg += '\nFound boost libs: %s' % BOOST_LIB_DIR env['BOOST_LIBS'] = BOOST_LIB_DIR - else: + elif not env['BOOST_LIBS']: env['BOOST_LIBS'] = '/usr/' + env['LIBDIR_SCHEMA'] msg += '\nUsing default boost lib dir: %s' % env['BOOST_LIBS'] + else: + msg += '\nUsing boost lib dir: %s' % env['BOOST_LIBS'] if BOOST_INCLUDE_DIR: msg += '\nFound boost headers: %s' % BOOST_INCLUDE_DIR env['BOOST_INCLUDES'] = BOOST_INCLUDE_DIR - else: + elif not env['BOOST_INCLUDES']: env['BOOST_INCLUDES'] = '/usr/include' msg += '\nUsing default boost include dir: %s' % env['BOOST_INCLUDES'] + else: + msg += '\nUsing boost include dir: %s' % env['BOOST_INCLUDES'] if not env['BOOST_TOOLKIT'] and not env['BOOST_ABI'] and not env['BOOST_VERSION']: if BOOST_APPEND: @@ -1975,6 +1980,8 @@ if not HELP_REQUESTED: SConscript('utils/pgsql2sqlite/build.py') if env['SVG2PNG']: SConscript('utils/svg2png/build.py') + if env['NIK2IMG']: + SConscript('utils/nik2img/build.py') # devtools not ready for public #SConscript('utils/ogrindex/build.py') env['LIBS'].remove('boost_program_options%s' % env['BOOST_APPEND']) diff --git a/benchmark/run b/benchmark/run index a909710ca..c4b0deb40 100755 --- a/benchmark/run +++ b/benchmark/run @@ -10,6 +10,7 @@ function run { ${BASE}/$1 --threads $2 --iterations $(expr $3 / $2); } +run test_array_allocation 20 100000 run test_png_encoding1 10 1000 run test_png_encoding2 10 50 run test_to_string1 10 100000 diff --git a/benchmark/test_array_allocation.cpp b/benchmark/test_array_allocation.cpp new file mode 100644 index 000000000..c87630466 --- /dev/null +++ b/benchmark/test_array_allocation.cpp @@ -0,0 +1,310 @@ +#include "bench_framework.hpp" +#include +#include +#include +#include +#include + +// http://stackoverflow.com/questions/17347254/why-is-allocation-and-deallocation-of-stdvector-slower-than-dynamic-array-on-m + +#define FULL_ZERO_CHECK + +inline void ensure_zero(uint8_t * data, uint32_t size) { +#ifdef FULL_ZERO_CHECK + for (std::size_t i=0;i array_; + test1(mapnik::parameters const& params) + : test_case(params), + size_(*params.get("size",256*256)), + array_(size_,0) { } + bool validate() const + { + return true; + } + void operator()() const + { + for (std::size_t i=0;i array_; + test1b(mapnik::parameters const& params) + : test_case(params), + size_(*params.get("size",256*256)), + array_(size_,0) { } + bool validate() const + { + return true; + } + void operator()() const + { + for (std::size_t i=0;i array_; + test2(mapnik::parameters const& params) + : test_case(params), + size_(*params.get("size",256*256)), + array_(size_,0) { } + bool validate() const + { + return true; + } + void operator()() const + { + for (std::size_t i=0;i(::operator new(sizeof(uint8_t)*size_)); + memcpy(data, &array_[0], size_); + ensure_zero(data,size_); + ::operator delete(data),data=0; + } + } +}; + +class test3 : public benchmark::test_case +{ +public: + uint32_t size_; + std::vector array_; + test3(mapnik::parameters const& params) + : test_case(params), + size_(*params.get("size",256*256)), + array_(size_,0) { } + bool validate() const + { + return true; + } + void operator()() const + { + for (std::size_t i=0;i data(size_); + ensure_zero(&data[0],data.size()); + } + } +}; + + +class test3b : public benchmark::test_case +{ +public: + uint32_t size_; + std::vector array_; + test3b(mapnik::parameters const& params) + : test_case(params), + size_(*params.get("size",256*256)), + array_(size_,0) { } + bool validate() const + { + return true; + } + void operator()() const + { + for (std::size_t i=0;i data(0); + data.resize(size_,0); + ensure_zero(&data[0],data.size()); + } + } +}; + + +class test3c : public benchmark::test_case +{ +public: + uint32_t size_; + std::vector array_; + test3c(mapnik::parameters const& params) + : test_case(params), + size_(*params.get("size",256*256)), + array_(size_,0) { } + bool validate() const + { + return true; + } + void operator()() const + { + for (std::size_t i=0;i data(0); + data.assign(size_,0); + ensure_zero(&data[0],data.size()); + } + } +}; + +class test4 : public benchmark::test_case +{ +public: + uint32_t size_; + std::vector array_; + test4(mapnik::parameters const& params) + : test_case(params), + size_(*params.get("size",256*256)), + array_(size_,0) { } + bool validate() const + { + return true; + } + void operator()() const + { + for (std::size_t i=0;i array_; + test5(mapnik::parameters const& params) + : test_case(params), + size_(*params.get("size",256*256)), + array_(size_,0) { } + bool validate() const + { + return true; + } + void operator()() const + { + for (std::size_t i=0;i array_; + test5b(mapnik::parameters const& params) + : test_case(params), + size_(*params.get("size",256*256)), + array_(size_,0) { } + bool validate() const + { + return true; + } + void operator()() const + { + for (std::size_t i=0;i +// http://isocpp.org/blog/2013/04/trip-report-iso-c-spring-2013-meeting +// http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20130909/088700.html +// http://stackoverflow.com/questions/17303902/any-alternative-to-stddynarray-presently-available + +class test6 : public benchmark::test_case +{ +public: + uint32_t size_; + std::vector array_; + test6(mapnik::parameters const& params) + : test_case(params), + size_(*params.get("size",256*256)), + array_(size_,0) { } + bool validate() const + { + return true; + } + void operator()() const + { + for (std::size_t i=0;i data(size_,0); + ensure_zero(&data[0],size_); + } + } +}; + +int main(int argc, char** argv) +{ + mapnik::parameters params; + benchmark::handle_args(argc,argv,params); + { + test4 test_runner4(params); + run(test_runner4,"calloc"); + } + { + test1 test_runner(params); + run(test_runner,"malloc/memcpy"); + } + { + test1b test_runner(params); + run(test_runner,"malloc/memset"); + + } + { + test2 test_runner(params); + run(test_runner,"new"); + } + { + test3 test_runner(params); + run(test_runner,"vector(N)"); + } + { + test3b test_runner(params); + run(test_runner,"vector/resize"); + } + { + test3c test_runner(params); + run(test_runner,"vector/assign"); + } + { + test5 test_runner(params); + run(test_runner,"std::string range"); + } + { + test5 test_runner(params); + run(test_runner,"std::string &[0]"); + } + { + test5 test_runner(params); + run(test_runner,"valarray"); + } + return 0; +} diff --git a/include/mapnik/attribute_collector.hpp b/include/mapnik/attribute_collector.hpp index 441fa236a..4cb42e8ec 100644 --- a/include/mapnik/attribute_collector.hpp +++ b/include/mapnik/attribute_collector.hpp @@ -50,8 +50,6 @@ namespace mapnik { -class group_attribute_collector; - template struct expression_attributes : boost::static_visitor { @@ -68,7 +66,6 @@ struct expression_attributes : boost::static_visitor { boost::apply_visitor(*this, x.left); boost::apply_visitor(*this, x.right); - } template @@ -108,122 +105,74 @@ public: void operator() (group_symbolizer const& sym); }; +template +struct extract_attribute_names : boost::static_visitor +{ + explicit extract_attribute_names(Container& names) + : names_(names), + f_attr_(names) {} + + void operator() (mapnik::expression_ptr const& expr) const + { + if (expr) + { + boost::apply_visitor(f_attr_, *expr); + } + } + void operator() (mapnik::transform_type const& expr) const + { + if (expr) + { + transform_processor_type::collect_attributes(names_, *expr); + } + } + + void operator() (mapnik::text_placements_ptr const& expr) const + { + if (expr) + { + expression_set::const_iterator it; + expression_set expressions; + // TODO - optimize (dane) + expr->add_expressions(expressions); + for (it=expressions.begin(); it != expressions.end(); ++it) + { + if (*it) boost::apply_visitor(f_attr_, **it); + } + } + } + + void operator() (mapnik::path_expression_ptr const& expr) const + { + if (expr) + { + path_processor_type::collect_attributes(*expr,names_); + } + } + + template + void operator() (T const& val) const {} + +private: + Container& names_; + expression_attributes > f_attr_; +}; + struct symbolizer_attributes : public boost::static_visitor<> { symbolizer_attributes(std::set& names, double & filter_factor) - : names_(names), - filter_factor_(filter_factor), - f_attr(names), - g_attr(names, true) {} + : filter_factor_(filter_factor), + f_attrs_(names), + g_attrs_(names, true) {} template - void operator () (T const&) const {} - - void operator () (text_symbolizer const& sym) + void operator () (T const& sym) { - expression_set::const_iterator it; - expression_set expressions; - get(sym, keys::text_placements_)->add_expressions(expressions); - for (it=expressions.begin(); it != expressions.end(); ++it) + for (auto const& prop : sym.properties) { - if (*it) boost::apply_visitor(f_attr, **it); + boost::apply_visitor(f_attrs_, prop.second); } - collect_transform(get(sym, keys::geometry_transform)); - } - - void operator () (point_symbolizer const& sym) - { - path_expression_ptr const& filename_expr = get(sym, keys::file); - if (filename_expr) - { - path_processor_type::collect_attributes(*filename_expr,names_); - } - collect_transform(get(sym, keys::geometry_transform)); - collect_transform(get(sym, keys::image_transform)); - } - - void operator () (line_symbolizer const& sym) - { - collect_transform(get(sym, keys::geometry_transform)); - } - - void operator () (line_pattern_symbolizer const& sym) - { - path_expression_ptr const& filename_expr = get(sym, keys::file); - if (filename_expr) - { - path_processor_type::collect_attributes(*filename_expr,names_); - } - collect_transform(get(sym, keys::geometry_transform)); - collect_transform(get(sym, keys::image_transform)); - } - - void operator () (polygon_symbolizer const& sym) - { - collect_transform(get(sym, keys::geometry_transform)); - } - - void operator () (polygon_pattern_symbolizer const& sym) - { - path_expression_ptr const& filename_expr = get(sym, keys::file); - if (filename_expr) - { - path_processor_type::collect_attributes(*filename_expr,names_); - } - collect_transform(get(sym, keys::geometry_transform)); - collect_transform(get(sym, keys::image_transform)); - } - - void operator () (shield_symbolizer const& sym) - { - expression_set::const_iterator it; - expression_set expressions; - get(sym, keys::text_placements_)->add_expressions(expressions); - for (it=expressions.begin(); it != expressions.end(); ++it) - { - if (*it) boost::apply_visitor(f_attr, **it); - } - - path_expression_ptr const& filename_expr = get(sym, keys::file); - if (filename_expr) - { - path_processor_type::collect_attributes(*filename_expr,names_); - } - - collect_transform(get(sym, keys::geometry_transform)); - collect_transform(get(sym, keys::image_transform)); - } - - void operator () (markers_symbolizer const& sym) - { - expression_ptr const& height_expr = get(sym,keys::height); - if (height_expr) - { - boost::apply_visitor(f_attr,*height_expr); - } - expression_ptr const& width_expr = get(sym,keys::width); - if (width_expr) - { - boost::apply_visitor(f_attr,*width_expr); - } - path_expression_ptr const& filename_expr = get(sym, keys::file); - if (filename_expr) - { - path_processor_type::collect_attributes(*filename_expr,names_); - } - collect_transform(get(sym, keys::geometry_transform)); - collect_transform(get(sym, keys::image_transform)); - } - - void operator () (building_symbolizer const& sym) - { - expression_ptr const& height_expr = get(sym,keys::height); - if (height_expr) - { - boost::apply_visitor(f_attr,*height_expr); - } - collect_transform(get(sym, keys::geometry_transform)); } void operator () (raster_symbolizer const& sym) @@ -241,25 +190,21 @@ struct symbolizer_attributes : public boost::static_visitor<> filter_factor_ = 2; } } + for (auto const& prop : sym.properties) + { + boost::apply_visitor(f_attrs_, prop.second); + } } void operator () (group_symbolizer const& sym) { - g_attr(sym); + g_attrs_(sym); } private: - std::set& names_; double & filter_factor_; - expression_attributes > f_attr; - group_attribute_collector g_attr; - void collect_transform(transform_list_ptr const& trans_expr) - { - if (trans_expr) - { - transform_processor_type::collect_attributes(names_, *trans_expr); - } - } + extract_attribute_names > f_attrs_; + group_attribute_collector g_attrs_; }; @@ -279,11 +224,10 @@ public: void operator() (RuleType const& r) { typename RuleType::symbolizers const& symbols = r.get_symbolizers(); - typename RuleType::symbolizers::const_iterator symIter=symbols.begin(); symbolizer_attributes s_attr(names_,filter_factor_); - while (symIter != symbols.end()) + for (auto symbol : symbols) { - boost::apply_visitor(s_attr,*symIter++); + boost::apply_visitor(s_attr,symbol); } expression_ptr const& expr = r.get_filter(); @@ -328,6 +272,8 @@ inline void group_attribute_collector::operator() (group_symbolizer const& sym) } // get indexed column names + int start = get(sym, keys::start_column); + int end = start + get(sym, keys::num_columns); for (auto const& col_name : group_columns) { if (expand_index_columns_ && col_name.find('%') != std::string::npos) @@ -338,8 +284,6 @@ inline void group_attribute_collector::operator() (group_symbolizer const& sym) if (col_name.size() > 1) { // Indexed column name. add column name for each index value. - int start = get(sym, keys::start_column); - int end = start + get(sym, keys::num_columns); for (int col_idx = start; col_idx < end; ++col_idx) { std::string col_idx_name = col_name; diff --git a/include/mapnik/css_color_grammar.hpp b/include/mapnik/css_color_grammar.hpp index 2aa30d253..94f97f257 100644 --- a/include/mapnik/css_color_grammar.hpp +++ b/include/mapnik/css_color_grammar.hpp @@ -104,11 +104,7 @@ struct alpha_conv_impl struct hsl_conv_impl { -#ifdef BOOST_SPIRIT_USE_PHOENIX_V3 template -#else - template -#endif struct result { typedef void type; diff --git a/include/mapnik/datasource_cache.hpp b/include/mapnik/datasource_cache.hpp index a5f16236f..a56c989af 100644 --- a/include/mapnik/datasource_cache.hpp +++ b/include/mapnik/datasource_cache.hpp @@ -35,6 +35,7 @@ // stl #include +#include namespace mapnik { @@ -56,7 +57,7 @@ private: ~datasource_cache(); std::map > plugins_; bool registered_; - std::vector plugin_directories_; + std::set plugin_directories_; }; } diff --git a/include/mapnik/distance.hpp b/include/mapnik/distance.hpp deleted file mode 100644 index 83511c1ca..000000000 --- a/include/mapnik/distance.hpp +++ /dev/null @@ -1,53 +0,0 @@ -/***************************************************************************** - * - * This file is part of Mapnik (c++ mapping toolkit) - * - * Copyright (C) 2011 Artem Pavlenko - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - *****************************************************************************/ - -#ifndef MAPNIK_DISTANCE_HPP -#define MAPNIK_DISTANCE_HPP - -#include - -namespace mapnik -{ -struct ellipsoid; - -// great-circle distance - -class great_circle_distance -{ -public: - double operator() (coord2d const& pt0, coord2d const& pt1) const; -}; - -// vincenty distance -/* - class vincenty_distance : boost::noncopyble - { - public: - vincenty_distance(ellipsoid const& e); - double operator() (coord2d const& pt0, coord2d const& pt1) const; - private: - ellipsoid & e_; - }; -*/ -} - -#endif // MAPNIK_DISTANCE_HPP diff --git a/include/mapnik/expression_grammar.hpp b/include/mapnik/expression_grammar.hpp index bf782583b..6674f2129 100644 --- a/include/mapnik/expression_grammar.hpp +++ b/include/mapnik/expression_grammar.hpp @@ -65,11 +65,7 @@ struct unicode_impl struct regex_match_impl { -#ifdef BOOST_SPIRIT_USE_PHOENIX_V3 template -#else - template -#endif struct result { typedef expr_node type; @@ -87,11 +83,7 @@ struct regex_match_impl struct regex_replace_impl { -#ifdef BOOST_SPIRIT_USE_PHOENIX_V3 template -#else - template -#endif struct result { typedef expr_node type; diff --git a/include/mapnik/fastmath.hpp b/include/mapnik/fastmath.hpp deleted file mode 100644 index c5b086727..000000000 --- a/include/mapnik/fastmath.hpp +++ /dev/null @@ -1,112 +0,0 @@ -/***************************************************************************** - * - * This file is part of Mapnik (c++ mapping toolkit) - * - * Copyright (C) 2011 Artem Pavlenko - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - *****************************************************************************/ - -#ifndef MAPNIK_FASTMATH_HPP -#define MAPNIK_FASTMATH_HPP - -/* Timings: - * fast_sin(not inlined) 8.95s - * fast_sin(inlined) 6.64s - * sin 28.7s - * => 4.3x speedup - * worst case accuracy abs(fast_sin(x)/sin(x) - 1) = 0.000018 (at 0.664, M_PI-0.664, M_PI+0.664; 2*M_PI-0.664) - */ -static inline double fast_sin(double x) -{ - bool negative = false; - double result; - while (x > 2*M_PI) x -= 2*M_PI; - while (x < 0) x += 2*M_PI; - if (x > M_PI) { - x -= M_PI; - negative = true; - } - - if (x < 0.664 || x > M_PI-0.664) { - //series expansion at x=0: x-x^3/6+x^5/120-x^7/5040+... - if (x > M_PI-0.664) x = M_PI - x; - result = x*(1. + x*x*(-1/6. + x*x/120.)); - } else { - //series expansion at x=pi/2 - //1-x^2/2+x^4/24-x^6/720+x^8/40320+... - x -= M_PI/2; - result = 1. + x*x*(-1/2.+x*x*(1/24. + x*x*(-1/720.))); - } - return negative?-result:result; -} - -static inline double fast_cos(double x) -{ - return fast_sin(x + M_PI/2); -} - -static inline double atan_helper(double x) -{ - //Series expansion at x=0: - // x-x^3/3+x^5/5-x^7/7+... - if (x < 0.30) { - return x * (1 + x*x*(-1/3. + x*x*(1/5.) + x*x*(-1/7. + x*x*(1/9.)))); - } - else if (x < 0.71) { - //Series expansion at x=0.5 - //atan(1/2)+(4 x)/5-(8 x^2)/25-(16 x^3)/375+(96 x^4)/625 +... - x -= 0.5; - return 0.463647609000806116 /*atan(0.5) */ + x *(4./5. + x *(-8./25. + (-16./375.*x))); - } else { - //series expansion at x=1: - //pi/4+x/2-x^2/4+x^3/12-x^5/40+... - x -= 1; - return (M_PI/4.) + x * (1/2. + x*(-1/4. +x*(1/12. + x * (-1/40.)))); - } -} - -/* - * fast_atan(not inlined) 6.74s - * fast_atan(everything inlined) 6.78s - * fast_atan(only helper inlined) 6.75 - * atan 27.5s - * => 4x speedup - * worst case accuracy abs(fast_atan(x)/atan(x) - 1) = 0.000271 (at 1.411) - */ -double inline fast_atan(double x) -{ - double negative = false; - double result; - if (x < 0) { - x = -x; - negative = true; - } - if (x <= 1) result = atan_helper(x); else result = M_PI/2 - atan_helper(1/x); - return negative?-result:result; -} - -static inline double fast_atan2(double y, double x) -{ - double result = M_PI/2; - if (x == 0 && y == 0) return 0; - if (x != 0) result = fast_atan(y/x); - if (x < 0 && y >= 0) return result + M_PI; - if (x <= 0 && y < 0) return -M_PI + result; - return result; -} - -#endif // MAPNIK_FASTMATH_HPP diff --git a/include/mapnik/hextree.hpp b/include/mapnik/hextree.hpp index a77545278..8f2327ec5 100644 --- a/include/mapnik/hextree.hpp +++ b/include/mapnik/hextree.hpp @@ -33,6 +33,7 @@ // stl #include +#include #include #include #include @@ -68,7 +69,7 @@ class hextree : private mapnik::noncopyable pixel_count(0), children_count(0) { - memset(&children_[0],0,sizeof(children_)); + std::memset(&children_[0],0,sizeof(children_)); } ~node () diff --git a/include/mapnik/json/feature_collection_parser.hpp b/include/mapnik/json/feature_collection_parser.hpp index 39e0e81e9..27f803fb2 100644 --- a/include/mapnik/json/feature_collection_parser.hpp +++ b/include/mapnik/json/feature_collection_parser.hpp @@ -29,9 +29,6 @@ #include #include -// boost - - // stl #include diff --git a/include/mapnik/json/feature_grammar.hpp b/include/mapnik/json/feature_grammar.hpp index 5252af283..7064cdec4 100644 --- a/include/mapnik/json/feature_grammar.hpp +++ b/include/mapnik/json/feature_grammar.hpp @@ -67,7 +67,6 @@ public: mapnik::transcoder const& tr_; }; -#ifdef BOOST_SPIRIT_USE_PHOENIX_V3 struct put_property { typedef void result_type; @@ -90,42 +89,6 @@ struct extract_geometry return feature.paths(); } }; -#else -struct put_property -{ - template - struct result - { - typedef void type; - }; - explicit put_property(mapnik::transcoder const& tr) - : tr_(tr) {} - - template - void operator() (T0 & feature, T1 const& key, T2 const& val) const - { - mapnik::value v = boost::apply_visitor(attribute_value_visitor(tr_),val); // TODO: optimize - feature.put_new(key, v); - } - - mapnik::transcoder const& tr_; -}; - -struct extract_geometry -{ - template - struct result - { - typedef boost::ptr_vector& type; - }; - - template - boost::ptr_vector& operator() (T & feature) const - { - return feature.paths(); - } -}; -#endif template struct feature_grammar : diff --git a/include/mapnik/json/geometry_generator_grammar.hpp b/include/mapnik/json/geometry_generator_grammar.hpp index 8652a8db3..37a01e896 100644 --- a/include/mapnik/json/geometry_generator_grammar.hpp +++ b/include/mapnik/json/geometry_generator_grammar.hpp @@ -58,7 +58,6 @@ namespace phoenix = boost::phoenix; namespace { -#ifdef BOOST_SPIRIT_USE_PHOENIX_V3 struct get_type { typedef int result_type; @@ -117,81 +116,6 @@ struct not_empty } }; -#else -struct get_type -{ - template - struct result { typedef int type; }; - - int operator() (geometry_type const& geom) const - { - return static_cast(geom.type()); - } -}; - -struct get_first -{ - template - struct result { typedef geometry_type::value_type const type; }; - - geometry_type::value_type const operator() (geometry_type const& geom) const - { - geometry_type::value_type coord; - std::get<0>(coord) = geom.vertex(0,&std::get<1>(coord),&std::get<2>(coord)); - return coord; - } -}; - -struct multi_geometry_type -{ - template - struct result { typedef std::tuple type; }; - - std::tuple operator() (geometry_container const& geom) const - { - unsigned type = 0u; - bool collection = false; - - geometry_container::const_iterator itr = geom.begin(); - geometry_container::const_iterator end = geom.end(); - - for ( ; itr != end; ++itr) - { - if (type != 0u && static_cast(itr->type()) != type) - { - collection = true; - break; - } - type = itr->type(); - } - if (geom.size() > 1) type +=3; - 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 - - template struct json_coordinate_policy : karma::real_policies { diff --git a/include/mapnik/json/geometry_grammar.hpp b/include/mapnik/json/geometry_grammar.hpp index 157d0e6b1..45aaa3ed0 100644 --- a/include/mapnik/json/geometry_grammar.hpp +++ b/include/mapnik/json/geometry_grammar.hpp @@ -37,7 +37,6 @@ namespace qi = boost::spirit::qi; namespace standard_wide = boost::spirit::standard_wide; using standard_wide::space_type; -#ifdef BOOST_SPIRIT_USE_PHOENIX_V3 struct push_vertex { typedef void result_type; @@ -88,76 +87,6 @@ struct where_message return str; } }; -#else -struct push_vertex -{ - template - struct result - { - typedef void type; - }; - - template - void operator() (T0 c, T1 path, T2 x, T3 y) const - { - BOOST_ASSERT( path!=0 ); - path->push_vertex(x,y,c); - } -}; - -struct close_path -{ - template - struct result - { - typedef void type; - }; - - template - void operator() (T path) const - { - BOOST_ASSERT( path!=0 ); - if (path->size() > 2u) // to form a polygon ring we need at least 3 vertices - { - path->close_path(); - } - } -}; - -struct cleanup -{ - template - struct result - { - typedef void type; - }; - - template - void operator() (T0 & path) const - { - if (path) delete path, path=0; - } -}; - -struct where_message -{ - template - struct result - { - typedef std::string type; - }; - - template - std::string operator() (Iterator first, Iterator last, std::size_t size) const - { - std::string str(first, last); - if (str.length() > size) - return str.substr(0, size) + "..." ; - return str; - } -}; -#endif - template struct geometry_grammar : diff --git a/include/mapnik/json/symbolizer_grammar.hpp b/include/mapnik/json/symbolizer_grammar.hpp index 89a0cf25f..ce239e8a2 100644 --- a/include/mapnik/json/symbolizer_grammar.hpp +++ b/include/mapnik/json/symbolizer_grammar.hpp @@ -24,7 +24,6 @@ #define MAPNIK_SYMBOLIZER_GRAMMAR_HPP // boost -#define BOOST_SPIRIT_USE_PHOENIX_V3 1 #include #include diff --git a/include/mapnik/json/topojson_grammar.hpp b/include/mapnik/json/topojson_grammar.hpp index cf14c55e6..1d78c03b4 100644 --- a/include/mapnik/json/topojson_grammar.hpp +++ b/include/mapnik/json/topojson_grammar.hpp @@ -23,13 +23,15 @@ #ifndef MAPNIK_TOPOJSON_GRAMMAR_HPP #define MAPNIK_TOPOJSON_GRAMMAR_HPP -#define BOOST_SPIRIT_USE_PHOENIX_V3 1 -#include -#include -// +// mapnik #include #include -// + +// boost +#include +#include + +// stl #include namespace mapnik { namespace topojson { diff --git a/include/mapnik/noncopyable.hpp b/include/mapnik/noncopyable.hpp index fed51aeae..8efeca6f1 100644 --- a/include/mapnik/noncopyable.hpp +++ b/include/mapnik/noncopyable.hpp @@ -33,8 +33,8 @@ class noncopyable protected: constexpr noncopyable() = default; ~noncopyable() = default; - noncopyable( const noncopyable& ) = delete; - noncopyable& operator=( const noncopyable& ) = delete; + noncopyable( noncopyable const& ) = delete; + noncopyable& operator=(noncopyable const& ) = delete; }; } diff --git a/include/mapnik/octree.hpp b/include/mapnik/octree.hpp index e8c66f4af..027cbcf90 100644 --- a/include/mapnik/octree.hpp +++ b/include/mapnik/octree.hpp @@ -30,6 +30,7 @@ // stl #include +#include #include #include @@ -62,7 +63,7 @@ class octree : private mapnik::noncopyable children_count(0), index(0) { - memset(&children_[0],0,sizeof(children_)); + std::memset(&children_[0],0,sizeof(children_)); } ~node() diff --git a/include/mapnik/renderer_common/process_markers_symbolizer.hpp b/include/mapnik/renderer_common/process_markers_symbolizer.hpp index 26f08e9b2..c6bf5a2c0 100644 --- a/include/mapnik/renderer_common/process_markers_symbolizer.hpp +++ b/include/mapnik/renderer_common/process_markers_symbolizer.hpp @@ -89,8 +89,8 @@ void render_markers_symbolizer(markers_symbolizer const &sym, typedef decltype(rasterizer_dispatch) dispatch_type; vertex_converter, dispatch_type, markers_symbolizer, - CoordTransform, proj_transform, agg::trans_affine, conv_types> - converter(clip_box, rasterizer_dispatch, sym,common.t_,prj_trans,tr,common.scale_factor_); + CoordTransform, proj_transform, agg::trans_affine, conv_types, feature_impl> + converter(clip_box, rasterizer_dispatch, sym,common.t_,prj_trans,tr,feature,common.scale_factor_); if (clip && feature.paths().size() > 0) // optional clip (default: true) { geometry_type::types type = feature.paths()[0].type(); @@ -121,8 +121,8 @@ void render_markers_symbolizer(markers_symbolizer const &sym, typedef decltype(rasterizer_dispatch) dispatch_type; vertex_converter, dispatch_type, markers_symbolizer, - CoordTransform, proj_transform, agg::trans_affine, conv_types> - converter(clip_box, rasterizer_dispatch, sym,common.t_,prj_trans,tr,common.scale_factor_); + CoordTransform, proj_transform, agg::trans_affine, conv_types, feature_impl> + converter(clip_box, rasterizer_dispatch, sym,common.t_,prj_trans,tr,feature,common.scale_factor_); if (clip && feature.paths().size() > 0) // optional clip (default: true) { geometry_type::types type = feature.paths()[0].type(); @@ -150,8 +150,8 @@ void render_markers_symbolizer(markers_symbolizer const &sym, typedef decltype(rasterizer_dispatch) dispatch_type; vertex_converter, dispatch_type, markers_symbolizer, - CoordTransform, proj_transform, agg::trans_affine, conv_types> - converter(clip_box, rasterizer_dispatch, sym,common.t_,prj_trans,tr,common.scale_factor_); + CoordTransform, proj_transform, agg::trans_affine, conv_types, feature_impl> + converter(clip_box, rasterizer_dispatch, sym,common.t_,prj_trans,tr,feature,common.scale_factor_); if (clip && feature.paths().size() > 0) // optional clip (default: true) { diff --git a/include/mapnik/renderer_common/process_polygon_symbolizer.hpp b/include/mapnik/renderer_common/process_polygon_symbolizer.hpp index e6104b6de..be5526957 100644 --- a/include/mapnik/renderer_common/process_polygon_symbolizer.hpp +++ b/include/mapnik/renderer_common/process_polygon_symbolizer.hpp @@ -44,7 +44,7 @@ void render_polygon_symbolizer(polygon_symbolizer const &sym, double opacity = get(sym,keys::fill_opacity,feature, 1.0); vertex_converter_type converter(clip_box, ras, sym, common.t_, prj_trans, tr, - common.scale_factor_); + feature,common.scale_factor_); if (prj_trans.equal() && clip) converter.template set(); //optional clip (default: true) converter.template set(); //always transform diff --git a/include/mapnik/svg/svg_path_commands.hpp b/include/mapnik/svg/svg_path_commands.hpp index ba631ed76..651a8edb9 100644 --- a/include/mapnik/svg/svg_path_commands.hpp +++ b/include/mapnik/svg/svg_path_commands.hpp @@ -46,11 +46,7 @@ template struct move_to { -#ifdef BOOST_SPIRIT_USE_PHOENIX_V3 template -#else - template -#endif struct result { typedef void type; @@ -71,11 +67,7 @@ struct move_to template struct hline_to { -#ifdef BOOST_SPIRIT_USE_PHOENIX_V3 template -#else - template -#endif struct result { typedef void type; @@ -97,11 +89,7 @@ struct hline_to template struct vline_to { -#ifdef BOOST_SPIRIT_USE_PHOENIX_V3 template -#else - template -#endif struct result { typedef void type; @@ -122,11 +110,7 @@ struct vline_to template struct line_to { -#ifdef BOOST_SPIRIT_USE_PHOENIX_V3 template -#else - template -#endif struct result { typedef void type; @@ -148,11 +132,7 @@ struct line_to template struct curve4 { -#ifdef BOOST_SPIRIT_USE_PHOENIX_V3 template -#else - template -#endif struct result { typedef void type; @@ -177,11 +157,7 @@ struct curve4 template struct curve4_smooth { -#ifdef BOOST_SPIRIT_USE_PHOENIX_V3 template -#else - template -#endif struct result { typedef void type; @@ -203,11 +179,7 @@ struct curve4_smooth template struct curve3 { -#ifdef BOOST_SPIRIT_USE_PHOENIX_V3 template -#else - template -#endif struct result { typedef void type; @@ -230,11 +202,7 @@ struct curve3 template struct curve3_smooth { -#ifdef BOOST_SPIRIT_USE_PHOENIX_V3 template -#else - template -#endif struct result { typedef void type; @@ -256,11 +224,7 @@ struct curve3_smooth template struct arc_to { -#ifdef BOOST_SPIRIT_USE_PHOENIX_V3 template -#else - template -#endif struct result { typedef void type; diff --git a/include/mapnik/svg/svg_transform_grammar.hpp b/include/mapnik/svg/svg_transform_grammar.hpp index bbc43e661..864578764 100644 --- a/include/mapnik/svg/svg_transform_grammar.hpp +++ b/include/mapnik/svg/svg_transform_grammar.hpp @@ -50,11 +50,7 @@ namespace mapnik { namespace svg { template struct process_matrix { -#ifdef BOOST_SPIRIT_USE_PHOENIX_V3 template -#else - template -#endif struct result { typedef void type; @@ -74,11 +70,7 @@ namespace mapnik { namespace svg { template struct process_rotate { -#ifdef BOOST_SPIRIT_USE_PHOENIX_V3 template -#else - template -#endif struct result { typedef void type; @@ -109,11 +101,7 @@ namespace mapnik { namespace svg { template struct process_translate { -#ifdef BOOST_SPIRIT_USE_PHOENIX_V3 template -#else - template -#endif struct result { typedef void type; @@ -135,11 +123,7 @@ namespace mapnik { namespace svg { template struct process_scale { -#ifdef BOOST_SPIRIT_USE_PHOENIX_V3 template -#else - template -#endif struct result { typedef void type; @@ -162,11 +146,7 @@ namespace mapnik { namespace svg { template struct process_skew { -#ifdef BOOST_SPIRIT_USE_PHOENIX_V3 template -#else - template -#endif struct result { typedef void type; diff --git a/include/mapnik/text/vertex_cache.hpp b/include/mapnik/text/vertex_cache.hpp index 4ed872c57..d7cbd9496 100644 --- a/include/mapnik/text/vertex_cache.hpp +++ b/include/mapnik/text/vertex_cache.hpp @@ -131,6 +131,8 @@ public: /** Go back to initial state. */ void reset(); + /** position on this line closest to the target position */ + double position_closest_to(pixel_position const &target_pos); private: void rewind_subpath(); diff --git a/include/mapnik/util/geometry_svg_generator.hpp b/include/mapnik/util/geometry_svg_generator.hpp index 659427312..567cd5560 100644 --- a/include/mapnik/util/geometry_svg_generator.hpp +++ b/include/mapnik/util/geometry_svg_generator.hpp @@ -91,7 +91,6 @@ namespace mapnik { namespace util { namespace svg_detail { -#ifdef BOOST_SPIRIT_USE_PHOENIX_V3 template struct get_type { @@ -115,37 +114,7 @@ namespace mapnik { namespace util { return coord; } }; -#else - template - struct get_type - { - template - struct result { typedef int type; }; - int operator() (Geometry const& geom) const - { - return static_cast(geom.type()); - } - }; - - template - struct get_first - { - typedef T geometry_type; - - template - struct result { typedef typename geometry_type::value_type const type; }; - - typename geometry_type::value_type operator() (geometry_type const& geom) const - { - typename geometry_type::value_type coord; - geom.rewind(0); - std::get<0>(coord) = geom.vertex(&std::get<1>(coord),&std::get<2>(coord)); - return coord; - } - }; - -#endif template struct coordinate_policy : karma::real_policies { diff --git a/include/mapnik/vertex_converters.hpp b/include/mapnik/vertex_converters.hpp index 2c5622f8a..4510ab13b 100644 --- a/include/mapnik/vertex_converters.hpp +++ b/include/mapnik/vertex_converters.hpp @@ -46,6 +46,7 @@ #include #include #include +#include // agg #include "agg_conv_clip_polygon.h" @@ -97,7 +98,8 @@ struct converter_traits static void setup(geometry_type & geom, Args const& args) { typename boost::mpl::at >::type sym = boost::fusion::at_c<2>(args); - geom.smooth_value(get(sym, keys::smooth)); + auto const& feat = boost::fusion::at_c<6>(args); + geom.smooth_value(get(sym, keys::smooth, feat)); } }; @@ -111,8 +113,9 @@ struct converter_traits static void setup(geometry_type & geom, Args const& args) { typename boost::mpl::at >::type sym = boost::fusion::at_c<2>(args); - geom.set_simplify_algorithm(static_cast(get(sym,keys::simplify_algorithm))); - geom.set_simplify_tolerance(get(sym, keys::simplify_tolerance)); + auto const& feat = boost::fusion::at_c<6>(args); + geom.set_simplify_algorithm(static_cast(get(sym,keys::simplify_algorithm, feat))); + geom.set_simplify_tolerance(get(sym, keys::simplify_tolerance, feat)); } }; @@ -130,7 +133,6 @@ struct converter_traits } }; - template struct converter_traits { @@ -141,7 +143,7 @@ struct converter_traits static void setup(geometry_type & geom, Args const& args) { typename boost::mpl::at >::type sym = boost::fusion::at_c<2>(args); - double scale_factor = boost::fusion::at_c<6>(args); + double scale_factor = boost::fusion::at_c<7>(args); auto dash = get_optional(sym, keys::stroke_dasharray); if (dash) { @@ -164,16 +166,16 @@ struct converter_traits static void setup(geometry_type & geom, Args const& args) { typename boost::mpl::at >::type sym = boost::fusion::at_c<2>(args); + auto const& feat = boost::fusion::at_c<6>(args); set_join_caps(sym, geom); - double miterlimit = get(sym, keys::stroke_miterlimit, 4.0); - double width = get(sym, keys::stroke_width, 1.0); + double miterlimit = get(sym, keys::stroke_miterlimit, feat, 4.0); + double width = get(sym, keys::stroke_width, feat, 1.0); geom.generator().miter_limit(miterlimit); - double scale_factor = boost::fusion::at_c<6>(args); + double scale_factor = boost::fusion::at_c<7>(args); geom.generator().width(width * scale_factor); } }; - template struct converter_traits { @@ -213,7 +215,6 @@ struct converter_traits } }; - template struct converter_traits { @@ -244,8 +245,9 @@ struct converter_traits static void setup(geometry_type & geom, Args const& args) { typename boost::mpl::at >::type sym = boost::fusion::at_c<2>(args); - double offset = get(sym, keys::offset); - double scale_factor = boost::fusion::at_c<6>(args); + auto const& feat = boost::fusion::at_c<6>(args); + double offset = get(sym, keys::offset, feat); + double scale_factor = boost::fusion::at_c<7>(args); geom.set_offset(offset * scale_factor); } }; @@ -312,7 +314,6 @@ struct dispatcher converter_fwd:: template forward(*this,geom,args_); } - } template @@ -328,9 +329,7 @@ struct dispatcher }; } - - -template +template struct vertex_converter : private mapnik::noncopyable { typedef C conv_types; @@ -340,6 +339,7 @@ struct vertex_converter : private mapnik::noncopyable typedef T trans_type; typedef P proj_trans_type; typedef A affine_trans_type; + typedef F feature_type; typedef typename boost::fusion::vector < bbox_type const&, @@ -348,18 +348,25 @@ struct vertex_converter : private mapnik::noncopyable trans_type const&, proj_trans_type const&, affine_trans_type const&, + feature_type const&, double //scale-factor > args_type; - vertex_converter(bbox_type const& b, rasterizer_type & ras, - symbolizer_type const& sym, trans_type & tr, + vertex_converter(bbox_type const& b, + rasterizer_type & ras, + symbolizer_type const& sym, + trans_type & tr, proj_trans_type const& prj_trans, affine_trans_type const& affine_trans, + feature_type const& feature, double scale_factor) - : disp_(args_type(boost::cref(b), boost::ref(ras), - boost::cref(sym), boost::cref(tr), + : disp_(args_type(boost::cref(b), + boost::ref(ras), + boost::cref(sym), + boost::cref(tr), boost::cref(prj_trans), boost::cref(affine_trans), + boost::cref(feature), scale_factor)) {} template @@ -389,7 +396,6 @@ struct vertex_converter : private mapnik::noncopyable disp_.vec_[index]=0; } - detail::dispatcher disp_; }; diff --git a/include/mapnik/webp_io.hpp b/include/mapnik/webp_io.hpp index ac3a9dcee..89b1e552b 100644 --- a/include/mapnik/webp_io.hpp +++ b/include/mapnik/webp_io.hpp @@ -24,6 +24,7 @@ #define MAPNIK_WEBP_IO_HPP // mapnik +#include #include // webp diff --git a/include/mapnik/wkt/wkt_grammar.hpp b/include/mapnik/wkt/wkt_grammar.hpp index 0e20138b5..b7e3ff379 100644 --- a/include/mapnik/wkt/wkt_grammar.hpp +++ b/include/mapnik/wkt/wkt_grammar.hpp @@ -44,11 +44,7 @@ namespace mapnik { namespace wkt { struct push_vertex { -#ifdef BOOST_SPIRIT_USE_PHOENIX_V3 template -#else - template -#endif struct result { typedef void type; @@ -233,7 +229,6 @@ struct wkt_collection_grammar : qi::grammar> (lit("(") >> wkt % lit(",") >> lit(")")); } diff --git a/localize.sh b/localize.sh index e981dbdf9..0f327b384 100755 --- a/localize.sh +++ b/localize.sh @@ -10,4 +10,5 @@ fi export PYTHONPATH="${CURRENT_DIR}/bindings/python/":${PYTHONPATH} export MAPNIK_FONT_DIRECTORY="${CURRENT_DIR}/fonts/dejavu-fonts-ttf-2.33/ttf/" export MAPNIK_INPUT_PLUGINS_DIRECTORY="${CURRENT_DIR}/plugins/input/" -export PATH="${CURRENT_DIR}/bin/":${PATH} \ No newline at end of file +export PATH="${CURRENT_DIR}/bin/":${PATH} +export PATH="${CURRENT_DIR}/utils/nik2img":${PATH} \ No newline at end of file diff --git a/plugins/input/ogr/ogr_featureset.cpp b/plugins/input/ogr/ogr_featureset.cpp index f0a1bf2d7..7383c7f86 100644 --- a/plugins/input/ogr/ogr_featureset.cpp +++ b/plugins/input/ogr/ogr_featureset.cpp @@ -68,7 +68,7 @@ ogr_featureset::ogr_featureset(mapnik::context_ptr const& ctx, layer_(layer), layerdef_(layer.GetLayerDefn()), tr_(new transcoder(encoding)), - fidcolumn_(layer_.GetFIDColumn()), + fidcolumn_(layer_.GetFIDColumn()), // TODO - unused count_(0) { layer_.SetSpatialFilterRect (extent.minx(), @@ -83,6 +83,13 @@ ogr_featureset::~ogr_featureset() feature_ptr ogr_featureset::next() { + if (count_ == 0) + { + // Reset the layer reading on the first feature read + // this is a hack, but needed due to https://github.com/mapnik/mapnik/issues/2048 + // Proper solution is to avoid storing layer state in featureset + layer_.ResetReading(); + } OGRFeature *poFeature; while ((poFeature = layer_.GetNextFeature()) != nullptr) { diff --git a/plugins/input/rasterlite/rasterlite_featureset.cpp b/plugins/input/rasterlite/rasterlite_featureset.cpp index adf68faec..554f239a3 100644 --- a/plugins/input/rasterlite/rasterlite_featureset.cpp +++ b/plugins/input/rasterlite/rasterlite_featureset.cpp @@ -31,8 +31,7 @@ #include #include -// boost - +#include using mapnik::coord2d; using mapnik::box2d; @@ -122,7 +121,7 @@ feature_ptr rasterlite_featureset::get_feature(mapnik::query const& q) unsigned char* raster_data = static_cast(raster); unsigned char* image_data = image.getBytes(); - memcpy (image_data, raster_data, size); + std::memcpy(image_data, raster_data, size); feature->set_raster(rasterp); diff --git a/plugins/input/shape/dbfile.cpp b/plugins/input/shape/dbfile.cpp index dd5b3478e..dca016938 100644 --- a/plugins/input/shape/dbfile.cpp +++ b/plugins/input/shape/dbfile.cpp @@ -38,6 +38,7 @@ // stl #include +#include #include dbf_file::dbf_file() @@ -223,7 +224,7 @@ void dbf_file::read_header() skip(22); std::streampos offset=0; char name[11]; - memset(&name,0,11); + std::memset(&name,0,11); fields_.reserve(num_fields_); for (int i=0;i::process(line_pattern_symbolizer const& sym, typedef boost::mpl::vector conv_types; vertex_converter, rasterizer_type, line_pattern_symbolizer, - CoordTransform, proj_transform, agg::trans_affine, conv_types> - converter(clip_box,ras,sym,common_.t_,prj_trans,tr,common_.scale_factor_); + CoordTransform, proj_transform, agg::trans_affine, conv_types, feature_impl> + converter(clip_box,ras,sym,common_.t_,prj_trans,tr,feature,common_.scale_factor_); if (clip) converter.set(); //optional clip (default: true) converter.set(); //always transform diff --git a/src/agg/process_line_symbolizer.cpp b/src/agg/process_line_symbolizer.cpp index 81b03d4fb..00a842b4a 100644 --- a/src/agg/process_line_symbolizer.cpp +++ b/src/agg/process_line_symbolizer.cpp @@ -136,8 +136,8 @@ void agg_renderer::process(line_symbolizer const& sym, set_join_caps_aa(sym , ras, feature); vertex_converter, rasterizer_type, line_symbolizer, - CoordTransform, proj_transform, agg::trans_affine, conv_types> - converter(clip_box,ras,sym,common_.t_,prj_trans,tr,common_.scale_factor_); + CoordTransform, proj_transform, agg::trans_affine, conv_types, feature_impl> + converter(clip_box,ras,sym,common_.t_,prj_trans,tr,feature,common_.scale_factor_); if (clip) converter.set(); // optional clip (default: true) converter.set(); // always transform if (std::fabs(offset) > 0.0) converter.set(); // parallel offset @@ -156,8 +156,8 @@ void agg_renderer::process(line_symbolizer const& sym, else { vertex_converter, rasterizer, line_symbolizer, - CoordTransform, proj_transform, agg::trans_affine, conv_types> - converter(clip_box,*ras_ptr,sym,common_.t_,prj_trans,tr,common_.scale_factor_); + CoordTransform, proj_transform, agg::trans_affine, conv_types, feature_impl> + converter(clip_box,*ras_ptr,sym,common_.t_,prj_trans,tr,feature,common_.scale_factor_); if (clip) converter.set(); // optional clip (default: true) converter.set(); // always transform diff --git a/src/agg/process_polygon_pattern_symbolizer.cpp b/src/agg/process_polygon_pattern_symbolizer.cpp index afbf900ca..9e4871a95 100644 --- a/src/agg/process_polygon_pattern_symbolizer.cpp +++ b/src/agg/process_polygon_pattern_symbolizer.cpp @@ -160,8 +160,8 @@ void agg_renderer::process(polygon_pattern_symbolizer const& sym, typedef boost::mpl::vector conv_types; vertex_converter, rasterizer, polygon_pattern_symbolizer, - CoordTransform, proj_transform, agg::trans_affine, conv_types> - converter(clip_box,*ras_ptr,sym,common_.t_,prj_trans,tr,common_.scale_factor_); + CoordTransform, proj_transform, agg::trans_affine, conv_types, feature_impl> + converter(clip_box,*ras_ptr,sym,common_.t_,prj_trans,tr,feature,common_.scale_factor_); if (prj_trans.equal() && clip) converter.set(); //optional clip (default: true) converter.set(); //always transform diff --git a/src/agg/process_polygon_symbolizer.cpp b/src/agg/process_polygon_symbolizer.cpp index 5cca63dc3..26198b05e 100644 --- a/src/agg/process_polygon_symbolizer.cpp +++ b/src/agg/process_polygon_symbolizer.cpp @@ -52,7 +52,7 @@ void agg_renderer::process(polygon_symbolizer const& sym, typedef boost::mpl::vector conv_types; typedef vertex_converter, rasterizer, polygon_symbolizer, CoordTransform, proj_transform, agg::trans_affine, - conv_types> vertex_converter_type; + conv_types, feature_impl> vertex_converter_type; ras_ptr->reset(); double gamma = get(sym, keys::gamma, feature, 1.0); diff --git a/src/build.py b/src/build.py index 79f3f1b36..d54b22833 100644 --- a/src/build.py +++ b/src/build.py @@ -189,7 +189,6 @@ source = Split( wkb.cpp projection.cpp proj_transform.cpp - distance.cpp scale_denominator.cpp simplify.cpp memory_datasource.cpp diff --git a/src/cairo_renderer.cpp b/src/cairo_renderer.cpp index 4dd4469a7..7e6093382 100644 --- a/src/cairo_renderer.cpp +++ b/src/cairo_renderer.cpp @@ -275,7 +275,7 @@ void cairo_renderer_base::process(polygon_symbolizer const& sym, typedef boost::mpl::vector conv_types; typedef vertex_converter, cairo_context, polygon_symbolizer, CoordTransform, proj_transform, agg::trans_affine, - conv_types> vertex_converter_type; + conv_types, feature_impl> vertex_converter_type; cairo_save_restore guard(context_); composite_mode_e comp_op = get(sym, keys::comp_op, feature, src_over); @@ -349,8 +349,8 @@ void cairo_renderer_base::process(line_symbolizer const& sym, line_join_enum stroke_join = get(sym, keys::stroke_linejoin, MITER_JOIN); line_cap_enum stroke_cap = get(sym, keys::stroke_linecap, BUTT_CAP); auto dash = get_optional(sym, keys::stroke_dasharray); - double miterlimit = get(sym, keys::stroke_miterlimit, 4.0); - double width = get(sym, keys::stroke_width, 1.0); + double miterlimit = get(sym, keys::stroke_miterlimit, feature, 4.0); + double width = get(sym, keys::stroke_width, feature, 1.0); context_.set_operator(comp_op); @@ -380,8 +380,8 @@ void cairo_renderer_base::process(line_symbolizer const& sym, clipping_extent.pad(padding); } vertex_converter, cairo_context, line_symbolizer, - CoordTransform, proj_transform, agg::trans_affine, conv_types> - converter(clipping_extent,context_,sym,common_.t_,prj_trans,tr,common_.scale_factor_); + CoordTransform, proj_transform, agg::trans_affine, conv_types, feature_impl> + converter(clipping_extent,context_,sym,common_.t_,prj_trans,tr,feature,common_.scale_factor_); if (clip) converter.set(); // optional clip (default: true) converter.set(); // always transform @@ -729,8 +729,8 @@ void cairo_renderer_base::process(polygon_pattern_symbolizer const& sym, typedef boost::mpl::vector conv_types; vertex_converter, cairo_context, polygon_pattern_symbolizer, - CoordTransform, proj_transform, agg::trans_affine, conv_types> - converter(common_.query_extent_,context_,sym,common_.t_,prj_trans,tr, common_.scale_factor_); + CoordTransform, proj_transform, agg::trans_affine, conv_types, feature_impl> + converter(common_.query_extent_,context_,sym,common_.t_,prj_trans,tr,feature,common_.scale_factor_); if (prj_trans.equal() && clip) converter.set(); //optional clip (default: true) converter.set(); //always transform diff --git a/src/datasource_cache.cpp b/src/datasource_cache.cpp index 507e1f093..800cdd56d 100644 --- a/src/datasource_cache.cpp +++ b/src/datasource_cache.cpp @@ -165,8 +165,7 @@ void datasource_cache::register_datasources(std::string const& str) #ifdef MAPNIK_THREADSAFE mapnik::scoped_lock lock(mutex_); #endif - // TODO - only push unique paths - plugin_directories_.push_back(str); + plugin_directories_.insert(str); if (mapnik::util::exists(str) && mapnik::util::is_directory(str)) { boost::filesystem::directory_iterator end_itr; @@ -194,9 +193,15 @@ void datasource_cache::register_datasources(std::string const& str) bool datasource_cache::register_datasource(std::string const& filename) { - bool success = false; try { + if (!mapnik::util::exists(filename)) + { + MAPNIK_LOG_ERROR(datasource_cache) + << "Cannot load '" + << filename << "' (plugin does not exist)"; + return false; + } std::shared_ptr plugin = std::make_shared(filename,"datasource_name"); if (plugin->valid()) { @@ -208,11 +213,13 @@ bool datasource_cache::register_datasource(std::string const& filename) } else { - plugins_.insert(std::make_pair(plugin->name(),plugin)); - MAPNIK_LOG_DEBUG(datasource_cache) - << "datasource_cache: Registered=" - << plugin->name(); - success = true; + if (plugins_.insert(std::make_pair(plugin->name(),plugin)).second) + { + MAPNIK_LOG_ERROR(datasource_cache) + << "datasource_cache: Registered=" + << plugin->name(); + return true; + } } } else @@ -228,7 +235,7 @@ bool datasource_cache::register_datasource(std::string const& filename) << "Exception caught while loading plugin library: " << filename << " (" << ex.what() << ")"; } - return success; + return false; } } diff --git a/src/distance.cpp b/src/distance.cpp deleted file mode 100644 index 8c24fda20..000000000 --- a/src/distance.cpp +++ /dev/null @@ -1,53 +0,0 @@ -/***************************************************************************** - * - * This file is part of Mapnik (c++ mapping toolkit) - * - * Copyright (C) 2011 Artem Pavlenko - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - *****************************************************************************/ - -// mapnik -#include -#include - -// stl -#include - -namespace mapnik { - -static const double deg2rad = 0.0174532925199432958; -static const double R = 6372795.0; // average great-circle radius of the earth - -double great_circle_distance::operator() (coord2d const& pt0, - coord2d const& pt1) const -{ - double lon0 = pt0.x * deg2rad; - double lat0 = pt0.y * deg2rad; - double lon1 = pt1.x * deg2rad; - double lat1 = pt1.y * deg2rad; - - double dlat = lat1 - lat0; - double dlon = lon1 - lon0; - - double sin_dlat = std::sin(0.5 * dlat); - double sin_dlon = std::sin(0.5 * dlon); - - double a = std::pow(sin_dlat,2.0) + std::cos(lat0)*std::cos(lat1)*std::pow(sin_dlon,2.0); - double c = 2 * std::atan2(std::sqrt(a),std::sqrt(1 - a)); - return R * c; -} -} diff --git a/src/grid/process_line_pattern_symbolizer.cpp b/src/grid/process_line_pattern_symbolizer.cpp index ca104a45b..91b3951d2 100644 --- a/src/grid/process_line_pattern_symbolizer.cpp +++ b/src/grid/process_line_pattern_symbolizer.cpp @@ -115,8 +115,8 @@ void grid_renderer::process(line_pattern_symbolizer const& sym, put(line, keys::smooth, value_double(smooth)); vertex_converter, grid_rasterizer, line_symbolizer, - CoordTransform, proj_transform, agg::trans_affine, conv_types> - converter(clipping_extent,*ras_ptr,line,common_.t_,prj_trans,tr,common_.scale_factor_); + CoordTransform, proj_transform, agg::trans_affine, conv_types, feature_impl> + converter(clipping_extent,*ras_ptr,line,common_.t_,prj_trans,tr,feature,common_.scale_factor_); if (clip) converter.set(); // optional clip (default: true) converter.set(); // always transform if (std::fabs(offset) > 0.0) converter.set(); // parallel offset diff --git a/src/grid/process_line_symbolizer.cpp b/src/grid/process_line_symbolizer.cpp index 44b431283..90aa017cd 100644 --- a/src/grid/process_line_symbolizer.cpp +++ b/src/grid/process_line_symbolizer.cpp @@ -26,7 +26,6 @@ #include #include #include - #include // agg @@ -36,9 +35,6 @@ #include "agg_conv_stroke.h" #include "agg_conv_dash.h" -// boost - - // stl #include @@ -91,8 +87,8 @@ void grid_renderer::process(line_symbolizer const& sym, } vertex_converter, grid_rasterizer, line_symbolizer, - CoordTransform, proj_transform, agg::trans_affine, conv_types> - converter(clipping_extent,*ras_ptr,sym,common_.t_,prj_trans,tr,common_.scale_factor_); + CoordTransform, proj_transform, agg::trans_affine, conv_types, feature_impl> + converter(clipping_extent,*ras_ptr,sym,common_.t_,prj_trans,tr,feature,common_.scale_factor_); if (clip) converter.set(); // optional clip (default: true) converter.set(); // always transform if (std::fabs(offset) > 0.0) converter.set(); // parallel offset diff --git a/src/grid/process_polygon_pattern_symbolizer.cpp b/src/grid/process_polygon_pattern_symbolizer.cpp index 8af5522f1..ae0b7f5d1 100644 --- a/src/grid/process_polygon_pattern_symbolizer.cpp +++ b/src/grid/process_polygon_pattern_symbolizer.cpp @@ -76,8 +76,8 @@ void grid_renderer::process(polygon_pattern_symbolizer const& sym, typedef boost::mpl::vector conv_types; vertex_converter, grid_rasterizer, polygon_pattern_symbolizer, - CoordTransform, proj_transform, agg::trans_affine, conv_types> - converter(common_.query_extent_,*ras_ptr,sym,common_.t_,prj_trans,tr,common_.scale_factor_); + CoordTransform, proj_transform, agg::trans_affine, conv_types, feature_impl> + converter(common_.query_extent_,*ras_ptr,sym,common_.t_,prj_trans,tr,feature,common_.scale_factor_); if (prj_trans.equal() && clip) converter.set(); //optional clip (default: true) converter.set(); //always transform diff --git a/src/grid/process_polygon_symbolizer.cpp b/src/grid/process_polygon_symbolizer.cpp index 9fffd3580..d096eb26e 100644 --- a/src/grid/process_polygon_symbolizer.cpp +++ b/src/grid/process_polygon_symbolizer.cpp @@ -54,7 +54,7 @@ void grid_renderer::process(polygon_symbolizer const& sym, typedef boost::mpl::vector conv_types; typedef vertex_converter, grid_rasterizer, polygon_symbolizer, CoordTransform, proj_transform, agg::trans_affine, - conv_types> vertex_converter_type; + conv_types, feature_impl> vertex_converter_type; ras_ptr->reset(); diff --git a/src/png_reader.cpp b/src/png_reader.cpp index 73ed4a342..93631d3a7 100644 --- a/src/png_reader.cpp +++ b/src/png_reader.cpp @@ -35,6 +35,7 @@ extern "C" #include // stl +#include #include namespace mapnik @@ -158,7 +159,7 @@ template void png_reader::init() { png_byte header[8]; - memset(header,0,8); + std::memset(header,0,8); stream_.read(reinterpret_cast(header),8); if ( stream_.gcount() != 8) { diff --git a/src/text/text_properties.cpp b/src/text/text_properties.cpp index ef4ba945f..e8ebcd11c 100644 --- a/src/text/text_properties.cpp +++ b/src/text/text_properties.cpp @@ -231,7 +231,7 @@ void text_symbolizer_properties::to_xml(boost::property_tree::ptree &node, } if (max_char_angle_delta != dfl.max_char_angle_delta || explicit_defaults) { - set_attr(node, "max-char-angle-delta", max_char_angle_delta); + set_attr(node, "max-char-angle-delta", max_char_angle_delta/(M_PI/180)); } if (upright != dfl.upright || explicit_defaults) { diff --git a/src/text/vertex_cache.cpp b/src/text/vertex_cache.cpp index 1ab4ea109..56790f879 100644 --- a/src/text/vertex_cache.cpp +++ b/src/text/vertex_cache.cpp @@ -128,14 +128,70 @@ vertex_cache & vertex_cache::get_offseted(double offset, double region_width) } offseted_line->reset(); offseted_line->next_subpath(); //TODO: Multiple subpath support - double seek = (position_ + region_width/2.) * offseted_line->length() / length() - region_width/2.; - if (seek < 0) seek = 0; - if (seek > offseted_line->length()) seek = offseted_line->length(); + + // find the point on the offset line closest to the current position, + // which we'll use to make the offset line aligned to this one. + double seek = offseted_line->position_closest_to(current_position_); offseted_line->move(seek); + offseted_lines_[offset] = offseted_line; return *offseted_line; } +inline double dist_sq(pixel_position const &d) { + return d.x*d.x + d.y*d.y; +} + +double vertex_cache::position_closest_to(pixel_position const &target_pos) +{ + bool first = true; + pixel_position old_pos, new_pos; + double lin_pos = 0.0, min_pos = 0.0, min_dist_sq = std::numeric_limits::max(); + + // find closest approach of each individual segment to the + // target position. would be good if there were some kind + // of prior, or fast test to avoid calculating on each + // segment, but i can't think of one. + for (segment const &seg : current_subpath_->vector) { + if (first) { + old_pos = seg.pos; + min_pos = lin_pos; + min_dist_sq = dist_sq(target_pos - old_pos); + first = false; + + } else { + new_pos = seg.pos; + + pixel_position d = new_pos - old_pos; + if ((d.x != 0.0) || (d.y != 0)) { + pixel_position c = target_pos - old_pos; + double t = (c.x * d.x + c.y * d.y) / dist_sq(d); + + if ((t >= 0.0) && (t <= 1.0)) { + pixel_position pt = (d * t) + old_pos; + double pt_dist_sq = dist_sq(target_pos - pt); + + if (pt_dist_sq < min_dist_sq) { + min_dist_sq = pt_dist_sq; + min_pos = lin_pos + seg.length * t; + } + } + } + + old_pos = new_pos; + lin_pos += seg.length; + + double end_dist_sq = dist_sq(target_pos - old_pos); + if (end_dist_sq < min_dist_sq) { + min_dist_sq = end_dist_sq; + min_pos = lin_pos; + } + } + } + + return min_pos; +} + bool vertex_cache::forward(double length) { if (length < 0) diff --git a/tests/cpp_tests/agg_blend_src_over_test.cpp b/tests/cpp_tests/agg_blend_src_over_test.cpp index 763324d81..9d8aec720 100644 --- a/tests/cpp_tests/agg_blend_src_over_test.cpp +++ b/tests/cpp_tests/agg_blend_src_over_test.cpp @@ -1,6 +1,7 @@ #include #include #include +#include #include #include #include @@ -32,7 +33,7 @@ color blend(color const& source, color const& dest, unsigned cover=255) dest_pre.premultiply(); unsigned char* buffer = new unsigned char[size*size*stride]; - memset(buffer, 0, size*size*stride); + std::memset(buffer, 0, size*size*stride); buffer[0] = dest_pre.r; buffer[1] = dest_pre.g; buffer[2] = dest_pre.b; @@ -62,7 +63,7 @@ color normal_blend(color const& source, color const& dest, unsigned cover=255) dest_pre.premultiply(); // source buffer unsigned char* source_buffer = new unsigned char[size*size*stride]; - memset(source_buffer, 0, size*size*stride); + std::memset(source_buffer, 0, size*size*stride); source_buffer[0] = source_pre.r; source_buffer[1] = source_pre.g; source_buffer[2] = source_pre.b; @@ -72,7 +73,7 @@ color normal_blend(color const& source, color const& dest, unsigned cover=255) // destination buffer unsigned char* dest_buffer = new unsigned char[size*size*stride]; - memset(dest_buffer, 0, size*size*stride); + std::memset(dest_buffer, 0, size*size*stride); dest_buffer[0] = dest_pre.r; dest_buffer[1] = dest_pre.g; dest_buffer[2] = dest_pre.b; diff --git a/tests/cpp_tests/geometry_converters_test.cpp b/tests/cpp_tests/geometry_converters_test.cpp index cfb6bbe4f..21ff702d9 100644 --- a/tests/cpp_tests/geometry_converters_test.cpp +++ b/tests/cpp_tests/geometry_converters_test.cpp @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include @@ -57,9 +58,11 @@ boost::optional linestring_bbox_clipping(mapnik::box2d bbox output_geometry_backend backend(output_paths, mapnik::geometry_type::types::LineString); typedef boost::mpl::vector conv_types; + mapnik::context_ptr ctx = std::make_shared(); + mapnik::feature_impl f(ctx,0); vertex_converter, output_geometry_backend, line_symbolizer, - CoordTransform, proj_transform, agg::trans_affine, conv_types> - converter(bbox, backend, sym, t, prj_trans, tr, 1.0); + CoordTransform, proj_transform, agg::trans_affine, conv_types, feature_impl> + converter(bbox, backend, sym, t, prj_trans, tr, f, 1.0); converter.set(); @@ -97,9 +100,11 @@ boost::optional polygon_bbox_clipping(mapnik::box2d bbox, output_geometry_backend backend(output_paths, mapnik::geometry_type::types::Polygon); typedef boost::mpl::vector conv_types; + mapnik::context_ptr ctx = std::make_shared(); + mapnik::feature_impl f(ctx,0); vertex_converter, output_geometry_backend, polygon_symbolizer, - CoordTransform, proj_transform, agg::trans_affine, conv_types> - converter(bbox, backend, sym, t, prj_trans, tr, 1.0); + CoordTransform, proj_transform, agg::trans_affine, conv_types, feature_impl> + converter(bbox, backend, sym, t, prj_trans, tr, f, 1.0); converter.set(); diff --git a/tests/cpp_tests/line_offset_test.cpp b/tests/cpp_tests/line_offset_test.cpp new file mode 100644 index 000000000..43a70ea41 --- /dev/null +++ b/tests/cpp_tests/line_offset_test.cpp @@ -0,0 +1,236 @@ + +// mapnik +#include +#include + +// boost +#include +#include + +// stl +#include +#include +#include +#include +#include + +// test +#include "utils.hpp" + +struct fake_path +{ + typedef boost::tuple coord_type; + typedef std::vector cont_type; + cont_type vertices_; + cont_type::iterator itr_; + + fake_path(std::initializer_list l) + : fake_path(l.begin(), l.size()) { + } + + fake_path(std::vector const &v) + : fake_path(v.begin(), v.size()) { + } + + template + fake_path(Itr itr, size_t sz) { + size_t num_coords = sz >> 1; + vertices_.reserve(num_coords); + + for (size_t i = 0; i < num_coords; ++i) { + double x = *itr++; + double y = *itr++; + unsigned cmd = (i == 0) ? agg::path_cmd_move_to : agg::path_cmd_line_to; + vertices_.push_back(boost::make_tuple(x, y, cmd)); + } + itr_ = vertices_.begin(); + } + + unsigned vertex(double *x, double *y) { + if (itr_ == vertices_.end()) { + return agg::path_cmd_stop; + } + *x = itr_->get<0>(); + *y = itr_->get<1>(); + unsigned cmd = itr_->get<2>(); + ++itr_; + return cmd; + } + + void rewind(unsigned) { + itr_ = vertices_.begin(); + } +}; + +double dist(mapnik::pixel_position const &a, + mapnik::pixel_position const &b) +{ + mapnik::pixel_position d = a - b; + return std::sqrt(d.x*d.x + d.y*d.y); +} + +namespace boost { namespace detail { + +template +inline void test_leq_impl(char const * expr1, char const * expr2, + char const * file, int line, char const * function, + T const & t, U const & u) +{ + if( t > u ) + { + BOOST_LIGHTWEIGHT_TEST_OSTREAM + << file << "(" << line << "): test '" << expr1 << " == " << expr2 + << "' failed in function '" << function << "': " + << "'" << t << "' > '" << u << "'" << std::endl; + ++test_errors(); + } +} + +} } + +#define BOOST_TEST_LEQ(expr1,expr2) ( ::boost::detail::test_leq_impl(#expr1, #expr2, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION, expr1, expr2) ) + +void test_simple_segment(double const &offset) +{ + const double dx = 0.01; + fake_path path = {0, 0, 1, 0}, off_path = {0, offset, 1, offset}; + mapnik::vertex_cache vc(path), off_vc(off_path); + + vc.reset(); vc.next_subpath(); + off_vc.reset(); off_vc.next_subpath(); + + while (vc.move(dx)) { + double pos = vc.linear_position(); + double off_pos = off_vc.position_closest_to(vc.current_position()); + BOOST_TEST_LEQ(std::abs(pos - off_pos), 1.0e-6); + } +} + +void test_straight_line(double const &offset) { + const double dx = 0.01; + fake_path path = {0, 0, 0.1, 0, 0.9, 0, 1, 0}, + off_path = {0, offset, 0.4, offset, 0.6, offset, 1, offset}; + mapnik::vertex_cache vc(path), off_vc(off_path); + + vc.reset(); vc.next_subpath(); + off_vc.reset(); off_vc.next_subpath(); + + while (vc.move(dx)) { + double pos = vc.linear_position(); + double off_pos = off_vc.position_closest_to(vc.current_position()); + BOOST_TEST_LEQ(std::abs(pos - off_pos), 1.0e-6); + } +} + +void test_offset_curve(double const &offset) { + const double dx = 0.01; + const double r = (1.0 + offset); + + std::vector pos, off_pos; + const size_t max_i = 1000; + for (size_t i = 0; i <= max_i; ++i) { + double x = M_PI * double(i) / max_i; + pos.push_back(-std::cos(x)); pos.push_back(std::sin(x)); + off_pos.push_back(-r * std::cos(x)); off_pos.push_back(r * std::sin(x)); + } + + fake_path path(pos), off_path(off_pos); + mapnik::vertex_cache vc(path), off_vc(off_path); + + vc.reset(); vc.next_subpath(); + off_vc.reset(); off_vc.next_subpath(); + + while (vc.move(dx)) { + double pos = vc.linear_position(); + double off_pos = off_vc.position_closest_to(vc.current_position()); + { + mapnik::vertex_cache::scoped_state s(off_vc); + off_vc.move(off_pos); + BOOST_TEST_LEQ(dist(vc.current_position(), off_vc.current_position()), (1.001 * offset)); + } + BOOST_TEST_LEQ(std::abs((pos / vc.length()) - (off_pos / off_vc.length())), 1.0e-3); + } +} + +void test_s_shaped_curve(double const &offset) { + const double dx = 0.01; + const double r = (1.0 + offset); + const double r2 = (1.0 - offset); + + std::vector pos, off_pos; + const size_t max_i = 1000; + for (size_t i = 0; i <= max_i; ++i) { + double x = M_PI * double(i) / max_i; + pos.push_back(-std::cos(x) - 1); pos.push_back(std::sin(x)); + off_pos.push_back(-r * std::cos(x) - 1); off_pos.push_back(r * std::sin(x)); + } + for (size_t i = 0; i <= max_i; ++i) { + double x = M_PI * double(i) / max_i; + pos.push_back(-std::cos(x) + 1); pos.push_back(-std::sin(x)); + off_pos.push_back(-r2 * std::cos(x) + 1); off_pos.push_back(-r2 * std::sin(x)); + } + + fake_path path(pos), off_path(off_pos); + mapnik::vertex_cache vc(path), off_vc(off_path); + + vc.reset(); vc.next_subpath(); + off_vc.reset(); off_vc.next_subpath(); + + while (vc.move(dx)) { + double off_pos = off_vc.position_closest_to(vc.current_position()); + { + mapnik::vertex_cache::scoped_state s(off_vc); + off_vc.move(off_pos); + BOOST_TEST_LEQ(dist(vc.current_position(), off_vc.current_position()), (1.002 * offset)); + } + } +} + +int main(int argc, char** argv) +{ + std::vector args; + for (int i=1;i offsets = { 0.01, 0.02, 0.1, 0.2 }; + for (double offset : offsets) { + // test simple straight line segment - should be easy to + // find the correspondance here. + test_simple_segment(offset); + + // test straight line consisting of more than one segment. + test_straight_line(offset); + + // test an offset outer curve + test_offset_curve(offset); + + // test an offset along an S-shaped curve, which is harder + // because the positions along the offset are no longer + // linearly related to the positions along the original + // curve. + test_s_shaped_curve(offset); + } + } + catch (std::exception const& ex) + { + std::cerr << ex.what() << "\n"; + } + + if (!::boost::detail::test_errors()) + { + if (quiet) std::clog << "\x1b[1;32m.\x1b[0m"; + else std::clog << "C++ line offset: \x1b[1;32m✓ \x1b[0m\n"; + ::boost::detail::report_errors_remind().called_report_errors_function = true; + } + else + { + return ::boost::report_errors(); + } +} diff --git a/tests/cpp_tests/symbolizer_test.cpp b/tests/cpp_tests/symbolizer_test.cpp index 0fb103be3..78bd55b22 100644 --- a/tests/cpp_tests/symbolizer_test.cpp +++ b/tests/cpp_tests/symbolizer_test.cpp @@ -33,9 +33,7 @@ int main(int argc, char** argv) if (!::boost::detail::test_errors()) { if (quiet) std::clog << "\x1b[1;32m.\x1b[0m"; else std::clog << "C++ exceptions: \x1b[1;32m✓ \x1b[0m\n"; -#if BOOST_VERSION >= 104600 ::boost::detail::report_errors_remind().called_report_errors_function = true; -#endif } else { return ::boost::report_errors(); } diff --git a/tests/visual_tests/grids/line-offset-900-250-1.0-grid-reference.json b/tests/visual_tests/grids/line-offset-900-250-1.0-grid-reference.json index 92ceb756f..772089b10 100644 --- a/tests/visual_tests/grids/line-offset-900-250-1.0-grid-reference.json +++ b/tests/visual_tests/grids/line-offset-900-250-1.0-grid-reference.json @@ -30,38 +30,38 @@ " ", " ", " ", - " !!! # ", - " !!! !!!!!! ## #### ", - " !!!!!!! !!!!!!!!! ! ####### ## ##### ", - " !!!!!!! !!!!!!!!!! !! ######## ############# ", - " !!! !!! !!!!!!!!!!! !! !!!! ### ### ######## ## ### $$$$$$ ", - " %% %%% !!!!! !! ! !!!!! ##### ## ## ##### $$ $$$ ", - " %% %%%%%% %% !!!! !! !!!!!!!! ##### # ######## $$ $$$$$$$ $ $ ", - " % %%%%%%%%%%%%%%%%% % %% !!!!! ! !! !! #### # ## ### $ $$$$$$ $$$$$$$$$$ $ ", - " % % %%%%%%%%%%%%%%% %%% % !!!! ! !!! ##### # # # $ $$$$$$$$$$ $$$$$$ $$$$ $ ", - " % %%%% %%% %%% %%% % !!! ! ! ##### # $$$$$$$ $$$$$$ $ ", - " % %%%%% %%%% !!! ! # # $$ $$$$$ $ ", - " %%%%% %%%%% % ! !! # # ## $ $$$$ $ ", - " % %%%% %%% % ! ! !!! # ### $ $$$ $ ", - " %%%% % % !!!! #### $ $ $ ", - " % %%% %% ! !! ! #### $$$$$ ", - " % %% &&&& & && %%%%% ''''' '''' '''''''' !!!! # (((((( (((( ((( ### $$$$$ )))))) )) ) )) $$$ $ ", - " % &&&&&&&&&&&&&&&&&&&&&&&&&&&&&& ! '''''''' '''' !!!! # (((((((((( (((( ### $$$$$ )))))))))) ))))))))))))))) ", - " % &&&&&&&& &&& %%%% !!! ' ' ! !! ( ( ## # $$$ ))))))))) ) $$$ $ ", - " % %%%% !!! !!! ### #### $$$ $$$ $ ", - " %%%%% !!! ! ! !! ### # ### $ $$$ $$ ", - " % % % !!! !! ## # # $$$ $$ $ ", - " % %%% %% % !!! ! !!! ! ### # # ### $ $$$$ $$$ $ ", - " % %%% %%%%%%% !!!! ! !!!!!! ### # # #### $ $$$$$$ $$$$$$$$ ", - " %%%%%%%% %%%%%%%% % !!! ! ! !!!! ### # # #### $ $ $$$$ $ $$$$$$ $ ", - " % %%%%%%%%%%%%%%%%%%%%%%% % !!!!! ! ! !!!! #### # ###### $ $$$$$$$$$$$$$$$$$ $$$$ $ ", - " % %%%%%% %%%%%% %%%% % !! !!! ! ! !! ###### # ## ## $$ $$$$$ $$$$$$$$$ $ $ ", - " %% %% %%%%%%% % %% !!! !!! !!! !! !! # ### ## ## ## ## $ $$$$$$ $$$ $$ ", - " %%% %%% !!!!!! !!!!!!! !! !!! ###### ######### # #### $$$$$ $$$$$ ", - " !!!!!! !! !!!!!!!! ###### ## ######## ", - " !!! !!!!!!!!! !!!! ## ########## #### ", - " !!!!!!!!! ! # ########## # ", - " !!!!!! ######### ", + " !! ## ", + " !! !!!!!!! # ####### ", + " !!!!!! !!!!!!!!! !!! ####### ############ ", + " !!!!!!!! !!!!!!!!! !!!! ######## ########## ### ", + " !! !!! !!!!!!!!!!! !!!!!!! ## #### ######## # ####### $$$$$$ ", + " %% %%% !!!! !! ! !!!!!! #### # ## ## ###### $$ $$$ ", + " %% %%%%%% %% !!!!!!! !! !! ##### # ## ## $$ $$ $$$$ $ ", + " % %%%%%%% %%%%%%%%% % %% !!!! ! !! #### # ### $ $$$$$$$ $$$ $ ", + " % %%%%%%%%%%%%%%%% %%% % !!!!!! ! ##### # # $ $$ $$$$$$$ $$$$ $ ", + " % %%% %%% %%% %%% % !!!!!! ! ! ##### # # $$$$$$ $ $$$$$$ $ ", + " % %%%%% %%%% !!!!! ! !!!! ### # ### $$$$$ $$$$$ $ ", + " %%%% %%%%% % ! !!!!! # # ##### $$ $$$$ $$$$ $ ", + " % %%%% %%% % ! ! !! # ## $ $$$$ $$$ $ ", + " %%%% % % ! !!! # ### $$$ $$ $ $ ", + " % %%% %%% ! !!!! # ### $$ $$$$$ ", + " % %% &&&& & && %%%%% ''''' '''' '''''''' ! !!! # (((((( (((( ((( ### $$$$$ )))))) )) ) )) $$$ $ ", + " % &&&&&&&&&&&&&&&&&&&&&&&&&&&&&& ! '''''''' '''' ! ! # (((((((((( (((( # $$$$$ )))))))))) ))))))))))))))) ", + " % &&&&&&&& &&& %%%% !!!! ' ' ! !!! ### ( ( # ### $$$ ))))))))) ) $$$ $ ", + " % %%%% !!! !!! ### # ### $$$ $$$ $ ", + " %%%%% !!! ! ! !!! ### # ### $ $$$ $ $$ ", + " % % % !!! !!! ### # ### $$$ $ $ ", + " % %%% %% % !!! ! ! !!! ### # # ### $ $$$$$ $$$ $ ", + " % %%% %%%%%%% !!!! ! ! !!!! #### # # ### $ $$$ $$ $$$$$$$$ ", + " % %%%%%% %%%%%%%% % !!!! ! ! !!!! #### # # #### $ $ $$$$ $ $$$$$$ $ ", + " % %%%%%%% %%%% %%%%%%%%% % !!! ! ! ! !!! ### # # ## #### $ $$$$$$$$$$$$$$$$$ $$$$ $ ", + " % %%%%%% %%%%%%%%%%% % !! !! ! ! !! ## ## # ## ## $$ $$$$$$$$$$$$$$$ $ $ ", + " %% %% %%%%%%% %% !!!! !!! !!! ### ## ## $ $$$$$$ $$$ $$ ", + " %%% %%% !!!!!!! !!!!!!! !! ####### ######### ### $$$$$ $$$$$ ", + " !!!!! !!! !!!!!!!! ##### ## ######## ", + " !! !!!!!!!!!! !!!!!! ### ######### ####### ", + " !!!!! !!!! !!! ########## #### ", + " !! !!! ######### ", " ", " ", " ", diff --git a/tests/visual_tests/grids/lines-5-200-200-1.0-grid-reference.json b/tests/visual_tests/grids/lines-5-200-200-1.0-grid-reference.json index 30a1bcc1b..491f08438 100644 --- a/tests/visual_tests/grids/lines-5-200-200-1.0-grid-reference.json +++ b/tests/visual_tests/grids/lines-5-200-200-1.0-grid-reference.json @@ -8,66 +8,66 @@ "5", "16", "6", - "11", "10", "12", + "3", "2", "13", "14", - "3", + "11", "15", "1" ], "data": {}, "grid": [ - " !!!! ! !!! ! !!!!! ", - " !!! !!!!! ! !! ! ", - " ! !!! !! ! !!!!! !!! ! ! ", - " !!!!!!! !!!!! !! !!!!! ", - " ! !!!!! ! !!!! !!! ! ", - " !!!!!!!! !!!!!!! !!!!!!! !!! ", + " ! !! ! !!!!! ! ! !!!! ", + " !! !!!! !! !!! !! !!!!! ", + " !!!! ! !!! !!! !! ! ", + " !! !!! ! !!! ! !!!!!!! ", + " !!!!!! ! !!!!! !!! !!! ! !! ", + " !!!!!!!!!!!! !!!!!!! !!! !!!!!! !!!!!! ", " !!!!!!!!!! !!!!!!!!! !!!!!!!! !!!! ", " !!!! !!!!! !!!!! !!!!!!!!!!!!!!!!!!!!! ", " !! # !!!!!!!!! # !!!!!!!!! !!!!!!!! ", - " #### !!!!!!! ### !!!!! $# !!!!!! ", - " ###### $$$$! ###### !!! ##$##$$$! ## %%% ", - " #######$#$ $!$######### ######$$$$####%%% ", - " #### ##$## ###########$ ##$#$$###$$####%%% ", - " &&&## $$#$#$#### ###$$##$$$$####%### %%% ", - " &&& $$$$$$$## ###$$$#$$ ####% %%%% ", - " &&& $$$$ $$####### #######$ $$$$$#%%%%%%%%% ", - " &&&$$$$$$$ ###$$# #$##### $$$$$$$%%% %%%%% ", - " &&$$$$$$$$$$#####$$##$$#$$##$$$$$$$$$%% %%%%% ", - " &&&$$$ $$$$$##$ $##$#$##$#$###$ $$$$$$ % %%% ", - " &&& $ $$$$$ ####$$$###$$##$ $$$%$ %%'%% ", - " &&& $$$ ## $$ ## #### %%%%%%'%% ", - " &&& &(( #((( (((### ((((( '''%'''%% ", - " &&&((&(&&( (((((( ())(((( (((((((''*''''*% ", - " &&((&&(((((((((((((()()))(((((((((((((** %%% ", - " &&&(&& &((((((( ((()))))(((((((( (((((* **%%**", - " &&& & &&(((( ++)((( ))((**((**********%**", - " &&& & &&(((,, +++--))).)))(.*(*(******** *%%*", - " &&& & ,,,,,, +++-)))).....(((*)******%%%**% ", - " &&& & ,&,,, +++))).......())(( %%%%%*%% ", - " &&& &,,,,,,, +++---)))))))(((()( % *%*%%% ", - " &&& ,,,,,//,,/,++----))))))(()))((( ***%%% ", - " &/&,/,,//,/,///++----))) (0000000 %%***%%% ", - " //////,/,,,/,,,/+---)))) 0000000 %%**%%%% ", - " ///,///,// , //---))) 0000000*%%%%%*%%% ", - " &// /////,,,, /// )))) ********%*%%*%%% ", - " &/& / /,/, /// )))) ***********%%%%% ", - " &&&/ //,, /// ))))))))))))) **** %%% ", - " //&////// /// )))))))))))) ** **** %%% ", - " &&& ///// //// ))))))))))) **** *%% ", - " / ///// ////// 111 * ** * ", - " /////////// 111111111111*** * ", - " /////////// 111111111111** * ", - " ///// //// 1111111111111 ", - " / /// /// 1 1111 ", - " / / /// 1 11 ", - " / /// 1 ", - " //// 1 1111 ", - " // 1111111 ", + " #### !!!!!!! ### !$$!! ## !!!!!! ", + " ####$$ $ !!! ###### $$$$$#$## !! ## %%% ", + " #####$##$$$$! ######### $ $$$##### ####%%% ", + " ####$##$## ##########$$ ###$$##########%%% ", + " &&&## $$$#$$$$#### ####$$$#$$$$ ####%### %%% ", + " &&& $$$$#$$$## #### #$$$$#$$ ####% %%%% ", + " &&& $$$$$$$$###$# # #$$##$#$ $$$$$#%%%%%%%%% ", + " &&&$$$$$$$ $##$$$ $$$$$$# $$$$$$$%%% %%%%% ", + " &&$$$$$$$$$$$$$$$$#$##$$$$$$$$$$$$$$$%% %%%%% ", + " &&&$$$ $$$$$$$$ $#######$$$$$$$ $$$$$$ % %%% ", + " &&& $ $$$$$ $##$$### $$$$$ $$$%$ %%'%% ", + " &&& $$$ $$ $ %%%%%%'%% ", + " &&& &(( (((( (((( ((((( '''%''')% ", + " &&&((&(&&( (((((( ((((((( (((((((''')''))% ", + " &&((&&(((((((((((((((((((((((((((((((( )))%)) ", + " &&&(&& &((((((( ((((((( ((((((( ((((( )) %)))", + " &&& & &&(((( **+((( (((()()()))))))) )%))", + " &&& & &&(((,, ***++-.......(())))))))))) ))%)", + " &&& & ,,,,,, ***-++......(((()/))))))%%%))%)", + " &&& & ,&,,, ++*-+++......(///( %%%%%)%) ", + " &&& &,,,,,,, *+*--+++////((((/(((( % )%)))) ", + " &&& ,,,,,++,,+,**+++-//////(/(((/ )))%%% ", + " &&&,,,,++,+,+++**-++-/// 0000000 %%)))%%% ", + " &&&,,,,+,,,+,,,+*-+-+/// 0000000 %%))%%%% ", + " &&&,,,+,++ , ++---/// 0000000)%%%%%)%%% ", + " &&& +++,,,, +++ //// ))))))))%)%%)%%% ", + " &&& +,+, +++ //// )))))))))))%%%%% ", + " &&& ++,, +++ ///////////// )))) %%% ", + " &&& ++++ +++ ////////////)) ))) %%% ", + " &&& ++++ ++++ / /////////// ) ))) %%% ", + " +++++ ++++++ // / 111) ", + " +++++++++++/ ///11111)))))) ", + " ++++++++ /// //111111))1))))) ", + " +++++++ // ///111111111111 ", + " ++++ ++ /// 1 1111 ", + " +++ ++ 1 11 ", + " +++ + + 1 ", + " ++++ ++++ 1 1111 ", + " + 1111111 ", " ", " " ] diff --git a/tests/visual_tests/grids/lines-5-400-400-1.0-grid-reference.json b/tests/visual_tests/grids/lines-5-400-400-1.0-grid-reference.json index 0c8882415..9d1cd1e52 100644 --- a/tests/visual_tests/grids/lines-5-400-400-1.0-grid-reference.json +++ b/tests/visual_tests/grids/lines-5-400-400-1.0-grid-reference.json @@ -8,8 +8,8 @@ "7", "16", "6", - "2", "10", + "2", "12", "13", "14", @@ -24,18 +24,18 @@ " ", " ", " ", - " ! ! !! ! ", - " !!!! ! ! !!! ! !!!! ", - " !!!! !! !!!!! !!!!! ! ! !!! ! ", - " !!!! ! ! !! ! !! !! !! ! !!! ! ", - " ! !!! !!!! ! !!! !!!!!! !!! !!!! ! ! ", - " !! !!!!!! !! !! ! !!!! !!!! ! !!! !!! !!! !!! ", - " !!! !!!!!!!!! !!! ! !!!!!!!!! !!! ! !!!!! !!!!!! !! ", - " ! !!!!!!!!!!!!!!!! ! !!!!!!!!!!! !! !!!!!!!! !!!! !!! ", - " !!!!!! !!!!!!! !! !!!!! !!!!!! !! !!!!!!!!!!! ! !!! !!!!! ", - " !!!!!! !!!!! !!! !!!!!! !!!!! !!!! !!!!!! !!!!!! !!!!!!!!!!!! ", - " !!!!! !!!!! ! !!!!!! !!!!!!! !!!!!! !!!!! ! ! !!!!! ", - " !!!! !!!!!! !!!!!! !!!!!!! !!!!! !!!!! !!!!!! ", + " !!! ! ", + " !!! ! !!! ! !! ", + " ! ! ! !! !! !! !! !!!! ", + " !!! ! ! ! ! !!!! !!!! !!! ! ", + " ! !!! !!!! ! !!!!!!! ! ! !!!! ! !! ", + " !!!! !!!!!! !! !!! ! !! !!!! !!!! ! !!!! ! !!! !! ", + " !!! !!!!!!!!! !!!! ! !!!!!!!! !!!!! !!!!! !!! !!! ! !!!! ", + " ! !!!!!!!!!!!! !!!! !!!!!!!!!!! ! !!! !!!!!!!! ! ! !!! ", + " !!!!!! !!!!!! !!! ! !!!!! !!!!!! !!! !! !!!!!!!!!!! !!! !!!!! ", + " !!!!!! !!!!! !!! !!! !!!!!! !!!!! !! ! !!!!!!! !!!!!! !!!!!!!!!! ", + " !!!!! !!!!! !!!!! !!!!!! !!!!!!! ! !!!!!! !!!!! !!!!! ", + " !!!! !!!!!!! !!!!!!! !!!!!! !!!!! !!!!! !!!!!! ", " ! !!!!! !!!!!! !!!!!!!!!!! !!!!!!!!!!! ", " !!!!!!!!! !!!!!!!!! !!!!!!! ", " # !!!!!!! # !!!!!! !!!!! ", @@ -46,15 +46,15 @@ " ###### ###### ###### ##### ###### ##### ###$$$$$$$$ ", " ##### ###### ##### ###### ##### ###### #####$$ $$$$$ ", " %%%%#### ##### ###### ###### ##### ###### ###### $$$ ", - " %%%% # & &&& #####&&&&##### & & ##### ###### #&######## $$ $$$ ", - " %%%% & & && ###&&#&&#### & ###########& #&###### $$ $$$$ ", - " %%%% & &&#&#&### &&& ##&#####&& & &&& &&### $$$$$ $$$ ", - " %%%% &&&&& & &&#&&# &&& ##&##&&& &&& && &&&& $ $$ $$$ ", - " %%%%%% &&&&&&&& &&## & && &## && && &&&&&& $$$$$ ", - " %%%%% &&&& && &&&#&&&&& &&& &&&&&& & &&&&&&&&&& && $$$ ", - " %%%%%% &&&&&&&&& &&& &&&&&&&& && &&& &&&&&&&& && & &&&&&&&&&&& $$$ ", - " %%%%%% &%&&&&&&& &&& &&&&&&&&&&& &&&&&&&&&&&&&& &&& &&&&&&&&&&&& $$$ ", - " %%%%%%&&&&&&&&&&& &&&&&&& &&&&&& &&&&&& &&&& && &&&&&& &&&& & $$$ ", + " %%%% # & ##### & ##### ##### ###### ########## $$ $$$ ", + " %%%% && & ####&&###### & ######&#### ######## $$ $$$$ ", + " %%%% & && #&&&##### &&&& & ####&&&# & ##### $$$$$ $$$ ", + " %%%% &&&& &&& &&###&&& &&&&& ####&&&&& ## ## $ $$ $$$ ", + " %%%%%% & & && && & &&&&& &&&&& #&#& & &&## ###### $$$$$ ", + " %%%%% &&&& && &&&&#&&&&& &&& &&&&&& && && &&&&&### # $$$ ", + " %%%%%% &&&&&&&&&& &&& &&&&&&&& && &&& &&&&&&&& && &&&&&&&&&&&&##### $$$ ", + " %%%%%% &%&&&&&&& & & &&&&&&&&&&& &&&&&&&&&&&&&& &&&&&&&&&&&&&&&## # $$$ ", + " %%%%%%&&&&&&&&&&& &&&&&& &&&&&& &&&&&& &&&&& &&&&&&&& &&&& # & $$$ ", " %%%%%%%%%& &&&& &&&&&& &&&& &&&&& &&&& &&&&& &&&&&&&&& $$$ ", " %%%%%%&%% &&&&&&&&&& &&&&&&&&&& &&&&&&&&&& &&&&&&&& $$$ ", " %%%%%%%% &&&&&&&&& &&&&&&&& &&&&&&&& &&&&&& $$$ ", @@ -65,49 +65,49 @@ " %%%% ''''''''''''$$$$$ ", " %%%% (( ((((( ((((( ((((((( '''''''''$'''$$$$ ", " %%%% ((((((( (((((((( (((((((( ((((((((( ''''''''$$$'$$$$$ ", - " %%%% ((((((((( (((((((((( ((((((((((( ((((((((((( ''''' ' $ $$$ ", - " %%%% %(((((((((( (((((( (((( (((((( ((((( (((((( (((( ''' ''' $$$ ", - " %%%%%%(((( ( ((((( (((((( (( (((( ((((( ((((( ((((( (((( (( '' ''$$ ", - " %%%%%%((% (((((((( ((((((((( ( ((((((((((( ( (((((((((( ((((((((( '''' ''$$$ ", - " %%%%%%( (( ((((((((((((( ((((((((( (( (((((((( (((((((((( ' ' '$$$ ", - " %%%%%% % ( (((((((())( (((((((((( ( ((((( (*** (( (((( $$$ ", - " %%%%% %%% ( (((( ))))(( ((++ (((((( (( ( ( ((((*********(*(***** $$$$$$ ", - " %%%%%%%%% ((( ( )))))((((((++ ,,,( (( (( ( *((*****(*((((****** $$$$$$$$ ", - " %%%% %% ((( )))))) ( +(( ,,, ((((------------ (**(*****((***********$$ $$$$$ ", - " %%% %% ( (( ()))) ((+ ,,, ((------------((((( (((((((((***** $$$ ", - " %%% ())))) +++ ,,, (------------((-( ((((( **$$ $$$ ", - " %%% ))())) ..++ ,,, ////////////// **$$ $$$$ ", - " %%% ))))) ..... ,,/// ////////////////////// $$$$$ $$$ ", - " %%% )))))))) .+... ,//, / /////////////////////// *$*$$ $$$ ", - " %%% )))))) )) ) ....++..,/// //////////////////////// *** $$$$$ ", - " %%% ))))) ))).)..... ..+...,,/ //// *** $$$ ", - " %%% )))))) ))).)))........ ..+ /,, / /// *** $$$ ", - " %%% )).)) ) ..)..............+ ,/, ///// *** $$$ ", - " %%% )).)) .)))). .......+.++,// / /// 000000000000000 *** $$$ ", - " %%%)))).. .. ))).. ...+++,,,,// /// 000000000000000 **** $$$ ", - " %%% ))). . ..).. .... ,,,,// /// 000000000000000 **** $$$ ", - " %%% )). . ..... ....,,,, /// *** $$$ ", - " %%% .. . .... .....,, /// **** ****$ $$$$ ", - " %%% .. ..... .... /// *********************$$$$$$$$$ ", - " %%% . ... ... /// *********************$$$ $$$$$ ", - " %%% . ... ... /// ********************* $ $$$$$ ", - " %%% .. ... ... //// **** * $$$$$ ", - " %%% .... ... ///// ** * $ $$$$$ ", - " %%% .... ... /////////////////////// $$$$$$$$$ ", - " %%% .... .... /////////////////////* ****** $ $$$ ", - " %%% .... ....... ////////////////////*** **** $$$ ", - " %%% .... ... ... // ////////////////// $$$ ", - " .... ..... . ////// / /// $$$ ", - " .... ....... .. // / / /// / /// ", - " .... ......... . // // /// / ", - " .......... ..... . . .. ////// /////1/1/111111111111 ", - " . .............. . ... ////11111//111//111111111111 ", - " . ............ ... 11111111111111111111111111 ", - " . .... .... . 11111111111111111111 ", - " .. ... . 1111 11 ", - " ... 111 11 ", - " ..... 11 1 11 ", - " ..... 111 11111 ", + " %%%% ((((((((( (((((((((( ((((((((((( ((((((((((( ) ) $ $$$ ", + " %%%% %(((((((((( (((((( (((( (((((( ((((( ((((((( (((( ))))) ) $$$ ", + " %%%%%%(((( ((((( (((((( ( (((( ((((( ((((( ((((( ( ( (((( )))))) $$$ ", + " %%%%%%((% (((((( ((((((((( ( (((((((((( ( (((((((((( ( ((((()))(( $$$ ", + " %%%%%%( ( (((((((((((((( (((((((((((( (((((((( (((()))(( ) $$$ ", + " %%%%%% % ((((((((((**( (((((((((( (( ((((( ))) (( (( ()(() ) )) $$$ ", + " %%%%% %%%((( ((((((( ****(((((++ (( ((( ((( (( (( ( ))(((())())))))))) ) $$$$$$ ", + " %%%%%%%%%((( (( ****(*((((((+ ,,(, (( ( (((( )((()))(())))))))))) $$$$$$$$ ", + " %%%% %% ((( ( ******(( (((+ ,,, ((------(((--((- ))()))(()))))))))))))$$ $$$$$ ", + " %%% %% (( ***** +++ ,,,( (-------(((((-( ))))) $$$ ", + " %%% (((***** +++ ,,, (---------((((--( ))$$ $$$ ", + " %%% ****** ++. ,,, , ////////////// ))$$ $$$$ ", + " %%% ***** .+++ ,,,,,,,,///////////////////// $$$$$ $$$ ", + " %%% ******** .. +....,,,, , ,,///////////////////// )$)$$ $$$ ", + " %%% ****** ** * ....++..,,,,, ,,,//////////////////// ))) $$$$$ ", + " %%% ***** ***.*..... .+...,, ,,/,,/ ))) $$$ ", + " %%% ****** ***.***........ +.+..,, , ,// ))) $$$ ", + " %%% ***** * ..*............+.. ,,, , ,,/ ))) $$$ ", + " %%% *****. .****. .......+.+.,,,,, ,,/ 000000000000000 ))) $$$ ", + " %%%*****. .. ***.. ...+++,,,, /,/ 000000000000000 )))) $$$ ", + " %%% **.. . ..*.. .... ,,,, /// 000000000000000 )))) $$$ ", + " %%% ** . . ..... ....,,,, /// ))) $$$ ", + " %%% . . .... .....,,/ /// )))) ))))$ $$$$ ", + " %%% . .... .... //// /// )))))))))))))))))))))$$$$$$$$$ ", + " %%% . . ... ... / ///// )))))))))))))))))))))$$$ $$$$$ ", + " %%% ... ... ... // ///// ))))))))))))))))))))) $ $$$$$ ", + " %%% .. ... ... // ///// )) )))) )) ) $$$$$ ", + " %%% .... ... // / ///// ) ) )) )))))) $ $$$$$ ", + " %%% .... ... / ////////////////////))//// $$$$$$$$$ ", + " %%% .... .... / // ////////////////)))))) )) )))) ) )) $ $$$ ", + " %%% .... .... // /////////////////)))/))) ) ))) $$$ ", + " %%% .... ... .. ////////////////// $$$ ", + " .... .... .. //// // $$$ ", + " .... ........ . /// // ", + " ..... ......... . // // ", + " . .......... ......... .. ///111///11111111111 ", + " .. . .............. . .. 111111/11/11///11111111111 ", + " . .. ............ .. . 11111111111111111111111111 ", + " ... .. . .... ... 11111111111111111111 ", + " .. .. . 1111 11 ", + " . ... 111 11 ", + " . .. 11 1 11 ", + " 111 11111 ", " 1 111111 ", " ", " ", diff --git a/tests/visual_tests/grids/lines-5-600-600-1.0-grid-reference.json b/tests/visual_tests/grids/lines-5-600-600-1.0-grid-reference.json index 2e0f0b9b4..ff97137ef 100644 --- a/tests/visual_tests/grids/lines-5-600-600-1.0-grid-reference.json +++ b/tests/visual_tests/grids/lines-5-600-600-1.0-grid-reference.json @@ -8,9 +8,9 @@ "7", "16", "6", + "10", "2", "12", - "10", "13", "14", "11", @@ -26,25 +26,25 @@ " ", " ", " ", - " ! ", - " ! !!! ", - " !!! !! !! ! ", - " ! ! !!! !! ! ", - " !! !! ! !! ! !!! ", - " !!!! ! !!! !!!!! ! !!! ! ", - " !!! !! !!!! ! ! !!! !!! ! ! ! !!!!! ", - " ! ! ! !!!!! ! !!! ! !!!! !!!! ! ! !!!! !! ", - " ! ! !!!!!!!!! !!!! ! !!!!! ! ! ! !! ! ! ", - " !!!! !!!!!!!!!!!!!!! !!! !!!!!!! ! ! ! !!!!!! !! !!!!! ! ", - " ! ! !!!!!! !!!!! ! !! ! !!!!!!!!!! !! !! !!! !!!!!!!! ! !!! !!! !!! !! ", - " !!!!!!!!!!! !!!!! !! ! ! !!!!! !!!!!!!!! !! ! !!!!!!!!!!! !! !! ! !!!!!!!! ", - " !!! !!!!!! !!!!!!!!! !!!!!!! !!!!!! !!!!!!!!!! ! !! ! !!!!!! !!!!! ! !!!!!!!!!!! ", - " ! !!!!!! !!!!! !!! !!! !!! !!!!!! !!!!! !!! !!! ! ! !!!!! !!!!!! ! ! !! !!!!! ", - " !!!!!!! !!!!! ! ! !! !!!!!! !!!!! !!! ! ! !!!!!! !!!!!!!!! ! !!!!!!! ", - " !!!!!! !!!!! ! !! !!! !!!!!! !!!!!! !!!! !!!!!! !!!!! ! !! !!!!!!! ", - " !!!!! !!!!!!! !!! !!!!! !!!!!! !!! !!!!! !!!!! !! !!!!! ", - " !!! !!!!! !!!!!!! !!!!! ! !!!!!! !!!!!! !!!!!! ", - " !!!!! !!!!!! !!!!!! !!!!!! !!!!!! !!!!!! ", + " ", + " ", + " ! ", + " ! !!!! !! ", + " ! ! ! ! ! ! ", + " !! ! !! ! !!! !!!!! ", + " !! ! !!! !! !!!!! !!! !! ", + " !!! ! !!!!! ! !!! !! !! !!! !!!!! ! !!!! ! ", + " ! !! !! !!!!!!!! !! !!!! !!!!! ! !! !! ! ! !!!! !! ", + " !! !!! !!!!!!!!!!!!! !!! !! !!!!!!!!! !!!!! !!!!! !!!! !! ! ! !! ", + " ! !!! ! !!!!!! !!!!! !! ! ! !!!!!!!!!!!! ! !! !!! !!!!!!!!! !!! !! ", + " ! ! !!!!!! !!!!! ! ! !!! !!!!! !!!!!! !!! !! !!!!!!!!!!!!!! ! ! !! !!!!!! ", + " ! ! !!!!!! !!!!!! ! ! ! ! !!!!!!!! !!!!!! !!! ! !!!!!!!!!!! !!!!! ! ! !!! !!!!!! ", + " !!!!!! !!!!! ! !!! ! !!!! !!!!!! !!!!! !!! !!!!! ! !! !!!!! !!!!!! ! !!! ! !!!!! ", + " !!!!!!! !!!!! !! !! ! !!!!!! !!!!! !!! !!! ! !!!!!!! !!!!!! !! ! !!!!!! ", + " !!!!!! !!!!! !! ! !!!!!! !!!!!!!!!! !!!!!!! !!!!! !!! !! !!!!!! ", + " !!!!! !!!!!! ! ! !!!!! !!!!!!!!!!! !!!!! !!!!! ! !! !!!!! ", + " !!! !!!!! !!!! !!!!!! !!!!! !!! !!!!!! !!!!!! !!!!!!!! ", + " !!!!! !! !!!!!! !!!!!! !!!!!! !!!!!! !!!!!! ", " !!!!! !!!!!! !!!!!! !!!!! !!!!!!!!!! ", " !!!!!!!!!!! !!!!!!!!! !!!!!!!! ", " !!!!!!! !!!!!! !!!!! ", @@ -52,29 +52,29 @@ " ##### !!! #### ! # $$$$ ", " ######## ###### ### $$$$ ", " ########## ######### ##### ## $$$$ ", - " ###### ###### ###### ##### ######### ####$ $$$$ ", - " ###### ###### ######## ##### ########### #####$ $ $$$$ ", - " ###### ##### ###### ########### ##### ##### ######$$$$$$$$$ ", - " ########### ##### ###### ######### ################ ##### $$ $$$$$$ ", - " ###### ### # # ## ###### ##### ## ##### ######## ## ##### ###### $ $$$$$$ ", - " ##### # #### ######### ###### ## ##### ##### ###### ###### $$$$$$ ", - " %%% ### ### ### ##### ###### ## ###### ##### # ## ###### ######### $$$$$ ", - " %%% #### ## # ##### ###### # ##### ###### # #### ##### ###### ### $$ $$$$$$ ", - " %%% ## ### # ###### ###### # ##### ###### # #### ############## # $$$$ ", - " %%% %% ## ##### ##### ## ###### ##### # & ############ #### $$$$ ", - " %%% %%%%% & ## ########### & ##&&###### & # &&& ##### # ## $$$$ ", - " %%%%% % & &&& & ### ##&&&#### & &&&& &#&&#### && & &&&& ## #### $$$$ ", - " %%%%% % && && ## #&&&##& && & &&&& &&&& &&& & ### $$$$ ", - " %%%%% %% &&& & &&&&#&#&& &&& &&&& &&&& && &&&& & && & && $$$$ ", - " %%% % %%% && & && &&& &&&& && &&& & & && && & & & &&&& &&&&& &&& $$$$$$ ", - " %%% %%% & && && & &&&&& &&&&& && & &&&&&&&&&&&&& &&& &&&&&&&&&&&&&& && $$$$$$$$$ ", - " %%%% % &&&&&&&& & & & & &&&&&&&&& && &&& &&&&&&&&&&&&&& &&& &&&&&&&&&&&&&& $$ $$$$$$ ", - " %%% &&&&&&&&&& && & &&&&&&&&&&&& & & &&&&&&&&&&&&&& &&&&&&&&&&&&&&&&& $ $$$$ ", - " %%% &&&&&&&&&&&&& & &&&&&&& &&&&&&& &&&&&& &&&&&& & &&&&&& &&&&& & $$ $$$$ ", - " %%% &&&&&& &&&& && &&&&&& &&&& & &&&&&& &&&& &&& &&&&& &&&& & & $$ $$$$$ ", - " %%% &&&&& &&&&&&&& &&&&& &&&& && &&&&& &&&&&& &&&&& &&&& && & $$$$ $$$$ ", - " %%% &&&&& &&&&&&&& &&&&& &&&&& &&&&& &&&& & &&&&&& &&&& &&&& $$ $$$$ ", - " %%% &&& &&&&& &&&&&& &&&&& &&&&&& &&&&&&&&&&&&& &&&&&&&&&&&& $$$$$$ ", + " ###### ####### ###### ##### ######### ####$ $$$$ ", + " ###### ######### ############## ########### #####$ $ $$$$ ", + " ###### ########## ###### ########### ##### ##### ######$$$$$$$$$ ", + " ####### ###### ###### # # # ###### ##### ###### ##### $$ $$$$$$ ", + " ###### ## ## ###### ##### ##### ###### ##### ###### $ $$$$$$ ", + " ##### ## ## ###### ###### # ## ##### ##### ###### ###### $$$$$$ ", + " %%% ### ### ### ###### ###### ####### ###### ##### ## ###### ######### $$$$$ ", + " %%% # # ######## ######## # ### ##### ###### ## ######### ###### ## $$ $$$$$$ ", + " %%% # ######### ############ ##### ###### ### ### ############## ## $$$$ ", + " %%% %% ### ## ##### ##### ## ### ###### ##### & ### # ############ ## # $$$$ ", + " %%% %%%%% & & ### ### #######&### ## #### && ########## &&& ### # ##### # ## $$$$ ", + " %%%%% % & &&& #### # ###&&&### # #### &&&& & ####### &&&& # ## ## #### $$$$ ", + " %%%%% % &&& #### &##&&&#& # ## && & & && #### & &&& ## ### $$$$ ", + " %%%%% %% & & # &### & # # &&&&& ## &&&&& & # $$$$ ", + " %%% % %%% &&&&&& # && &&&&& & &&& & & && & &&&&& & & $$$$$$ ", + " %%% %%%&&&&& && & & & & &&&&& & & &&&&&&&&&&&&& &&& & &&& &&&&&&&&& &&& && $$$$$$$$$ ", + " %%%% % & &&&&&&&& & &&& & & &&&&&&&&& &&&&& & &&&&&&&&&&& &&&&& & &&&&&&&&&&& && &&& $$ $$$$$$ ", + " %%% &&&&&&&&&& & & &&&&&&&&&&&& & &&&& &&&&&&&&&&&&& &&& &&&&&&&&&&&&&&& && $ $$$$ ", + " %%% &&&&&&&&&&&&& && & &&&&&&& &&&&&&&& & & &&&&&& &&&&&&& && &&&&&& &&&&&& & $$ $$$$ ", + " %%% &&&&&& &&&&& & && &&&&&& &&&& &&& && &&&&&& &&&& && &&&& &&&&& &&&& &&& $$ $$$$$ ", + " %%% &&&&& &&&&&&&& & &&&&& &&&& &&&& &&&&& &&&& &&&& &&&&& &&&& & & $$$$ $$$$ ", + " %%% &&&&& &&&&&&&&&& &&&&& &&&&& & &&&&& &&&& &&&&&& &&&& &&&& $$ $$$$ ", + " %%% &&& &&&&& & &&&&&& &&&&& &&&&&& &&&&&&&&&&&&& &&&&&&&&&&&& $$$$$$ ", " %%% & &&&&&&&&&&&& &&&&&&&&&&& &&&&&&&&&& &&&&&&&&& $$$$ ", " %%% &&&&&&&&& &&&&&&&&& &&&&&&&& &&&&&& $$$$ ", " %%%%% &&&&&&& &&&&&& &&& & $$$$ ", @@ -86,69 +86,69 @@ " %%%% %% '''''''''''''''''$$$$$$$$$ ", " %%%%%% % '''''''''''''''''$$ $$$$$$ ", " %%% ((( (((((( ((((((( '''''''''''''''''$' $$$$$$ ", - " %%% ((((((( (((((((( ((((((((( ((((((((((( ' ' $$$$$$ ", - " %%% (((((((((( ((((((((((( (((((((((((( ((((((((((((( '''''' $ $$$$$ ", - " %%% ((((((((((((( ((((((((((((( (((((((( ((((( (((((( ((( (((( $$ $$$$$$ ", - " %%% ((((((( ((((( (((((( (((((( ((((( ((((( (((( ((((( ( (((( '' ' ' ' $ $$$$ ", - " %%% (((((((((( (((( (((((((((((( ((((( (((((( ((((( ((((( ((((( ((( (((( ( '''' $$$$ ", - " %%% ((((((( ( ( (((( ((((( ( ( (((( ((((( ( (((( (((((( ( ( ( ((((( ((( $$$$ ", - " %%%%% (((( ( ( (((( ((((( ( (( (((( ((((( ( ((((( (((((( ( (((( (((((((((((( $$$$ ", - " %%% %% %( ((((( (((((( (((((( (((((( ((((((((((( ( ((( (((((((((( ( ( ( (((((((((( $$$$ ", - " %%% %%%% (((( ( (((((((((((( ( ((( ((((((((( ( ( ( (((((((( (( ((((((( $$$$ ", - " %%%% %% ( ( ((((((((( )) (( (((((( (( ((((( ( ( (( ( $$$$$$$ ", - " %%% % %% (( (((((((( )))) *(* (( ( ( ( (( ((( +++++++ ((( ( $$$$$$$$$ ", - " %%% %% ( (( ))))) **** ( ((((( ( (((((( ++++++++++++++++++((+++++++ $$ $$$$$$ ", - " %%% % % ((( )))))) **** ( ,,,(( ( ((((+++++++++++++++++((+++((((+++ $$$$$$ ", - " %%% %%%% ((( ())))) *** ((,(( (( -- (( (( (( .++.++++++++++++(((+(+((++++++ $$ $$$$$$ ", - " %%% %% ( (((())) *** (((,(( -----.--....---(-((((- ....... ( ( +++++++++ $$ $$$$$ ", - " %%% (((((())) *** (,(, -----..-...----------- ...... +++++ $$$$ $$$$ ", - " %%% ))))))) ) *** ,,, -----.---------------- .. .. ++++ $ $$ $$$$ ", - " %%% ))))))) ) **** ,,, ...... .. ... ... ++++ $$$$$$ ", - " %%% )))))))) ))) **** ,,, ..... ... . . ... ++++ $$$ ", - " %%% ))))) ) ) ))) **** ,,, ........................ +++ $$$ ", - " %%% ))))) ) ) / /// *** ,,,, . ................................ +++ $$$ ", - " %%% %% )))))) ))) ///// *** ,,,, ... . ................................ +++ $$$ ", - " %%% %%%% ))))) ))) / / *** ,,,. . . .................... +++ $$$ ", - " %%% %%%%% )))))) / //// *** ,,, .. ...... +++ $$$ ", - " %%% % % )))))) //// /// **** ,,, .. ...... +++ $$$ ", - " %%% % %% ))))) /////////// // ///* ,,,.... ... +++ $$ $$$$ ", - " %%% % %% )))))) ///////////////// / */* ,,,,. .. ... +++$$$$$$$$$ ", - " %%% % % )))))) //////////////////////***//,,,, .. ... +++$$$ $ $$$ ", - " %%% %% ))))) ))) ) ////// //////// //*///,,,, ..... +++ $ $$$$$ ", - " %%% %% )))))))))))))) ///// //// ***///,, .... 00000000000000000000000 ++++ $$$$$ ", - " %%% )))))))) ) )))////// /////*/ //,, .... 00000000000000000000000 ++++ $ $$$$ ", - " %%% ))))) )))////// /////// ,,, ... 00000000000000000000000 +++ $$ $$$$$ ", - " %%% ))) ///// //// / /,,, ... 00 00 0 +++ $ $$$ ", - " %%% )) ))) //// //// ,,,, ... 000000 +++ $$$ ", - " %%% ) /// //// ,,,, ... ++++ $$$ ", - " %%% //// ///// ... 0000 0000 ++++ $$$ ", - " %%% % //// //// ... +++0+0+0+000++++++++++++++++++++++ $$$ ", - " %%% %% %% /// /// .... +++++++++++++++++++++++++++++++++ $$$ ", - " %%% % /// //// ....... +++++++++++++++++++++++++++++++++ $$$$$$ ", - " %%% %% /// /// ... ..... + + +++++++++++ $$$$$$$$ ", - " %%% %% %% /// /// .. . ... ++++++ +++++++ $$ $$$$$ ", - " %%% %% %% / /// /// .. . .... + ++++++ $$$$$$ ", - " %%% %% %% // ////// //// .. ....... ++++ + ++ $$ $$$$$ ", - " %%% % % / / ////// /// / // . ......... +++ + +++++ $$ $$$$ ", - " %%% /// /// ///// / / .. .. ...... +++ + $$$$ $$$ ", - " %%% // ////// ////// .. ............................... $ $$ $$$ ", - " %%% // ////// /// // / . .............................. $$$$$ ", - " %%% / // //// /// // / ............................ $$$ ", - " %%% // /// //// ///// / .. ... . ... . $$$ ", - " / //// //// / . ... . . . $$$ ", - " //// ///// / .. .. ", - " //// ////// ......... .... .... ", - " //// ////// .. ... . . ... ", + " %%% ((((((( (((((((( ((((((((( ((((((((((( ' '' $$$$$$ ", + " %%% (((((((((( ((((((((((( (((((((((((( ((((((((((((( ' ''' '$ $$$$$ ", + " %%% ((((((((((((( ((((((((((((( ((((((( ((((( (((((((( (((( $$ $$$$$$ ", + " %%% ((((((( ( ((((( (((((( ( ( ((((( ((((( (( (((( ((((( ((( (((( '' '''' $ $$$$ ", + " %%% ((((( ((( (((( (((((( ((( ((((( (((((((((( ( ((((( ((((((((( (((( ( '''''' $$$$ ", + " %%% ((((( ((( (((( ((((((((( (((( ((((( ( ( (((( (((((((((( ( ((((( ((( $$$$ ", + " %%%%% (((( ( ( (((( ((((( ( (( (((( ((((( ( ( (( ((((( (((((( ( (((( ((((((())()))) $$$$ ", + " %%% %% %( (((( (((((( (((((( ( ((( ((((((((((( ((((( ( (((((((((( ( ( ((( (((((()()()) $$$$ ", + " %%% %%%% (( (((( ((((((((((( ((( ( ( ((((((((( ((( ( ( (((((((( ( ( (( (((())( $$$$ ", + " %%%% %% ((( ( ((((((((( ** (( (( (((((( ( ((((((( ( ( (( ()))))) ) $$$$$$$ ", + " %%% % %% ( ( (((((( **** +++( ((( ( ( (((( ))))))) ((( ( ((( ))) ))) $$$$$$$$$ ", + " %%% %% (((((((( ***** +++(( ( ((( ((( (( ))))))))))))((()))(())))))) $$ $$$$$$ ", + " %%% % % ((( ( ****** ++(+(( ((,,, ((( ( )))))))))))))(())())))))))))) $$$$$$ ", + " %%% %%%% ((( ***** +++( (( ((,,, -- ((((( . )..))))))))))(((()))))))))))) $$ $$$$$$ ", + " %%% %% ( (((***** +++ (( ((,,, ----.---...----------- .. .. ( ))))))))) $$ $$$$$ ", + " %%% ((((***** +++ ,,, -----.-.-...---------- . .... ))))) $$$$ $$$$ ", + " %%% ******* * +++ + ++,,, ------..--------------.. . )))) $ $$ $$$$ ", + " %%% ******* * +++++ +,,, ........ . .... )))) $$$$$$ ", + " %%% ******** *** ++++ + ++,,, ... ... ....... )))) $$$ ", + " %%% ***** * * *** / ++++++ ++,,, . ........................ ))) $$$ ", + " %%% ***** * * / /// +++++ ++,,, ................................ ))) $$$ ", + " %%% %% ****** *** /////// +++ +++,,,, . ................................ ))) $$$ ", + " %%% %%%% ***** *** / / +++ + ,,, .. . ................... ))) $$$ ", + " %%% %%%%% ****** ///// / +++ + ,,, .. ...... ))) $$$ ", + " %%% % % ****** //// ////// // ++++ ,,,.. ....... ))) $$$ ", + " %%% % %% ***** /////////// / +++/ ,,, .. . ... ))) $$ $$$$ ", + " %%% % %% ****** ///////////////// /+/// ,,,, . . ... )))$$$$$$$$$ ", + " %%% % % ****** //////////////////// //+// ,,,,.. .. ... )))$$$ $ $$$ ", + " %%% %% ***** *** * ////// //////// //++/ /,,,.. ...... ))) $ $$$$$ ", + " %%% %% ************** ///// //// //+ //,, ..... 00000000000000000000000 )))) $$$$$ ", + " %%% ******** * ***////// /////+/ /,, .... 00000000000000000000000 )))) $ $$$$ ", + " %%% ***** ***////// ///// / /,, ... 00000000000000000000000 ))) $$ $$$$$ ", + " %%% *** ///// //// ///,,, ... 00 00 0 ))) $ $$$ ", + " %%% ** *** //// ///// /,,, ... 000000 ))) $$$ ", + " %%% * /// //// ,,,, ... )))) $$$ ", + " %%% //// ///// ... 0000 0000 )))) $$$ ", + " %%% % //// //// ... )))0)0)0)000)))))))))))))))))))))) $$$ ", + " %%% %% %% /// /// .. ..... ))))))))))))))))))))))))))))))))) $$$ ", + " %%% % /// //// . ..... ))))))))))))))))))))))))))))))))))) $$$$$$ ", + " %%% %% /// /// . ... )) ) ))))))))))) ) ))) $$$$$$$$ ", + " %%% %% %% /// /// . .. ... )))) ) ))))) ) ))))))) $$ $$$$$ ", + " %%% %% %% / /// /// // .. ...... ) ))) ) ) )) $$$$$$ ", + " %%% %% %% / ////// //// // . . ..... )))) ) )) ))) ) )) )) $$ $$$$$ ", + " %%% % % //// //// ///// // ...... )) ))))) ) ) ) ))) ))))))) $$ $$$$ ", + " %%% / / /// ////// / .. . ...... ) ))) ) $$$$ $$$ ", + " %%% / ////// //// / / . ............................... $ $$ $$$ ", + " %%% / ////// //// / .............................. $$$$$ ", + " %%% // //// /// // ............................ $$$ ", + " %%% / /// //// /// / / . .... . .... $$$ ", + " / //// //// // . . .. . .... $$$ ", + " //// ///// . ", + " //// ////// ...... . . ..... ", + " //// ////// .... ....... ", " ///// ///// ", " //////// ////// ", - " ///////////// /////// 11111111111111111111111111111111111111 ", - " ////////////////////// 11111111111111111111111111111111111111 ", - " // //////////////// / 11111111111111111111111111111111111111 ", - " / //// //////// //// 11111111111111 1 1 ", - " // /// / / // 1111111 1111111 ", - " ////// // /// 111111 11 ", - " ///// / / / / 11 1 11 1111111 ", - " / / / 11 11111 111 11 1 ", + " ///////////// //////// 11111111111111111111111111111111111111 ", + " ////////////////// // / 11111111111111111111111111111111111111 ", + " / ///////////// /// / 11111111111111111111111111111111111111 ", + " /// // ///// // / / 11111111111111 1 1 ", + " // //// / // 1111111 1111111 ", + " //// / / //// 111111 11 ", + " ///// /// 11 1 11 1111111 ", + " / / 11 11111 111 11 1 ", " 11 111111 ", " ", " ", diff --git a/tests/visual_tests/grids/lines-5-800-800-1.0-grid-reference.json b/tests/visual_tests/grids/lines-5-800-800-1.0-grid-reference.json index f2ccd1bc3..8ac994bdb 100644 --- a/tests/visual_tests/grids/lines-5-800-800-1.0-grid-reference.json +++ b/tests/visual_tests/grids/lines-5-800-800-1.0-grid-reference.json @@ -8,8 +8,8 @@ "7", "16", "6", - "2", "10", + "2", "12", "14", "13", @@ -32,28 +32,28 @@ " ", " ", " ", - " ", - " !!! ! ", - " !! !! !! !! !!! ", - " ! !! ! ! ! !!!! !! ! ", - " !!!!! !!!! ! ! ! !!! ! ! ! ", - " !!! !!!! !! ! ! ! ! ! !!! ! ", - " !!!!!!!!!! ! !!! !!!!!!! !! ! !!! !!!! !!! ", - " !!!!!!!!! ! ! ! !!!!!!! !!! ! !!!!!!!! !!! ! ", - " ! ! !!!!!! !!!!! !!! ! ! !!!!!!! !!!! ! !! !!!!! ! ! !!!!! ", - " !!! !!!!!! !!!!!!!!!! ! !!!!!!!!!!!!!!! ! ! !!!!!!!!! !!! !!! !! ! ", - " !!! !!!! !!!!!! !!!!!!!!! !! !!!!!! !!!!! !! ! !!!!!!!!!!! !!! !!! !!! !!!! ", - " ! !! !!!!!! !!!!! !!! ! !!!!!! !!!!! ! ! ! !!!!! !!!!!!!!!! ! ! !!!!!!!! ", - " !!!! !!!!!! !!!!!!! !! !! ! !!!!!! !!!!!! !! ! !!!! !!!!!! !!!!!!!! ! ! ! !!!!! ", - " ! ! !!!!!!!! !!!!!! !!!! !!!!! !!!!!! ! !!! !! !!!!!! !!!!! ! ! !! !!!!!!!!! ", - " ! !!!!!! !!!!! ! !! !!!! !!!!!! !!!!! !!!!! !!! !! !!!!! !!!!! ! ! !! !!!!!! ", - " !!!!!!! !!!!! !! ! ! ! !!! !!!!!! !!!!! !!! ! ! !!!!!!!!! !!!!!! !!!! !!!!! ", - " !!!!!! !!!!!! !!! ! !! !!!!!! !!!!!! !! ! !!!!!! !!!!! !!!!! !!!!!! ", - " !!!!! !!!!!! !! !!! !!!!!! !!!!! !!! !!! !!!!! !!!!! ! !!!!!! ", - " !!!! !!!!! !!! !!! !!!!! !!!!! !!! ! !!!!!! !!!!!!!! ! !! !!!!! ", - " ! !!!!! !!! !!!!!!! !!!!!!!! !!!!! !!!!!!!! !! !!!!!!! ", - " !!!!!!!!! !!!!! !!!!!! !!!!!! !!!!! !! !!!!! ", - " !!!!!! !!!!!! !!!!! !!!!!! !!!!! !!!!!! ", + " !!!! ", + " !!!! ", + " ! ! ! ! ", + " ! !! ! ! ", + " ! ! ! ! !!!!! !!! ! ", + " !!! !!!! !!! !! !! !!!!! ", + " ! !!!!!!! !!!! !! !!! ! ! !! ! ", + " ! !!!!!!!!! ! ! !! !!!!! !! !!!!!!! ! ", + " !!!! !!!!!! !!!!! !! ! !!!!!!! !! !!!! !!! !!!!! !! !! ", + " !! !!!!!! !!!!!! !! !!!! ! ! !!!!!!!!!!! !!! !!! !!!!!!!!!!! ! !! ! ! ", + " !!! !!!! !!!!!! !!!!! !!! !!! ! ! !!!!!! !!!!! !!! ! !!!! !!!!!!!!!!! ! ! !!! !!! !!!! ", + " ! ! !! !!!!!! !!!!! !!! ! ! !!!!!! !!!!! !!! !! ! !! !!!!! !!!!!! !! !!! ! ! !!!!!!!! ", + " ! ! !!!!!! !!!!!!!!! ! !!! !! !!!!!! !!!!!! !!! !!! ! ! !!!!!! !!!!! ! !!! ! ! !!!!! ", + " ! !!!!!!!!!! !!!!!! !!! !!! !!!! !!!!! !!!!!! ! !!! !!! !!!!!! !!!!! !! !!!!!!!!! ", + " !! !!!!!! !!!!! !! ! ! !!!!!!!! !!!!! ! ! ! !!!!! !!!!! !!! !! ! !! !!!!!! ", + " !!!!!!! !!!!! ! !!!! !!!!!! !!!!! ! !! ! !!!!!!!!!! !!!!!! ! ! ! !!!! ! !!!!! ", + " !!!!!! !!!!!! !!!!!!! !!!!!!!!!! !!!!!! !!!!! !!! !!!!!! !!!!!!!! !! ! !!! !!!!!! ", + " !!!!! !!!!!! !! ! ! ! !!!!!! !!!!! ! !!! !!!!! !!!!! !!! !!!!!! ", + " !!!! !!!!! !!! !!!!! !!!!! ! ! !!!!!! !!!!!! !! !!! !!!!! ", + " ! !!!!! ! ! !! !!!!!! !!!!!!!!! !! !!!!! !!!!!! !!! !!!!!! ", + " !!!!!!!!!!! !!!!! !!!!!!!!!! !!!!!!! !!!!! ! !!!!! ", + " !!!!!!!!!!!!!!!!! !!!!! ! !!!!!! !!!!! !!!!!! ", " !!!!! !!!!!! !!!!!! !!!!! !!!!!!!!!!! ", " !!!!!!!!!!! !!!!!!!!!! !!!!!!!! ", " !!!!!!!!! !!!!!!! !!!!! ", @@ -62,37 +62,37 @@ " ##### ! #### $$$ ", " ######## ####### ## $$$ ", " ########### ########## ##### # $ $$$ ", - " ###### ####### ###### ##### ######## ### $$ $$ $$$ ", - " ####### ## ##### ##### ## ##### ########## ##### $ $$ $$$ ", - " ###### # ##### ###### ### ###### ##### ##### ##### $ $$$ ", - " ###### # ###### ######### ###### ######## ###### ###### $ $$$ ", - " ###### # ####### ####### # # ##### ########## ###### ###### $$ $ $$$ ", - " ######### ## # ##### ###### # ### # # ##### ##### ### ##### ######## $$ $ $$$ ", - " ####### ### ### ##### ##### # ## # ## ###### ##### # # ## ###### ###### ##### $ $$$ ", - " ########## ## #### ###### ###### ### # ## ##### ###### ##### ###### ###### ## ### $$ $$$ ", - " ######## # # # # ##### ######### # #### ##### ##### ### ## # ##### ###### ## ### $$$ ", - " %%% ## # ### ## # ##### ##### ### ## # ###### ##### ## # # ######## ###### # ### $$$ ", - " %%% ## # # ###### ######## ### # # ###### ###### ######### ##### #### $$$ ", - " %%% % ### ######## ######### ### #### ##### ######## ## # ###### ###### $$$ ", - " %%%%% %% # ### ##### ###### # ### ### ##### ##### ## # # ########### $$$ ", - " %%%%% % #### ##### ###### ### ### ###### ##### ## ## # ####### # $$$ ", - " %%% % ##### ###### ##### ### # ########### ## # # ###### # $ $$$ ", - " %%% % %% ### ########### # && ######## # ## &&& && ### ###### # $ $ $$$ ", - " %%% % %%% & ### ######## && && &&& ###### # # &&&& && ### #### ### $$ $$ $$$ ", - " %%% %%%%% &&&& ### ##&&& && && & &### ### & ### ## # $$ $$ $$$ ", - " %%% % &&&& ### &#&& &&&& & &&&&& &&&# # &&& & # # # $$ $$ $$$ ", - " %%% % && & && & & && & && && &&&&& && & &&&&&&& & ## $$ $$$ ", - " %%% &&& & &&&& & & &&&&& && & & && && &&&&&&&& &&& $ $$$ ", - " %%% &&& && &&&&&& & &&& &&&&&& & & & &&&&&&&& &&&&& &&&&&&&&&& && $$ $$ $$$ ", - " %%% && && & &&&&&&&&& & &&&&&&&&&&&&&&& & &&&&&&&&&&&& && & && &&&& &&&&&&&&&&&&& && & $ $$$ ", - " %%% & &&& &&&&&&&&&&& && & &&&&&&&&&&&&& && &&&& &&&&&&&&&&&&&&& && && &&&&&&&&&& &&&&& & & $$$ ", - " %%% &&& &&&&&&&&&&&&&& & & &&&&&&& &&&&&& & && && &&&&&&& &&&&&&&& & &&& &&&&&& &&&&& & && $$$$ ", - " %%% &&& &&&&&&& &&&&& &&& & &&&&&&& &&&&& & &&& & &&&&&& &&&&&&&& & &&&&& &&&&&&&&&& $$$$ ", - " %%% %% &&&&&&& &&&& &&&& & &&&&&& &&&&&& && &&& &&&&& &&&&&& & &&& &&&&& &&&& && $$$$ ", - " %%% %%%% &&&&&& &&&&& & && &&&&& &&&&& & &&&&&&&&&& &&&& &&& &&&&&&& &&&& & & $$$$ ", - " %%% %%%%%&&&&& &&&& & & &&&&& &&&& && &&&&&&& &&&&&&& &&&&& &&&&&& &&& && $$$$$$ ", - " %%% % %&&&&& &&&& && &&&& &&&&& &&&& & &&&&& &&&&& &&&&& &&&&& &&& &&&&& $$ $$$$$$ ", - " %%% % %% &&& &&&& &&& &&&&&& &&&& &&&&& &&&&& &&&&&& &&&&&&&&&&&&&& $ $$$$$$ ", + " ###### ###### ###### ##### ######## ### $$ $$ $$$ ", + " ########### ##### ##### ##### ########## ##### $ $$ $$$ ", + " ###### # ### ##### ###### ###### ##### ##### ##### $ $$$ ", + " ###### ## ###### ####### ###### ###### ###### ###### $ $$$ ", + " ###### ### ###### ######### ######## ####### ###### ###### $$ $ $$$ ", + " ###### ### ## ##### ######### ## ######## ##### ##### ######## $$ $ $$$ ", + " ########## ### ### ##### ##### ### ## ## ######### ######## # ###### ###### ##### $ $$$ ", + " ###### ### ## # # ######## ###### # # ### ### ### ##### ######### ### # ######## ###### ## # # $$ $$$ ", + " #### # # ## ##### ###### # ### ##### ##### # ## ## ######### ########## ### $$$ ", + " %%% ## # ### ## ########## ##### ### ### ###### ##### ### ## ######## ###### # ### $$$ ", + " %%% # ### ######### ######### # ## ###### ###### ### # # ## ##### ##### #### $$$ ", + " %%% % ### #### ## ###### ######### ## ## ##### ######## ### ### ###### ###### # # $$$ ", + " %%%%% %% ## ## ##### ####### ## # ##### ######### ## ########### $$$ ", + " %%%%% % ### ###### ###### ## ### ###### ######### ## ## ####### # $$$ ", + " %%% % ######### ##### # ### ############## # ##### # $ $$$ ", + " %%% % %% ## ############## #### & & & ######## # ## ###### ## $ $ $$$ ", + " %%% % %%% ### ## #####&#& # &&&&& & ###### # # # && #### # ## $$ $$ $$$ ", + " %%% %%%%% ### # ###&&& && #### #### &&&& # # # $$ $$ $$$ ", + " %%% % #### # &#&&&& && &&&&&& # # & &&& ## ### $$ $$ $$$ ", + " %%% % && #### & &&&& &&&&& &&&& &&&& & ## # $$ $$$ ", + " %%% &&&&&& & # &&& &&& && & & && &&& && &&&&&&&&&& && # $ $$$ ", + " %%% & && & & && # &&&&& &&&&&& & && &&&&&&&& && & && &&&&&&&&&& &&& $$ $$ $$$ ", + " %%% && &&&& &&&&&&&& && & && &&&&&&&&&& && & &&&&&&&&&&&& &&& & & &&&&&&&&&&&&&&&& $ $$$ ", + " %%% & & & &&&&&&&&&&& && && &&&&&&&&&&&&& & &&& &&& &&&&&&&&&&&&&& & & &&&&&&&&&&&& &&&&&& & $$$ ", + " %%% &&&&&&&&&&&&&&&&&& && && && &&&&&&& &&&&&& && & & & &&&&&&& &&&&& &&& & && &&&&&& &&&&& &&&&& $$$$ ", + " %%% & &&&&&&& &&&&& &&&& &&& && &&&&&&& &&&&&& & & & &&& &&&&&& &&&&& & &&&&&& && &&&&& &&&&& &&&&& $$$$ ", + " %%% %% &&&&&& &&&& && &&& &&&&&&&&& &&&&&&& && && &&&&& &&&&&&&& & &&&&& &&&& & & $$$$ ", + " %%% %%%% &&&&&& &&&&&&& && &&&&&&&&& &&&&&&& & &&&&&& &&&& && &&&&&& &&&& &&& &&& $$$$ ", + " %%% %%%%%&&&&& &&&& & &&& &&&&& &&&& && &&&&& &&&& && && &&&&& &&&& &&& & && $$$$$$ ", + " %%% % %&&&&& &&&& && && &&&&& &&&& & &&&&& &&&&&& &&&&& &&&&& &&&&&&&&& $$ $$$$$$ ", + " %%% % %% &&& &&&& && &&&&&& &&&& & &&&&& &&&&& &&&&&& &&&&&&&&&&&&&& $ $$$$$$ ", " %%% % %% & &&&&& &&&&&&& &&&&&& &&&&&& &&&&&&&&&&&&& &&&&&&&&&&& $ $$$$ ", " %%% % % &&&&&&&&&&&&& &&&&&&&&&&&& &&&&&&&&&& &&&&&&&&& $ $$$$$$ ", " %%% %% &&&&&&&&&&& &&&&&&&& &&&&&& &&&& $$ $ $$$$ ", @@ -108,89 +108,89 @@ " %%% % %% ''''''''''''''''''''''''' $$$$ ", " %%% % %% (( '''''''''''''''''''''''''$ $ $$$$ ", " %%% %% ((((((( (((((((( '''''''''''''''''''''''''$$ $$$$$$ ", - " %%% %% %% (((((( (((((((( (((((((((( (((((((((((( ' ''' $$ $$$$$$ ", - " %%% % %% (((((((((( (((((((((((( ((((((((((((( (((((((((((((( ' ''' $ $$$$$$ ", - " %%% %% % (((((((((((((( ((((((((((((((( (((((((( ( ((((( ((((((( ((((( ''' '' $$$$$$ ", - " %%% ((((((( (((((( ((((((( ((( (((( (((((( (( (((((( (((((( ((((((( ' ' ' ''' $$$$$ ", - " %%% ((((((( ( (((( (((((( (((((( (((( (((((( (((( (((( ((((( (( (((( ' ' ''' $$ $$$$$$ ", - " %%% (((((( (( (((( (((((( ( (( (((( ((((( ( ((((((( ((((( ( ((((((( $ $$$$ ", - " %%% (((((((((( ( (((( ((((( (( (((( (((((( ((( (((( ((((((((( (( (((((( (( $$$$ ", - " %%% ((((((((( (((( ((((( ((((( (( (( (((( ((((( ( ((( (((( (((((((((( (( ( ((((((( (((( $$$$ ", - " %%% (((( ( ((( (( (((( (((((( ((( (( (((( ((((((( ( (( (((( (((((((( ( ((( ((( ( ((((( (((((( $$$$ ", - " %%% %% (( (((( ( ((((( (((((( ( ((((( (((((( (( ( ( (((((((((((((( ( (( (( ((((((((((((( $$$$ ", - " %%% % %% ((( ((((((((( (((((( ( (((((((((((((( (((( ( (((((((((((( (((( (( ((((((((( $$$$ ", - " %%% %% (( ((((((((((((( (((((((((((( (( (( ((((((((( ((( ((( (((((( (( $$$$$$ ", - " %%% %% % ( (((((((( ((( )) (((((((((( (( ( (( ((( ( ((( (((((( * $$ $$$$$$ ", - " %%%%% % (( ( ((((( ( (((() +++ (((( ( ((( ,, (((((( ((( (( ( (( ** ** * $$ $$$$$$ ", - " %%%% % %% (( ( ())()) +++ (( ((( ,,, ,, ((((( ************ (( ( * * ** $$$$$$ ", - " %%%%% ((( ( ((())) +++ ( ( ( ((( ( ***************************((((( *** * *** $ $$$$$$ ", - " %%%% % % ((((( (()())) ++++ ( (((((--- ,,,,,,,, (( ((((( **************************((*(******* ******* $$ $ $$$$ ", - " %%%%%% ((( ()))) ++++ ((( ((--- ,,, ,,,,, ( ((( ********************************* * * $$ $ $$$$ ", - " %%%% )))))) ) +++ (--- ,,,,,, **************** $ $$$$ ", - " %%%% ))))))))) ) +++ ---- ,,,,,,,,,,,,,,,,,,,,,,,,,,,,, ****** $$$$$$ ", - " %%%% ))))) ))) )) +++ ----- -- ,,,,,,,,,,,,,,,,,,,,,,,,,,,,, . .. **** $$$$ ", - " %%%% )))))) ))) )) +++ --- -- - ,,,,,,,,,,,,,,,,,,....,..,,,, .. ... . **** $$$$ ", - " %%%% )))))) ) ))) ++++++ + ------ - . ... ... .. . .... **** $$$$ ", - " %%%% ))))) ) ++++ ++ + --- - ... ... .. . .. . .. **** $$$$ ", - " %%%%% )))))) )) +++++++ ----- -- . .. ..... ... ..... **** $$$$ ", - " %%%%%% )))))) ) ++++ ++ ---- -- .. ..... ... . . . *** $$$$ ", - " %%%% %% ))))) +++ + + ----- -- . .. ................................. *** $$$$ ", - " %%%%%% % )))))) / +++ + ++ ---- -- .......................................... *** $ $ $$$$ ", - " %%%%%% )))))))) // //// // ++++++ ++ --- -- ........................................... *** $$ $$$$ ", - " %%%%%%%%% ))))) ))) ///// //// ++++++++ --- ................. *** $$ $ $$$$ ", - " %%%%%% %% )))))) ))) )) // // // ++++++ --- ..... *** $ $$$$$$ ", - " %%%%%%%%% )))))) )) ) ) /// /// // // +++ --- .... *** $$$$$$ ", - " %%%%%% ))))) )) ) // //// ///// / +++ ---- . ... *** $$$$$ ", - " %%%% )))))) ) )) //////// /// / +++ ---- . . ... *** $$ $$$$$$ ", - " %%%% )))))) ))) /////////////// / +++ ---- .. . .... *** $ $$$$ ", - " %%%% ))))) ) ////////////////////// ++++ --- . . .... *** $$$$ ", - " %%%% )))))) ////// ////////////// ++++ --- .. ..... *** $$$$ ", - " %%%% )))))) ////// ///////// +/+ --- . ..... **** $$$$ ", - " %%%% %% ))))) ) ///// //// /++/ --- ... ..... **** $$$$ ", - " %%%% %%%% ))))))))) ) ////// ///////++// ---- . ... 00000000000000000000000000000 **** $$$$ ", - " %%%%%% %)))))))) )) ////// //// /++////---- . ... 00000000000000000000000000000 *** $$$$$$ ", - " %%%%%% %%)))) ))) )) ///// //// / / --- ... 00000000000000000000000000000 *** $$$$$$$$$ ", - " %%%%%% )%))) ) ) )) ////// //// // /--- ... 00 00 0 0000 *** $$ $$$$$$ ", - " %%%% % %%%) ) ) ////// /////// --- ... 000000 0 00 *** $$$$$$$ ", - " %%% %) ))) ///////// //// // --- ... **** $ $$$$$$ ", - " %%%% % ) //////// //// / --- ... 00000000 00 00000 ****** **$$ $ $$$$ ", - " %%% / / /// //// --- ... 00 0000 000000 *** ** *$$ $ $$$$ ", - " %%% // // /// ///// ... ***** * $ $$$$ ", - " %%% / / /// //// ... **************** **** * * $$$$$$ ", - " %%% // / //// /// . ... ********************************************** ** $$$$ ", - " %%% // // //// /// .. ..... ******************************************** * * $$$$ ", - " %%% // /// //// ..... ********************************* * ** $$$$ ", - " %%% ////// //// . ... * * *** ** ** *** ** $$$$ ", - " %%%%% /// //// .. ..... * **** * **** ** *** $$$$ ", - " %%% %% % /// /// / ......... ** * * $$$$ ", - " %%% %%%%% //// /// // .. .. .... **** * ****** ***** ** $$$$ ", - " %%%% %% /////// ///// / . ..... ** * *** ** * ******* $ $ $$$$ ", - " %%%%% %% //////// ///// // . .... $$ $$$$ ", - " %%%%%% // ///// ///// // ..... $$ $ $$$$ ", - " %%%%% %% // / /// //// / ...... $ $$$$$$ ", - " %%%%%%%% // / /// /// / // .......................................... $$$$$$ ", - " %%%%%% // ///// /// //// ......................................... $$$$$ ", - " %%% / // //// /// / . .. ...................................... $$ $$$$$$ ", - " %%% / // //// /// .. . . . . .. . $ $$$$ ", - " %%% / //// /// .. ... .. ... ... .. $$$$ ", - " //// //// ... . $$$$ ", - " //// ///// ..... .. . . . . ..... $$$$ ", - " ///// ///// ... .... ... .... ", + " %%% %% %% (((((( (((((((( (((((((((( (((((((((((( '' '''' ' ''' $$ $$$$$$ ", + " %%% % %% (((((((((( (((((((((((( ((((((((((((( (((((((((((((( ' '''' ' ''' $ $$$$$$ ", + " %%% %% % (((((((((((((( ((((((((((((((( (((((((( ((((( ((((((( ( ( (((( ' ' ' ' ' $$$$$$ ", + " %%% ((((((( (((((( ((((((( (((( (((((( ((((( (((( (((((( ( (((((((( ' '''' '''''' ' $$$$$ ", + " %%% ((((((( ((((( ((((((((( (((( (((((( ((((( (((( ((((( ((( (((( ''''''' '' ''''''$$ $$$$$$ ", + " %%% (((((( ((((((( (((((( ((( (((( ((((( ((((( ((((( ((( (( ((((( $ $$$$ ", + " %%% ((((( (( (((( ((((((((( ( ( (((( (((((( ( (( (((( (((((((( (((((( (((( (( $$$$ ", + " %%% ((((( ((( ( (((( ((((((((( (( ( ((((( ((((( ( (((((((( (((( ((((((((( ( ( (((( (((( (((( $$$$ ", + " %%% (((( (( (( (((( (((((( ( (((( (( ((((((( ((((((( ( ( ( ( (((( (((((( ((( ( ((( ((((( (((((( $$$$ ", + " %%% %% (( (((( ((((( (((((( (( ( (( (((((((( (((((( (( (((((((((((((( (( ((( ( ((((((((((((( $$$$ ", + " %%% % %% (( (((((( (((((( ((( ( (( (((((((((((((( ((( (((((((((((((( (( ( ((((((((( ) $$$$ ", + " %%% %% (( ((((((((((( ( ((( (( (((((((((((( (( (( ( (((((((( ( (( (((((( )) ) $$$$$$ ", + " %%% %% % ( (((((((( ((( (** (( (( ((((((( (( (((( (( ((( ( (( (( (( ( ))))) $$ $$$$$$ ", + " %%%%% % (((( (((( ((** +++ ( ( ((( ,, ((( (( ((((( )) ) $$ $$$$$$ ", + " %%%% % %% (( ((**** +++ ( ((( ,,, ,, (((( ( )))))))))))) ((( (( ))) )) $$$$$$ ", + " %%%%% ( (((((*** +++ ( ( ( )))))))))))))))))))))((((((()))) ) ))) $ $$$$$$ ", + " %%%% % % (((((**** ++++ --- ,,,,,,,, ( ))))))))))))))))))))))((((()(())))))) ))) $$ $ $$$$ ", + " %%%%%% (***** ++++ --- ,,, ,,,,, ))))))))))))))))))))))))))))))))) ) $$ $ $$$$ ", + " %%%% ****** * +++ --- ,,,,,, ))))))))))))))) ) $ $$$$ ", + " %%%% ********* * +++ ---- ,,,,,,,,,,,,,,,,,,,,,,,,,,,,, )))))) ) ) $$$$$$ ", + " %%%% ***** *** ** +++ ----- -- ,,,,,,,,,,,,,,,,,,,,,,.,,.,,, . )))) )) ) $$$$ ", + " %%%% ****** *** ** +++ --- -- - ,,,,,,,.,,,,.,,,,,,,,......., .... .. )))) )) )) $$$$ ", + " %%%% ****** * *** ++++++ + ------ - .... .. ...... ... . ))))) ))) $$$$ ", + " %%%% ***** * ++++ ++ + --- - ..... . . .. .. .. )))) )) )) $$$$ ", + " %%%%% ****** ** +++++++ ----- -- .. . .. . ..... ... ... ))))))))) $$$$ ", + " %%%%%% ****** * ++++ ++ ---- -- ..... .. ...... . . ))))) $$$$ ", + " %%%% %% ***** +++ + + ----- -- ... ................................. )))))) $$$$ ", + " %%%%%% % ****** / / +++ + ++ ---- -- .......................................... )))))) $ $ $$$$ ", + " %%%%%% ******** // //// / ++++++ ++ --- -- ........................................... ))) $$ $$$$ ", + " %%%%%%%%% ***** *** /// /// / ++++++++ --- ................. ))) $$ $ $$$$ ", + " %%%%%% %% ****** *** ** // / // / ++++++ --- ..... ))) $ $$$$$$ ", + " %%%%%%%%% ****** ** * * /// / /// // / +++ --- .... ))) $$$$$$ ", + " %%%%%% ***** ** * // //// / //// / +++ ---- . ... ))) $$$$$ ", + " %%%% ****** * ** //////// / /// +++ ---- . .. ... ))) $$ $$$$$$ ", + " %%%% ****** *** /////////////// / +++ ---- . ...... ))) $ $$$$ ", + " %%%% ***** * ////////////////////// ++++ --- .......... ))) $$$$ ", + " %%%% ****** ////// ////////////// ++++ --- .. ..... ))) $$$$ ", + " %%%% ****** ////// ///////// ++/ --- .. .... )))) $$$$ ", + " %%%% %% ***** * ///// //// /+/// --- .... ... )))) $$$$ ", + " %%%% %%%% ********* * ////// ////////+// ---- ......... 00000000000000000000000000000 )))) $$$$ ", + " %%%%%% %******** ** ////// //// //+// /---- . ... 00000000000000000000000000000 ))) $$$$$$ ", + " %%%%%% %%**** *** ** ///// //// // / /--- ... 00000000000000000000000000000 ))) $$$$$$$$$ ", + " %%%%%% *%*** * * ** ////// /////// /--- ... 00 00 0 0000 ))) $$ $$$$$$ ", + " %%%% % %%%* * * / ////// ///// / //--- ... 000000 0 00 ))) $$$$$$$ ", + " %%% %* *** //// //// //// /// --- ... )))) $ $$$$$$ ", + " %%%% % * // //// ///// / --- ... 00000000 00 00000 )))) ) $$ $ $$$$ ", + " %%% // // /// //// --- ... 00 0000 000000 ))) ) )$$ $ $$$$ ", + " %%% // // /// ///// . ... ))))) ) $ $$$$ ", + " %%% / // /// //// ........ )))))))))))))))) )))) )) $$$$$$ ", + " %%% / ///// /// . .... )))))))))))))))))))))))))))))))))))))))))))))) ) $$$$ ", + " %%% ////////// /// .. . ... )))))))))))))))))))))))))))))))))))))))))))) ) ) $$$$ ", + " %%% //// //// .. .... ) )))))))))))))))))))))))))))))))))) ))))) $$$$ ", + " %%% /// //// .. ..... ))))))) ))) ) ) )))) ) ) $$$$ ", + " %%%%% /// //// .. . .... )) ))) )) )) ) )))) ) $$$$ ", + " %%% %% % /// /// / / . . .... ) ) ) $$$$ ", + " %%% %%%%% //// /// / / . .... ))) )) ) )))))))) ) )))) $$$$ ", + " %%%% %% / ///// /// / // ..... )))) )) ))))) )))))))) $ $ $$$$ ", + " %%%%% %% // //// //// / .... $$ $$$$ ", + " %%%%%% //// /// ////// // ..... $$ $ $$$$ ", + " %%%%% %% // /// ////// // ...... $ $$$$$$ ", + " %%%%%%%% // / /// /// / // .......................................... $$$$$$ ", + " %%%%%% // / //// /// // ........................................ $$$$$ ", + " %%% / /// //// /// ........................................ $$ $$$$$$ ", + " %%% / / //// /// . . . . .. .. . $ $$$$ ", + " %%% / //// /// .. .. ... .. ...... $$$$ ", + " //// //// ... .. $$$$ ", + " //// ///// ...... ........ .... .... $$$$ ", + " ///// ///// . .. ..... . . . .. ", " //// ////// ", " //// /////// ", - " //// ///// ", - " ///// /////// / / ", - " / ///// ///////// /// ", - " / /////////// ///// / /// ", - " // / /////////////////////// / / 11111111111111111111111111111111111111111111111111 ", - " / / //////////////////// /// 11111111111111111111111111111111111111111111111111 ", - " / / //////////// /// 11111111111111111111111111111111111111111111111111 ", - " //// / / //// 1111111111 1 1 1111 ", - " / /// // /// 1111111 1 1 1 1 11 ", - " /// ///// 111 11 1 1 ", - " / /// / 11 1 11 11111 1 11111 ", - " // ///// 11 11111 111 11 1 111111 ", - " ////// 1 111111 ", + " //// ///// / ", + " /////// ///////// // ", + " // / ///// ///////// //// ", + " / / /////////// ///// / / // ", + " /// ////////////////////////// //// 11111111111111111111111111111111111111111111111111 ", + " // // //////////////////// //// 11111111111111111111111111111111111111111111111111 ", + " // / //////////// / / 11111111111111111111111111111111111111111111111111 ", + " //// / ///// 1111111111 1 1 1111 ", + " /// /////// 1111111 1 1 1 1 11 ", + " / // 111 11 1 1 ", + " /// / / 11 1 11 11111 1 11111 ", + " ////// / 11 11111 111 11 1 111111 ", + " // 1 111111 ", " ", " ", " ", diff --git a/tests/visual_tests/grids/lines-7-200-200-1.0-grid-reference.json b/tests/visual_tests/grids/lines-7-200-200-1.0-grid-reference.json new file mode 100644 index 000000000..8ca4c9c15 --- /dev/null +++ b/tests/visual_tests/grids/lines-7-200-200-1.0-grid-reference.json @@ -0,0 +1,59 @@ +{ + "keys": [ + "", + "1" + ], + "data": {}, + "grid": [ + " ", + " !! ", + " ! !!! ", + " ! ", + " ! !!! ! ", + " ! ! ! !! ", + " ! !! ! ! ", + " ! ! !! ", + " ! ! !!!! !! !!!! !!", + " !! ! !! !! ! !!!", + " ! !! !!! ! !!!! !! ! !!!", + " ! !! !!!! !! ! !! !! ! ", + " ! ! !! ! !! !! ! !! ! ", + " ! ! ! !! ! ! !! ! ", + " !! !! !! !! ! ! !!!", + " ! !! ! ! !", + " ! ! ! ! ! ! !", + " ! !! ! ! ! !! !! ! ", + " ! ! ! ! ! ! !! ! !!! ", + " !! !! ! ! !! !! !! !! ! ", + " !!!! !! ! !! !! !! !! ", + " !! ! ! ! ! !! ! ", + " !! !! !!!! !! ", + " ! !! !!! ! !! ! ! ! ! ", + " ! ! ! !! ! ! ! ", + " ! ! ! ! ! !! !! ! ! ! ", + " !! !! ! ! !! ! ", + " ! ! !! ", + " ! ! !! ! !! ! ! ", + " ! !! ! ! ! ! ! ! !! ", + " ! !! ! ! !! !! !! ! ", + " ! !! !! !! !! ! ! !! ! ", + " !!! ! ! ! !! ! ", + " ! ! !! ! ", + " ! ! ! ! ! ! ! ", + " ! ! !! !! ! ", + " !!!!! ! ! !! ! !!! ! ! ", + " ! !! ! ! !! ! ! !! ! ! ! ", + " !! !! ! !! !! !! !! ", + " !! !! ! !! !!!! !!! !!! ", + " !!! !! !! ! ! ", + " ! ! ! ! !! ! !!! ! ! ", + " !! !! ! ! ! ! ! ! ", + " ! ! ! !! ", + " ! ! ! !! ! !! ! ", + " ! ! ! !!! ! ! ! ", + " ! ! ! ", + " ! ! ! ", + " ! !!! ! ", + " !! " + ] +} \ No newline at end of file diff --git a/tests/visual_tests/grids/lines-7-400-400-1.0-grid-reference.json b/tests/visual_tests/grids/lines-7-400-400-1.0-grid-reference.json new file mode 100644 index 000000000..38574a2d0 --- /dev/null +++ b/tests/visual_tests/grids/lines-7-400-400-1.0-grid-reference.json @@ -0,0 +1,109 @@ +{ + "keys": [ + "", + "1" + ], + "data": {}, + "grid": [ + " ", + " ", + " ", + " ", + " ", + " ! ", + " ! ! ", + " !! ! ", + " ! !!!! ! ", + " !! ! ! ! ", + " !! ! !! !!! ! ", + " ! ! !! ! !!! !! ! ! ! ", + " !! ! !!!!! !! ! !! !! !! ", + " !! ! ! !!!! ! ! ! ! !! !! ", + " !! !! ! !!! ! !! ! !! !! ! ", + " !!!!! ! ! ! ! !! ! !! ! ", + " ! !! ! ! !! ! ", + " !! !! ! !!! ! !!!!! ! ", + " ! ! !! !! ! !!! ", + " ! ! !! ! ! ! ! ! ! ! ! ", + " ! ! !! ! ! ! ! ! ", + " ! ! ! !! ! ! !! ! ", + " ! !! ! !! !! ! ! !! ! ", + " ! ! ! !! ! ! !! !! ", + " !! ! !! ! !! ", + " ! !! !! ! ! ! ", + " ! !! !! ! ! ! ", + " !! !! ! ! ", + " !! ! ! !! !! !! ! !! ! ", + " !!!!! ! ! ! ! ! !! ! ", + " ! !! !! !!!! !! !! !! !! ", + " ! ! ! !!!! ! ", + " !! ! ! ! ! !! ! ", + " ! ! !! ! ! ! !! !! ! ", + " !! !! ! !! ! ", + " ! ! ! !! !!!!! ! ! ", + " ! !! ! ! ! !! ! ", + " ! ! ! !! !! !! !! ! ", + " ! ! ! ! ! !! ! !! !! ! ", + " ! ! ! !! !! !!! ", + " ! ! ! ! !! !! ", + " ! !! ! ! ! ! !!! ", + " !! ! !!! ! ! ! !! ! ", + " !! ! !! ! ! ! ! ! ", + " !! !! ! ! !! !! ! ! ! ", + " ! ! !! !! !! ! ", + " !! ! ! !! ! !! ", + " !!! ! !!!! !! ! !! ", + " ! ! ! ! ! !! ! !! !! !! ", + " !! !! ! !! ! !! !! ", + " !!! !! ! ! ! !! !! !! !! ! ", + " !! !! !! !! ! ! !! ! ", + " !! !! ! ! ! ! ", + " ! !!! ! ! !! ! !!! ! ", + " ! ! ! ! ! ! ! ! ! ! ", + " ! ! ! ! !! !! !! ! ", + " ! ! ! !! !! ! !!! !! ! ", + " ! ! ! !! !! ", + " ! ! !! ! !! ", + " ! ! !! ! ! ! ! ! !!! ", + " !! ! !!! ! ! ! ! ! ! ", + " ! ! !!! !!! ! ! ! ", + " !! !! ! !! !! !! ! ", + " !! !! ! !! !! ", + " !! ! !! ! ! !! ", + " !!! ! !! !! !! !! ! ", + " ! ! ! !! !! !! !! ", + " ! ! ! ! ! !! ! ! ! ! ", + " !! !! ! ! ! !! ! ", + " !! !! !!! ! ! ! ! ! ", + " !! !! ! ! ! !! !! !! ! ", + " ! ! ! ! ! ! !! ! ", + " ! ! ! ! ", + " !! !! ! ! ! ! ! ", + " ! !! !! ! ", + " ! ! ! ! ! ! ! !! ", + " !! !! ! ! ! ! ! !! ", + " !! !! ! ! ! ! !! !!! ", + " !! ! !! ! !! ! ! ! ! ", + " ! !! ! ! !! ! ", + " ! ! !! !!!! !! ! ! ", + " ! !!! ! !! !! ! ", + " !! ! ! !! ! ! !! !! ", + " ! ! !!!! ! ! ! ! ! !! ! ", + " ! !! ! ! !! ! ! !! !! ", + " !! !! ! ! ! ! ! ! !! ! !! ", + " !! !! ! ! ! !! !!!! ! ! ! ", + " !! !! ! ! ! !! !!! ! ", + " !! ! ! ! !! ! ! ! ! ! ! ", + " ! ! ! ! !!! ! ", + " !! ! ! ! !! ", + " ! ! !!!!!! ! ! ", + " ! ! !! ! ", + " ! !!!! ", + " !! !!! ", + " ", + " ", + " ", + " ", + " " + ] +} \ No newline at end of file diff --git a/tests/visual_tests/grids/lines-7-600-600-1.0-grid-reference.json b/tests/visual_tests/grids/lines-7-600-600-1.0-grid-reference.json new file mode 100644 index 000000000..bc5f8eb49 --- /dev/null +++ b/tests/visual_tests/grids/lines-7-600-600-1.0-grid-reference.json @@ -0,0 +1,159 @@ +{ + "keys": [ + "", + "1" + ], + "data": {}, + "grid": [ + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " !! !!! ", + " !! !! !! ", + " ! ! ", + " ! !!! ! ! ! ", + " ! ! ! !! !! ! ! !! ! ", + " ! ! ! !!! ! ! !! ! ", + " ! ! ! !! ! ! !! !! !! ", + " ! !! ! !! ! ! !! ! ", + " ! !! ! ! ! ! ! ! ! ", + " !!! !! !! !! !! ! ! ", + " ! ! !! ! !! !!! ! ", + " ! ! !! !! ! ! !!!!! ! ", + " !! ! ! !! ! ! ! ! ! ! ", + " ! ! ! ! !!! ! !! ! ! !! ! ", + " ! !! ! ! !! !! !! ! ", + " ! !!!! ! !!!! ! !! ! ", + " ! ! ! ! ! ! ! !! ! ", + " !!! !! ! ! ! ! !!!! !! ! ", + " ! !!! ! ! ! ! !! !! ", + " ! !!! ! ! ! !! !! ", + " ! !! !! ! !! ! ! ! ", + " ! !! ! !! ! ! ! ! ", + " ! !! ! ! !! ! ", + " ! ! ! ! ! ! !! ! ", + " ! ! ! ! !! !! !! ", + " !! ! ! ! !! ", + " ! !! ! ! !! ! ! ! ! ", + " !!! !!! !! !! ! ! ", + " !! ! ! !! ! ! ", + " ! ! ! !! !! ! ! !!!!! ", + " ! !! !! ! !! ! !! ! ", + " !! ! ! ! ! !!!!! !! !! ! ", + " !!! ! ! ! !!! !! ! ", + " ! ! ! ! ! ! !! !! ", + " !!! !! ! ! ! !! ! ! !! !! ", + " ! !!! ! ! !! ! !! ", + " !! !! ! ! !! !! ! ! ! ", + " ! !! !! !! !! ! ! ! ", + " ! ! !! ! !! ! ! ! ! ", + " ! ! ! ! ! ! !! ! ", + " ! !! ! ! ", + " ! ! ! !! !! !! ", + " !! !! ! ! !! ! !!! !! ", + " !! !! ! ! ! ! ! ! ", + " !!! ! !! !! !! ! ! ! ! ! ", + " ! !!!!! ! ! !! ! ", + " ! ! ! !!!!! ! ", + " ! !! ! ! ! ! !! ! !! !! ", + " !!! !! ! ! !!!! ! ", + " ! !!! !! ! ! ", + " ! ! ! ! !! !!!! ! ", + " ! ! ! ! !! !! ! !! ! ", + " ! !!! ! ! !! !! ! !! !! ", + " ! !! !!! !!! !! ! ! !! ! ", + " !! !! !! ! ", + " ! !! ! ! ! ", + " ! ! ! ", + " ! ! ! ! ! ! !! ", + " ! ! ! ! ! ! !! ! ", + " ! !! ! ! !! !! !! !! !! ", + " ! !! !! !! !! !! ! !! ", + " ! !! ! ! !! ! ! ", + " ! ! ! ! !!!! !! ! ", + " ! !! ! ! !! ! !! ! ", + " !! !! ! !! ! !!!! ! ", + " ! ! !! ! ! ! !! !! !! !! ! ", + " !! !! !! ! ! !! ! ", + " ! !!!! ", + " ! ! ! ! ! !! ! !! !!! ", + " !! !! ! ! ! ! ! !! !! ", + " !! ! !! ! !! ! !! !!! ", + " !! ! ! !! !! ! ! ! ! ", + " ! ! ! ! ", + " ! ! ", + " ! ! ! ! ", + " ! ! ! ! !! ! ! ! ! ", + " ! ! ! ! !! ! !! !! ", + " !! !! ! !! !! ! !!!! !!! ", + " !! !! !! !!! ! ! ", + " !!!! !! !! ! ! ", + " !! ! ! !! !! ! ! ! ! ", + " ! ! ! ! !! !! !!!!! ! ", + " ! !! ! ! ! ! ! !! !! !! ", + " !!! !! ! !!! !! !! ! ", + " !! !!!!! ! ! ! ! ! ! ", + " ! ! ! ! !! !! !! ! ", + " ! ! !! !! !! !! !! !! ", + " !!!! ! !! ! ! !! !! ", + " ! !! !! ! ! ! !! ", + " ! !! !! ! ! ", + " ! !! !! ! ! ! ! ", + " ! ! ! ! ! ! ! ! ", + " ! ! !! ! !! ! ", + " !!!!!! !! ! ", + " !! !! ! ! ! !! !!! ", + " ! ! !! ! ! !! ! !! ", + " ! !! !! ! ! ! !! ! ", + " ! !! !! ! ! !! !!! ! ", + " !! !! ! ! !! !!!! ! ", + " !! !! ! ! !! ! !! !! ! !! ", + " ! ! ! !! ! ! !! ! ", + " !!! ! ! ! ! ", + " ! ! ! !!! ! !! !! ! ! ", + " ! !! ! !! !! !! !! ", + " ! ! ! ! !! !! ! !! !! ", + " !! !! !! !! ! ! !! ! ", + " ! !! ! ! ! ! ! ! ", + " ! !! !! ! ! ! ", + " ! ! ! ! ! ", + " ! !! ! ! ! !! ! ", + " ! ! !! ! ! ! ! ", + " !! ! !! ! ! ! !! ", + " ! !! ! !!!! ! !! ! !!! ", + " ! !! !! !! !!! ! !! ", + " !! ! !!! ! ! ! ! !! ! ! ", + " !! ! !!! ! !! ! !!!! ! ! ", + " ! ! ! ! ! !! ! ! ", + " ! ! ! !! !!! ! ! !! ! ! ", + " !! ! ! !! !! !! ! ", + " !!!! ! !! ! ! ! !! ! ! ", + " ! ! ! !!! !! ! ! ! ! ! ", + " ! ! ! ! !! ! !! !!! !! !!! ", + " !! !! ! ! ! !! ! ! !! ", + " !! !! !! !! ! ! ! ! ", + " !! !! !! ! ! ! !!! !! ! ", + " ! ! ! !! ! ! !!!! ! ", + " ! ! ! ! ", + " !! ! !! !! ! ", + " !! !! !! ! ", + " !! ! !!! ", + " !! !!!! ", + " ", + " !!! ", + " ", + " ", + " ", + " ", + " ", + " ", + " " + ] +} \ No newline at end of file diff --git a/tests/visual_tests/grids/lines-7-800-800-1.0-grid-reference.json b/tests/visual_tests/grids/lines-7-800-800-1.0-grid-reference.json new file mode 100644 index 000000000..7a173629d --- /dev/null +++ b/tests/visual_tests/grids/lines-7-800-800-1.0-grid-reference.json @@ -0,0 +1,209 @@ +{ + "keys": [ + "", + "1" + ], + "data": {}, + "grid": [ + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " !!! !! ! ", + " !! !!! ", + " !!! !! !! ", + " ! ! !! !!!!!! ! ! ! ! ", + " ! ! !!! !! ! ! !! ! ", + " ! ! ! ! ! ! ! ! !! !! !! ! ", + " !! !! !!!!! ! !! ! !! !! ! ", + " ! !!! !!! ! !!! ! !!!!! ! ", + " !! ! !! ! ! ! ! ! ! !! ! ", + " !!! ! ! ! ! ! !! !! ! ", + " !! ! ! ! ! ! ! !!! ! ", + " !! !! ! ! !!!! ! ! ", + " ! !! !! ! !! ! ! ! !! ! ", + " ! ! ! !! ! !! !! ! ", + " ! ! ! ! ! ! !! !! ! ", + " ! ! !! ! ! !!!!! ! ", + " !! !! ! ! ! ! !! ! ", + " !! !! ! !! ! ! ! !! ! ", + " ! !! ! !! ! !! ! ! ", + " !!!! !!! !! ! ! ! ! ", + " !! !!!! ! ! ! ", + " ! ! ! ! ! ! ! ! ! ", + " ! !! ! !! ! !! ! !! !! ! ", + " ! ! ! ! !! ! !! ! ", + " !! !! !!! ! ! !! !!! ! !! ", + " ! ! !! ! ! !! ! ! ", + " !! ! ! ! !! ! ! ", + " !! !! !! ! !! ! ! ", + " ! !! ! ! !! ! ! ! ", + " ! ! ! ! ! ! ! !!! ", + " ! ! ! !! ! !! !! ! ", + " ! ! ! !! ! ! !! !! ! ", + " !! !!!!! !!!! ! ", + " !! !! ! ! !! !! ! !! ", + " !! !! ! ! ! !! !! ", + " !!!!! !! ! ! !! !! ", + " ! ! !! ! ! !!!! ! ! ! ", + " !! !! ! ! ! ! ! ", + " ! ! ! !!! !! !! ! ! ! ", + " !! ! ! ! !! ! !! ! ", + " ! !!!! ! ! !! ! ! !! ", + " !! !! ! ! !! !! ! !! ! ", + " ! ! ! !! !! ! !!! ! ", + " !! ! !! ! ! ! ! ", + " ! !! !!!! ! ! ! ! ! ! ", + " ! !! ! ! !! !! ! ", + " ! !! ! !! !! !!!!! ! ", + " ! ! !! !! !! ! ", + " ! ! ! !! ! ! ! ", + " ! ! ! !! !!! ! ", + " ! ! ! !! ! !! ! ! ", + " !! ! ! ! !! ! !!!! !! ", + " !! ! !!! ! !! !! ! !! !!! ", + " !! ! !! ! ! ! ! ! ", + " ! !! ! !!! !! !! ! ! ! ", + " ! ! ! ! ! ! ", + " !!! ! ! !! !! ", + " ! !!!! ! ! !! !! !! !! ", + " !! !! ! !! ! !! !! ", + " ! !! ! ! ! ! ! !! !!! ", + " !!! ! ! ! ! !! !! !! ", + " ! ! !!! ! !! !! ! ", + " ! !! !! ! ! ! ! ! ", + " ! !! !!! ! !! ! !!! ! ", + " ! ! ! !!! !! ", + " !! !! ! ! ! ", + " !!! ! ! ! !! ! ! ", + " !! !! ! ! ! !!! ! ", + " ! !! ! ! ! ! !!! ! !! ! ", + " !! !! ! ! !!! !! ! ", + " ! ! ! ! !! ", + " ! ! !! ", + " ! ! ! ! ! !! ! !! ! ! ! ", + " !!! !! ! !! ! ! ! ! ", + " !! !!!! ! !! !! ! !! !! ! ", + " ! ! !! !! ! !! ! ", + " ! ! !! ! !!! ! ! ", + " !! ! ! ! ! !! ", + " !! ! !! ! ! ! ! ! ", + " !! !! ! ! ! ! ! ! ! ", + " ! !! !! ! !! !! !!! !! ! ", + " !! !! !! !! !!!! ", + " ! !! ! ! ! ", + " ! ! !!!! !! ! ", + " ! !! ! ! !! ! !!! ! ", + " ! !! ! !! ! ! !!!! ", + " ! !! !! ! ! !! !! !! !! !! ", + " !!! ! !! !! ! ! !! !! ", + " ! ", + " ! ! ! ! ! ! !! ! ", + " !! !! ! ! ! ! ! ! ", + " !!!!! ! ! !! ! !! ! ", + " ! ! ! !! !! ! ! !! ! ", + " ! ! ! ! !! !! !! ", + " ! ! ! !! ", + " ! !! ! ! ! ! ! ", + " ! !! ! ! !! !! ! ! ! ! ", + " ! !! !!! !! ! !!! !! ! ", + " ! ! ! !! ! ! !!!!! ! ", + " !! ! ! ! ! ! ", + " ! ! ! ", + " ! ! !! !! ! !! ! ", + " ! !! ! ! !! ! !! ! !! ! ", + " !! !! !! ! ! !! !! ! ", + " !! !! !!! ! ! !! !! ! !! ", + " ! !! ! ! !! ! !! ! ", + " ! ! !! ! ", + " ! ! !! !! !! ! ! ! ", + " !!!! ! !! !! ! !! ! ", + " ! ! !!! ! ! ! ! !! ! ", + " !! !! ! ! ! ! ! ! !! ", + " !! !! ! ! !! !! ", + " !!! ! !! !! ! ! !! ", + " ! !! ! !! !! !! !! ! ", + " !! ! ! !! ! ! !! ! ", + " ! !! !! !! ! !!! ! ", + " ! ! ! !!!!! ! !! ", + " ! ! ! ! ! ! ! ! ", + " ! ! ! ! ! ! !!! !! ! ", + " !! ! ! !!!! ! !! ! ", + " ! !! ! !! ! !! ! ", + " !! !! !! ! ! !! !! ! !! !!! ", + " !! ! ! ! ! ! ! ", + " ! ! ! ! ! !! ! ! ! ", + " ! !! ! !!! !! ! ", + " !!! !! ! !! ! ! ! ", + " !! !!!! ! ! ! ! !! ! ", + " ! ! ! ! ! !! ! ", + " ! ! ! !!! !! ", + " !! ! ! !! ! ! ! !! ", + " !! !! ! !! ! ! !! !! ! ! ", + " !! !! !! ! ! ! ! ! !! ! ", + " ! !! !!! !! ! !! !!! ", + " ! ! ! ! ! ! !!! ", + " ! ! ! ! ! !!! !! !! ! ! ", + " ! !!!! !! ! ! ! ", + " !! ! !! !! ! ", + " !! ! !!! !! ! !! !! !! ", + " ! !! ! ! ! ! !!! ", + " ! !! !! ! !! ! ! ", + " !! !! ! !! ! ! ! ! ", + " !! !! ! ! !! ! ! ! ! ", + " !! !! ! !! ! ! ! ! ", + " !!!! ! !!!!! ", + " ! ! ! ! !! ! ", + " ! ! !! !! !!! !!! ", + " ! ! !! !!! ! ! ", + " ! !! !! ! !! !! ! !! !! ! ", + " ! !! ! !! ! !! ! ! ! ", + " ! !! !!! !!! ! ! !! ! ", + " ! !! ! !! !! ! !! !!! ", + " ! ! ! ! !! ", + " ! !!! ! !! !! ! ", + " !! ! !! !! !! !! ", + " ! ! !! ! ! ! !! ", + " !!!! !! ! !!! !! !! !!! ", + " !! ! !!! ! !! !! ! ! ! ", + " !! ! !! !!! !! ! ! ! ", + " !! !! ! !! ! !! !! ! ", + " ! !! ! ! ! ! !! ! ", + " !!! ! !! ! ! ! ! ! ", + " !!! ! !! ! ! ! ! ", + " ! ! ! ! !! ! ! !! ", + " ! ! !! ! ! !! !! ! ! ", + " !! !! ! ! !! ! !!! ! !! ! ! ! ", + " !! !! !! ! ! !! ! ! !! ! !! ", + " !! !! !! ! !!! ! !!!!!! ! ! ! ", + " ! !! ! ! ! !!!! ! ! ", + " ! ! !!!!!! !! ! ! ", + " ! ! !!!!!! !! ", + " ! !! !! ", + " !!!! ! ! ", + " !!!! ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " " + ] +} \ No newline at end of file diff --git a/tests/visual_tests/images/line-offset-900-250-1.0-agg-reference.png b/tests/visual_tests/images/line-offset-900-250-1.0-agg-reference.png index bdcaa151b..a36ab68e2 100644 Binary files a/tests/visual_tests/images/line-offset-900-250-1.0-agg-reference.png and b/tests/visual_tests/images/line-offset-900-250-1.0-agg-reference.png differ diff --git a/tests/visual_tests/images/line-offset-900-250-1.0-cairo-reference.png b/tests/visual_tests/images/line-offset-900-250-1.0-cairo-reference.png index 5ca6880b1..8d153fea0 100644 Binary files a/tests/visual_tests/images/line-offset-900-250-1.0-cairo-reference.png and b/tests/visual_tests/images/line-offset-900-250-1.0-cairo-reference.png differ diff --git a/tests/visual_tests/images/line-offset-900-250-2.0-agg-reference.png b/tests/visual_tests/images/line-offset-900-250-2.0-agg-reference.png index 12d963b78..6f381d2d9 100644 Binary files a/tests/visual_tests/images/line-offset-900-250-2.0-agg-reference.png and b/tests/visual_tests/images/line-offset-900-250-2.0-agg-reference.png differ diff --git a/tests/visual_tests/images/line-offset-900-250-2.0-cairo-reference.png b/tests/visual_tests/images/line-offset-900-250-2.0-cairo-reference.png index c4f7dfd55..1d91d6858 100644 Binary files a/tests/visual_tests/images/line-offset-900-250-2.0-cairo-reference.png and b/tests/visual_tests/images/line-offset-900-250-2.0-cairo-reference.png differ diff --git a/tests/visual_tests/images/lines-5-200-200-1.0-agg-reference.png b/tests/visual_tests/images/lines-5-200-200-1.0-agg-reference.png index ec483135d..37b220cfe 100644 Binary files a/tests/visual_tests/images/lines-5-200-200-1.0-agg-reference.png and b/tests/visual_tests/images/lines-5-200-200-1.0-agg-reference.png differ diff --git a/tests/visual_tests/images/lines-5-200-200-1.0-cairo-reference.png b/tests/visual_tests/images/lines-5-200-200-1.0-cairo-reference.png index 394179e5e..baa000b32 100644 Binary files a/tests/visual_tests/images/lines-5-200-200-1.0-cairo-reference.png and b/tests/visual_tests/images/lines-5-200-200-1.0-cairo-reference.png differ diff --git a/tests/visual_tests/images/lines-5-200-200-2.0-agg-reference.png b/tests/visual_tests/images/lines-5-200-200-2.0-agg-reference.png index 74b82f537..c9df58653 100644 Binary files a/tests/visual_tests/images/lines-5-200-200-2.0-agg-reference.png and b/tests/visual_tests/images/lines-5-200-200-2.0-agg-reference.png differ diff --git a/tests/visual_tests/images/lines-5-200-200-2.0-cairo-reference.png b/tests/visual_tests/images/lines-5-200-200-2.0-cairo-reference.png index f7f4d4c4c..bfb7ef81c 100644 Binary files a/tests/visual_tests/images/lines-5-200-200-2.0-cairo-reference.png and b/tests/visual_tests/images/lines-5-200-200-2.0-cairo-reference.png differ diff --git a/tests/visual_tests/images/lines-5-400-400-1.0-agg-reference.png b/tests/visual_tests/images/lines-5-400-400-1.0-agg-reference.png index fa4690e82..2a25ea11e 100644 Binary files a/tests/visual_tests/images/lines-5-400-400-1.0-agg-reference.png and b/tests/visual_tests/images/lines-5-400-400-1.0-agg-reference.png differ diff --git a/tests/visual_tests/images/lines-5-400-400-1.0-cairo-reference.png b/tests/visual_tests/images/lines-5-400-400-1.0-cairo-reference.png index 9d278b786..7550ccaf3 100644 Binary files a/tests/visual_tests/images/lines-5-400-400-1.0-cairo-reference.png and b/tests/visual_tests/images/lines-5-400-400-1.0-cairo-reference.png differ diff --git a/tests/visual_tests/images/lines-5-400-400-2.0-agg-reference.png b/tests/visual_tests/images/lines-5-400-400-2.0-agg-reference.png index dc35fd7e3..20f8ad4df 100644 Binary files a/tests/visual_tests/images/lines-5-400-400-2.0-agg-reference.png and b/tests/visual_tests/images/lines-5-400-400-2.0-agg-reference.png differ diff --git a/tests/visual_tests/images/lines-5-400-400-2.0-cairo-reference.png b/tests/visual_tests/images/lines-5-400-400-2.0-cairo-reference.png index 3d74fcfd3..219dd29d8 100644 Binary files a/tests/visual_tests/images/lines-5-400-400-2.0-cairo-reference.png and b/tests/visual_tests/images/lines-5-400-400-2.0-cairo-reference.png differ diff --git a/tests/visual_tests/images/lines-5-600-600-1.0-agg-reference.png b/tests/visual_tests/images/lines-5-600-600-1.0-agg-reference.png index fac6d7505..14d03b917 100644 Binary files a/tests/visual_tests/images/lines-5-600-600-1.0-agg-reference.png and b/tests/visual_tests/images/lines-5-600-600-1.0-agg-reference.png differ diff --git a/tests/visual_tests/images/lines-5-600-600-1.0-cairo-reference.png b/tests/visual_tests/images/lines-5-600-600-1.0-cairo-reference.png index f3dc03a8f..7680daf31 100644 Binary files a/tests/visual_tests/images/lines-5-600-600-1.0-cairo-reference.png and b/tests/visual_tests/images/lines-5-600-600-1.0-cairo-reference.png differ diff --git a/tests/visual_tests/images/lines-5-600-600-2.0-agg-reference.png b/tests/visual_tests/images/lines-5-600-600-2.0-agg-reference.png index 8853be6c8..0e65845c7 100644 Binary files a/tests/visual_tests/images/lines-5-600-600-2.0-agg-reference.png and b/tests/visual_tests/images/lines-5-600-600-2.0-agg-reference.png differ diff --git a/tests/visual_tests/images/lines-5-600-600-2.0-cairo-reference.png b/tests/visual_tests/images/lines-5-600-600-2.0-cairo-reference.png index 764065406..4e60ac240 100644 Binary files a/tests/visual_tests/images/lines-5-600-600-2.0-cairo-reference.png and b/tests/visual_tests/images/lines-5-600-600-2.0-cairo-reference.png differ diff --git a/tests/visual_tests/images/lines-5-800-800-1.0-agg-reference.png b/tests/visual_tests/images/lines-5-800-800-1.0-agg-reference.png index 7e6ad0728..8e404f009 100644 Binary files a/tests/visual_tests/images/lines-5-800-800-1.0-agg-reference.png and b/tests/visual_tests/images/lines-5-800-800-1.0-agg-reference.png differ diff --git a/tests/visual_tests/images/lines-5-800-800-1.0-cairo-reference.png b/tests/visual_tests/images/lines-5-800-800-1.0-cairo-reference.png index e0ffc3dbb..17c62b3c9 100644 Binary files a/tests/visual_tests/images/lines-5-800-800-1.0-cairo-reference.png and b/tests/visual_tests/images/lines-5-800-800-1.0-cairo-reference.png differ diff --git a/tests/visual_tests/images/lines-5-800-800-2.0-agg-reference.png b/tests/visual_tests/images/lines-5-800-800-2.0-agg-reference.png index 32524a16b..a8f26804b 100644 Binary files a/tests/visual_tests/images/lines-5-800-800-2.0-agg-reference.png and b/tests/visual_tests/images/lines-5-800-800-2.0-agg-reference.png differ diff --git a/tests/visual_tests/images/lines-5-800-800-2.0-cairo-reference.png b/tests/visual_tests/images/lines-5-800-800-2.0-cairo-reference.png index c3852cdf5..d9a656cfb 100644 Binary files a/tests/visual_tests/images/lines-5-800-800-2.0-cairo-reference.png and b/tests/visual_tests/images/lines-5-800-800-2.0-cairo-reference.png differ diff --git a/tests/visual_tests/images/lines-7-200-200-1.0-agg-reference.png b/tests/visual_tests/images/lines-7-200-200-1.0-agg-reference.png new file mode 100644 index 000000000..14c4dee20 Binary files /dev/null and b/tests/visual_tests/images/lines-7-200-200-1.0-agg-reference.png differ diff --git a/tests/visual_tests/images/lines-7-200-200-1.0-cairo-reference.png b/tests/visual_tests/images/lines-7-200-200-1.0-cairo-reference.png new file mode 100644 index 000000000..6f5daafcc Binary files /dev/null and b/tests/visual_tests/images/lines-7-200-200-1.0-cairo-reference.png differ diff --git a/tests/visual_tests/images/lines-7-200-200-2.0-agg-reference.png b/tests/visual_tests/images/lines-7-200-200-2.0-agg-reference.png new file mode 100644 index 000000000..9c74f8ff3 Binary files /dev/null and b/tests/visual_tests/images/lines-7-200-200-2.0-agg-reference.png differ diff --git a/tests/visual_tests/images/lines-7-200-200-2.0-cairo-reference.png b/tests/visual_tests/images/lines-7-200-200-2.0-cairo-reference.png new file mode 100644 index 000000000..7a2e465c5 Binary files /dev/null and b/tests/visual_tests/images/lines-7-200-200-2.0-cairo-reference.png differ diff --git a/tests/visual_tests/images/lines-7-400-400-1.0-agg-reference.png b/tests/visual_tests/images/lines-7-400-400-1.0-agg-reference.png new file mode 100644 index 000000000..532a71676 Binary files /dev/null and b/tests/visual_tests/images/lines-7-400-400-1.0-agg-reference.png differ diff --git a/tests/visual_tests/images/lines-7-400-400-1.0-cairo-reference.png b/tests/visual_tests/images/lines-7-400-400-1.0-cairo-reference.png new file mode 100644 index 000000000..59f745d3d Binary files /dev/null and b/tests/visual_tests/images/lines-7-400-400-1.0-cairo-reference.png differ diff --git a/tests/visual_tests/images/lines-7-400-400-2.0-agg-reference.png b/tests/visual_tests/images/lines-7-400-400-2.0-agg-reference.png new file mode 100644 index 000000000..bed71eedd Binary files /dev/null and b/tests/visual_tests/images/lines-7-400-400-2.0-agg-reference.png differ diff --git a/tests/visual_tests/images/lines-7-400-400-2.0-cairo-reference.png b/tests/visual_tests/images/lines-7-400-400-2.0-cairo-reference.png new file mode 100644 index 000000000..bc0aa210c Binary files /dev/null and b/tests/visual_tests/images/lines-7-400-400-2.0-cairo-reference.png differ diff --git a/tests/visual_tests/images/lines-7-600-600-1.0-agg-reference.png b/tests/visual_tests/images/lines-7-600-600-1.0-agg-reference.png new file mode 100644 index 000000000..41584dbda Binary files /dev/null and b/tests/visual_tests/images/lines-7-600-600-1.0-agg-reference.png differ diff --git a/tests/visual_tests/images/lines-7-600-600-1.0-cairo-reference.png b/tests/visual_tests/images/lines-7-600-600-1.0-cairo-reference.png new file mode 100644 index 000000000..53a1cc291 Binary files /dev/null and b/tests/visual_tests/images/lines-7-600-600-1.0-cairo-reference.png differ diff --git a/tests/visual_tests/images/lines-7-600-600-2.0-agg-reference.png b/tests/visual_tests/images/lines-7-600-600-2.0-agg-reference.png new file mode 100644 index 000000000..56b7a5fca Binary files /dev/null and b/tests/visual_tests/images/lines-7-600-600-2.0-agg-reference.png differ diff --git a/tests/visual_tests/images/lines-7-600-600-2.0-cairo-reference.png b/tests/visual_tests/images/lines-7-600-600-2.0-cairo-reference.png new file mode 100644 index 000000000..47ff5d088 Binary files /dev/null and b/tests/visual_tests/images/lines-7-600-600-2.0-cairo-reference.png differ diff --git a/tests/visual_tests/images/lines-7-800-800-1.0-agg-reference.png b/tests/visual_tests/images/lines-7-800-800-1.0-agg-reference.png new file mode 100644 index 000000000..06b84ec5f Binary files /dev/null and b/tests/visual_tests/images/lines-7-800-800-1.0-agg-reference.png differ diff --git a/tests/visual_tests/images/lines-7-800-800-1.0-cairo-reference.png b/tests/visual_tests/images/lines-7-800-800-1.0-cairo-reference.png new file mode 100644 index 000000000..33165a9a2 Binary files /dev/null and b/tests/visual_tests/images/lines-7-800-800-1.0-cairo-reference.png differ diff --git a/tests/visual_tests/images/lines-7-800-800-2.0-agg-reference.png b/tests/visual_tests/images/lines-7-800-800-2.0-agg-reference.png new file mode 100644 index 000000000..884c86734 Binary files /dev/null and b/tests/visual_tests/images/lines-7-800-800-2.0-agg-reference.png differ diff --git a/tests/visual_tests/images/lines-7-800-800-2.0-cairo-reference.png b/tests/visual_tests/images/lines-7-800-800-2.0-cairo-reference.png new file mode 100644 index 000000000..bbbcf97fa Binary files /dev/null and b/tests/visual_tests/images/lines-7-800-800-2.0-cairo-reference.png differ diff --git a/tests/visual_tests/styles/lines-7.xml b/tests/visual_tests/styles/lines-7.xml new file mode 100644 index 000000000..ae4faa5f5 --- /dev/null +++ b/tests/visual_tests/styles/lines-7.xml @@ -0,0 +1,35 @@ + + + + + + + lines + text + + csv + +wkt,nr +"LINESTRING(-1.000 -1.000, -0.958 -0.646, -0.917 -0.331, -0.875 -0.055, -0.833 0.185, -0.792 0.390, -0.750 0.562, -0.708 0.703, -0.667 0.815, -0.625 0.898, -0.583 0.956, -0.542 0.989, -0.500 1.000, -0.458 0.990, -0.417 0.961, -0.375 0.914, -0.333 0.852, -0.292 0.776, -0.250 0.688, -0.208 0.589, -0.167 0.481, -0.125 0.367, -0.083 0.248, -0.042 0.125, 0.000 0.000, 0.042 -0.125, 0.083 -0.248, 0.125 -0.367, 0.167 -0.481, 0.208 -0.589, 0.250 -0.688, 0.292 -0.776, 0.333 -0.852, 0.375 -0.914, 0.417 -0.961, 0.458 -0.990, 0.500 -1.000, 0.542 -0.989, 0.583 -0.956, 0.625 -0.898, 0.667 -0.815, 0.708 -0.703, 0.750 -0.562, 0.792 -0.390, 0.833 -0.185, 0.875 0.055, 0.917 0.331, 0.958 0.646, 1.000 1.000)",1 + + + + + + + + + diff --git a/tests/visual_tests/test.py b/tests/visual_tests/test.py index 5df83702e..a0173e382 100755 --- a/tests/visual_tests/test.py +++ b/tests/visual_tests/test.py @@ -95,6 +95,7 @@ files = { 'lines-4': {'sizes': sizes_few_square,'bbox':default_text_box}, 'lines-5': {'sizes': sizes_few_square,'bbox':default_text_box}, 'lines-6': {'sizes': sizes_few_square,'bbox':default_text_box}, + 'lines-7': {'sizes': sizes_few_square,'bbox':mapnik.Box2d(-1.2, -1.2, 1.2, 1.2)}, 'lines-shield': {'sizes': sizes_few_square,'bbox':default_text_box}, 'collision': {'sizes':[(600,400)]}, 'shield-on-polygon': {'sizes':[(600,400)]}, diff --git a/utils/nik2img/build.py b/utils/nik2img/build.py new file mode 100644 index 000000000..304cc9be8 --- /dev/null +++ b/utils/nik2img/build.py @@ -0,0 +1,34 @@ +import os +import glob +from copy import copy + +Import ('env') +program_env = env.Clone() + +source = Split( + """ + nik2img.cpp + """ + ) + +program_env['CXXFLAGS'] = copy(env['LIBMAPNIK_CXXFLAGS']) +program_env.Append(CPPDEFINES = env['LIBMAPNIK_DEFINES']) + +if env['HAS_CAIRO']: + program_env.PrependUnique(CPPPATH=env['CAIRO_CPPPATHS']) + program_env.Append(CPPDEFINES = '-DHAVE_CAIRO') + +boost_program_options = 'boost_program_options%s' % env['BOOST_APPEND'] +libraries = ['mapnik',boost_program_options] +libraries.extend(copy(env['LIBMAPNIK_LIBS'])) +if env['RUNTIME_LINK'] == 'static' and env['PLATFORM'] == 'Linux': + libraries.append('dl') + +nik2img = program_env.Program('nik2img', source, LIBS=libraries) +Depends(nik2img, env.subst('../../src/%s' % env['MAPNIK_LIB_NAME'])) + +if 'uninstall' not in COMMAND_LINE_TARGETS: + env.Install(os.path.join(env['INSTALL_PREFIX'],'bin'), nik2img) + env.Alias('install', os.path.join(env['INSTALL_PREFIX'],'bin')) + +env['create_uninstall_target'](env, os.path.join(env['INSTALL_PREFIX'],'bin','nik2img')) diff --git a/utils/nik2img/nik2img.cpp b/utils/nik2img/nik2img.cpp new file mode 100644 index 000000000..9657ac9db --- /dev/null +++ b/utils/nik2img/nik2img.cpp @@ -0,0 +1,117 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +int main (int argc,char** argv) +{ + namespace po = boost::program_options; + + bool verbose = false; + bool auto_open = true; + int return_value = 0; + std::string xml_file; + std::string img_file; + mapnik::logger logger; + logger.set_severity(mapnik::logger::error); + + try + { + po::options_description desc("nik2img utility"); + desc.add_options() + ("help,h", "produce usage message") + ("version,V","print version string") + ("verbose,v","verbose output") + ("open","automatically open the file after rendering (os x only)") + ("xml",po::value(),"xml map to read") + ("img",po::value(),"image to render") + ; + + po::positional_options_description p; + p.add("xml",1); + p.add("img",1); + po::variables_map vm; + po::store(po::command_line_parser(argc, argv).options(desc).positional(p).run(), vm); + po::notify(vm); + + if (vm.count("version")) + { + std::clog <<"version " << MAPNIK_VERSION_STRING << std::endl; + return 1; + } + + if (vm.count("help")) + { + std::clog << desc << std::endl; + return 1; + } + + if (vm.count("verbose")) + { + verbose = true; + } + + if (vm.count("open")) + { + auto_open = true; + } + + if (vm.count("xml")) + { + xml_file=vm["xml"].as(); + } + else + { + std::clog << "please provide an xml map as first argument!" << std::endl; + return -1; + } + + if (vm.count("img")) + { + img_file=vm["img"].as(); + } + else + { + std::clog << "please provide an img as second argument!" << std::endl; + return -1; + } + + mapnik::datasource_cache::instance().register_datasources("./plugins/input/"); + mapnik::Map map(600,400); + mapnik::load_map(map,xml_file); + map.zoom_all(); + mapnik::image_32 im(map.width(),map.height()); + mapnik::agg_renderer ren(map,im); + ren.apply(); + mapnik::save_to_file(im,img_file); + if (auto_open) + { + std::ostringstream s; +#ifdef DARWIN + s << "open " << img_file; +#else + s << "xdg-open " << img_file; +#endif + int ret = system(s.str().c_str()); + if (ret != 0) + return_value = ret; + } + else + { + std::clog << "rendered to: " << img_file << "\n"; + } + } + catch (std::exception const& ex) + { + std::clog << "Error " << ex.what() << std::endl; + return -1; + } + return return_value; +} diff --git a/utils/shapeindex/quadtree.hpp b/utils/shapeindex/quadtree.hpp index 57aee0f16..db6478755 100644 --- a/utils/shapeindex/quadtree.hpp +++ b/utils/shapeindex/quadtree.hpp @@ -42,7 +42,7 @@ struct quadtree_node quadtree_node(const box2d& ext) : ext_(ext),data_() { - memset(children_,0,sizeof(quadtree_node*)*4); + std::memset(children_,0,sizeof(quadtree_node*)*4); } ~quadtree_node() @@ -118,7 +118,7 @@ public: void write(std::ostream& out) { char header[16]; - memset(header,0,16); + std::memset(header,0,16); header[0]='m'; header[1]='a'; header[2]='p'; @@ -205,10 +205,10 @@ private: int shape_count=node->data_.size(); int recsize=sizeof(box2d) + 3 * sizeof(int) + shape_count * sizeof(T); char* node_record=new char[recsize]; - memset(node_record,0,recsize); - memcpy(node_record,&offset,4); - memcpy(node_record+4,&node->ext_,sizeof(box2d)); - memcpy(node_record+36,&shape_count,4); + std::memset(node_record,0,recsize); + std::memcpy(node_record,&offset,4); + std::memcpy(node_record+4,&node->ext_,sizeof(box2d)); + std::memcpy(node_record+36,&shape_count,4); for (int i=0;idata_[i]),sizeof(T)); @@ -221,7 +221,7 @@ private: ++num_subnodes; } } - memcpy(node_record + 40 + shape_count * sizeof(T),&num_subnodes,4); + std::memcpy(node_record + 40 + shape_count * sizeof(T),&num_subnodes,4); out.write(node_record,recsize); delete [] node_record;