Merge branch 'master' of github.com:mapnik/mapnik into 3x-msvs

This commit is contained in:
Dane Springmeyer 2014-08-28 17:23:59 -07:00
commit 3c66054524
65 changed files with 537 additions and 291 deletions

View file

@ -3,7 +3,8 @@
#include "agg_conv_clip_polygon.h"
#include <mapnik/geometry.hpp>
#include <mapnik/vertex.hpp>
#include <mapnik/ctrans.hpp>
#include <mapnik/transform_path_adapter.hpp>
#include <mapnik/view_transform.hpp>
#include <mapnik/graphics.hpp>
#include <mapnik/wkt/wkt_factory.hpp>
#include <mapnik/wkt/wkt_grammar_impl.hpp>
@ -11,15 +12,13 @@
#include <mapnik/projection.hpp>
#include <mapnik/proj_transform.hpp>
#include <mapnik/util/fs.hpp>
#include <mapnik/polygon_clipper.hpp>
#include <mapnik/image_util.hpp>
// agg
#include "agg_conv_clip_polygon.h"
// clipper
#include "agg_conv_clipper.h"
#include "agg_path_storage.h"
// boost
#include <mapnik/polygon_clipper.hpp>
// rendering
#include "agg_basics.h"
#include "agg_rendering_buffer.h"
@ -27,21 +26,22 @@
#include "agg_rasterizer_scanline_aa.h"
#include "agg_scanline_u.h"
#include "agg_renderer_scanline.h"
#include <mapnik/image_util.hpp>
// stl
#include <fstream>
void render(mapnik::geometry_type & geom,
mapnik::box2d<double> const& extent,
std::string const& name)
{
using path_type = mapnik::coord_transform<mapnik::CoordTransform,mapnik::geometry_type>;
using path_type = mapnik::transform_path_adapter<mapnik::view_transform,mapnik::geometry_type>;
using ren_base = agg::renderer_base<agg::pixfmt_rgba32_plain>;
using renderer = agg::renderer_scanline_aa_solid<ren_base>;
mapnik::image_32 im(256,256);
im.set_background(mapnik::color("white"));
mapnik::box2d<double> padded_extent = extent;
padded_extent.pad(10);
mapnik::CoordTransform tr(im.width(),im.height(),padded_extent,0,0);
mapnik::view_transform tr(im.width(),im.height(),padded_extent,0,0);
agg::rendering_buffer buf(im.raw_data(),im.width(),im.height(), im.width() * 4);
agg::pixfmt_rgba32_plain pixf(buf);
ren_base renb(pixf);

View file

@ -34,7 +34,7 @@
#include <mapnik/layer.hpp>
#include <mapnik/map.hpp>
#include <mapnik/projection.hpp>
#include <mapnik/ctrans.hpp>
#include <mapnik/view_transform.hpp>
#include <mapnik/feature_type_style.hpp>
#include "mapnik_enumeration.hpp"
@ -345,7 +345,7 @@ void export_map()
">>> m.scale_denominator()\n"
)
.def("view_transform",&Map::view_transform,
.def("view_transform",&Map::transform,
"Return the map ViewTransform object\n"
"which is used internally to convert between\n"
"geographic coordinates and screen coordinates.\n"

View file

@ -25,14 +25,14 @@
#include <boost/python.hpp>
// mapnik
#include <mapnik/ctrans.hpp>
#include <mapnik/view_transform.hpp>
using mapnik::CoordTransform;
using mapnik::view_transform;
struct view_transform_pickle_suite : boost::python::pickle_suite
{
static boost::python::tuple
getinitargs(const CoordTransform& c)
getinitargs(const view_transform& c)
{
using namespace boost::python;
return boost::python::make_tuple(c.width(),c.height(),c.extent());
@ -41,26 +41,26 @@ struct view_transform_pickle_suite : boost::python::pickle_suite
namespace {
mapnik::coord2d forward_point(mapnik::CoordTransform const& t, mapnik::coord2d const& in)
mapnik::coord2d forward_point(mapnik::view_transform const& t, mapnik::coord2d const& in)
{
mapnik::coord2d out(in);
t.forward(out);
return out;
}
mapnik::coord2d backward_point(mapnik::CoordTransform const& t, mapnik::coord2d const& in)
mapnik::coord2d backward_point(mapnik::view_transform const& t, mapnik::coord2d const& in)
{
mapnik::coord2d out(in);
t.backward(out);
return out;
}
mapnik::box2d<double> forward_envelope(mapnik::CoordTransform const& t, mapnik::box2d<double> const& in)
mapnik::box2d<double> forward_envelope(mapnik::view_transform const& t, mapnik::box2d<double> const& in)
{
return t.forward(in);
}
mapnik::box2d<double> backward_envelope(mapnik::CoordTransform const& t, mapnik::box2d<double> const& in)
mapnik::box2d<double> backward_envelope(mapnik::view_transform const& t, mapnik::box2d<double> const& in)
{
return t.backward(in);
}
@ -72,14 +72,14 @@ void export_view_transform()
using mapnik::box2d;
using mapnik::coord2d;
class_<CoordTransform>("ViewTransform",init<int,int,box2d<double> const& > (
class_<view_transform>("ViewTransform",init<int,int,box2d<double> const& > (
"Create a ViewTransform with a width and height as integers and extent"))
.def_pickle(view_transform_pickle_suite())
.def("forward", forward_point)
.def("backward",backward_point)
.def("forward", forward_envelope)
.def("backward",backward_envelope)
.def("scale_x",&CoordTransform::scale_x)
.def("scale_y",&CoordTransform::scale_y)
.def("scale_x",&view_transform::scale_x)
.def("scale_y",&view_transform::scale_y)
;
}

View file

@ -26,10 +26,10 @@
#include <mapnik/layer.hpp>
#include <mapnik/projection.hpp>
#include <mapnik/scale_denominator.hpp>
#include <mapnik/ctrans.hpp>
#include <mapnik/view_transform.hpp>
#include <mapnik/transform_path_adapter.hpp>
#include <mapnik/memory_datasource.hpp>
#include <mapnik/feature_kv_iterator.hpp>
//#include <mapnik/config_error.hpp>
#include <mapnik/image_util.hpp>
#include <mapnik/util/timer.hpp>
@ -48,7 +48,7 @@ using mapnik::box2d;
using mapnik::coord2d;
using mapnik::feature_ptr;
using mapnik::geometry_ptr;
using mapnik::CoordTransform;
using mapnik::view_transform;
using mapnik::projection;
using mapnik::scale_denominator;
using mapnik::feature_kv_iterator;
@ -159,7 +159,7 @@ void MapWidget::mousePressEvent(QMouseEvent* e)
projection map_proj(map_->srs()); // map projection
double scale_denom = scale_denominator(map_->scale(),map_proj.is_geographic());
CoordTransform t(map_->width(),map_->height(),map_->get_current_extent());
view_transform t(map_->width(),map_->height(),map_->get_current_extent());
for (unsigned index = 0; index < map_->layer_count();++index)
{
@ -191,7 +191,7 @@ void MapWidget::mousePressEvent(QMouseEvent* e)
std::get<1>(*itr).to_string().c_str()));
}
using path_type = mapnik::coord_transform<mapnik::CoordTransform,mapnik::geometry_type>;
using path_type = mapnik::transform_path_adapter<mapnik::view_transform,mapnik::geometry_type>;
for (unsigned i=0; i<feat->num_geometries();++i)
{
@ -264,7 +264,7 @@ void MapWidget::mouseReleaseEvent(QMouseEvent* e)
drag_=false;
if (map_)
{
CoordTransform t(map_->width(),map_->height(),map_->get_current_extent());
view_transform t(map_->width(),map_->height(),map_->get_current_extent());
box2d<double> box = t.backward(box2d<double>(start_x_,start_y_,end_x_,end_y_));
map_->zoom_to_box(box);
updateMap();

View file

@ -30,7 +30,7 @@
#include <mapnik/rule.hpp> // for rule, symbolizers
#include <mapnik/box2d.hpp> // for box2d
#include <mapnik/color.hpp> // for color
#include <mapnik/ctrans.hpp> // for CoordTransform
#include <mapnik/view_transform.hpp> // for view_transform
#include <mapnik/image_compositing.hpp> // for composite_mode_e
#include <mapnik/pixel_position.hpp>
#include <mapnik/request.hpp>

View file

@ -162,7 +162,7 @@ void feature_style_processor<Processor>::apply(double scale_denom)
projection proj(m_.srs(),true);
if (scale_denom <= 0.0)
scale_denom = mapnik::scale_denominator(m_.scale(),proj.is_geographic());
scale_denom *= p.scale_factor();
scale_denom *= p.scale_factor(); // FIXME - we might want to comment this out
// Asynchronous query supports:
// This is a two steps process,
@ -293,7 +293,7 @@ void feature_style_processor<Processor>::prepare_layer(layer_rendering_material
std::vector<std::string> const& style_names = lay.styles();
unsigned int num_styles = style_names.size();
if (! num_styles)
if (num_styles == 0)
{
MAPNIK_LOG_DEBUG(feature_style_processor)
<< "feature_style_processor: No style for layer=" << lay.name();
@ -301,7 +301,7 @@ void feature_style_processor<Processor>::prepare_layer(layer_rendering_material
}
mapnik::datasource_ptr ds = lay.datasource();
if (! ds)
if (!ds)
{
MAPNIK_LOG_DEBUG(feature_style_processor)
<< "feature_style_processor: No datasource for layer=" << lay.name();

View file

@ -37,11 +37,15 @@ struct unary_function_types : qi::symbols<char, unary_function_impl>
{
unary_function_types();
};
struct binary_function_types : qi::symbols<char, binary_function_impl>
{
binary_function_types();
};
char const* unary_function_name(unary_function_impl const& fun);
char const* binary_function_name(binary_function_impl const& fun);
} // namespace mapnik
#endif //MAPNIK_FUNCTION_CALL_HPP

View file

@ -32,7 +32,7 @@
#include <mapnik/rule.hpp> // for rule, symbolizers
#include <mapnik/box2d.hpp> // for box2d
#include <mapnik/color.hpp> // for color
#include <mapnik/ctrans.hpp> // for CoordTransform
#include <mapnik/view_transform.hpp> // for view_transform
#include <mapnik/image_compositing.hpp> // for composite_mode_e
#include <mapnik/pixel_position.hpp>
#include <mapnik/renderer_common.hpp>

View file

@ -30,7 +30,7 @@
#include <mapnik/marker_cache.hpp>
#include <mapnik/text/placement_finder.hpp>
#include <mapnik/proj_transform.hpp>
#include <mapnik/ctrans.hpp>
#include <mapnik/view_transform.hpp>
namespace mapnik {
@ -60,7 +60,7 @@ public:
unsigned width,
unsigned height,
double scale_factor,
CoordTransform const &t,
view_transform const &t,
DetectorType &detector,
box2d<double> const& query_extent);

View file

@ -25,7 +25,6 @@
#include <mapnik/json/positions_grammar_impl.hpp>
// boost
#include <boost/spirit/include/support_multi_pass.hpp>
#include <boost/spirit/include/phoenix_object.hpp>
#include <boost/spirit/include/phoenix_stl.hpp>
#include <boost/spirit/include/phoenix_operator.hpp>

View file

@ -48,7 +48,7 @@ namespace mapnik
struct Featureset;
using featureset_ptr = std::shared_ptr<Featureset>;
class feature_type_style;
class CoordTransform;
class view_transform;
class layer;
class MAPNIK_DECL Map : boost::equality_comparable<Map>
@ -389,7 +389,7 @@ public:
double scale_denominator() const;
CoordTransform view_transform() const;
view_transform transform() const;
/*!
* @brief Query a Map layer (by layer index) for features

View file

@ -24,7 +24,7 @@
#define MAPNIK_MARKERS_PLACEMENTS_LINE_HPP
#include <mapnik/markers_placements/point.hpp>
#include <mapnik/ctrans.hpp>
#include <mapnik/view_transform.hpp>
#include <mapnik/debug.hpp>
#include <mapnik/global.hpp> //round

View file

@ -26,7 +26,7 @@
#include <mapnik/config.hpp> // for MAPNIK_DECL
#include <mapnik/font_engine_freetype.hpp> // for face_manager, etc
#include <mapnik/box2d.hpp> // for box2d
#include <mapnik/ctrans.hpp> // for CoordTransform
#include <mapnik/view_transform.hpp> // for view_transform
#include <mapnik/attribute.hpp>
// fwd declarations to speed up compile
@ -41,12 +41,12 @@ namespace mapnik {
struct renderer_common
{
renderer_common(Map const &m, attributes const& vars, unsigned offset_x, unsigned offset_y,
renderer_common(Map const &m, attributes const& vars, unsigned offset_x, unsigned offset_y,
unsigned width, unsigned height, double scale_factor);
renderer_common(Map const &m, attributes const& vars, unsigned offset_x, unsigned offset_y,
renderer_common(Map const &m, attributes const& vars, unsigned offset_x, unsigned offset_y,
unsigned width, unsigned height, double scale_factor,
std::shared_ptr<label_collision_detector4> detector);
renderer_common(request const &req, attributes const& vars, unsigned offset_x, unsigned offset_y,
renderer_common(request const &req, attributes const& vars, unsigned offset_x, unsigned offset_y,
unsigned width, unsigned height, double scale_factor);
renderer_common(renderer_common const& other);
@ -59,15 +59,14 @@ struct renderer_common
freetype_engine &font_engine_;
face_manager<freetype_engine> font_manager_;
box2d<double> query_extent_;
CoordTransform t_;
view_transform t_;
std::shared_ptr<label_collision_detector4> detector_;
private:
renderer_common(unsigned width, unsigned height, double scale_factor,
attributes const& vars, CoordTransform &&t, std::shared_ptr<label_collision_detector4> detector);
attributes const& vars, view_transform &&t, std::shared_ptr<label_collision_detector4> detector);
};
}
#endif /* MAPNIK_RENDERER_COMMON_HPP */

View file

@ -99,7 +99,7 @@ void render_markers_symbolizer(markers_symbolizer const& sym,
renderer_context);
vertex_converter<box2d<double>, vector_dispatch_type, markers_symbolizer,
CoordTransform, proj_transform, agg::trans_affine, conv_types, feature_impl>
view_transform, proj_transform, agg::trans_affine, conv_types, feature_impl>
converter(clip_box, rasterizer_dispatch, sym,common.t_,prj_trans,tr,feature,common.vars_,common.scale_factor_);
if (clip && feature.paths().size() > 0) // optional clip (default: true)
{
@ -138,7 +138,7 @@ void render_markers_symbolizer(markers_symbolizer const& sym,
renderer_context);
vertex_converter<box2d<double>, vector_dispatch_type, markers_symbolizer,
CoordTransform, proj_transform, agg::trans_affine, conv_types, feature_impl>
view_transform, proj_transform, agg::trans_affine, conv_types, feature_impl>
converter(clip_box, rasterizer_dispatch, sym,common.t_,prj_trans,tr,feature,common.vars_,common.scale_factor_);
if (clip && feature.paths().size() > 0) // optional clip (default: true)
{
@ -176,7 +176,7 @@ void render_markers_symbolizer(markers_symbolizer const& sym,
renderer_context);
vertex_converter<box2d<double>, raster_dispatch_type, markers_symbolizer,
CoordTransform, proj_transform, agg::trans_affine, conv_types, feature_impl>
view_transform, proj_transform, agg::trans_affine, conv_types, feature_impl>
converter(clip_box, rasterizer_dispatch, sym,common.t_,prj_trans,tr,feature,common.vars_,common.scale_factor_);
if (clip && feature.paths().size() > 0) // optional clip (default: true)

View file

@ -27,7 +27,8 @@
// mapnik
#include <mapnik/global.hpp>
#include <mapnik/geometry.hpp> // for container stuff
#include <mapnik/ctrans.hpp> // for container stuff
#include <mapnik/view_transform.hpp> // for container stuff
#include <mapnik/transform_path_adapter.hpp>
#include <mapnik/util/path_iterator.hpp>
#include <mapnik/util/container_adapter.hpp>
@ -49,7 +50,7 @@
namespace boost { namespace spirit { namespace traits {
// TODO - this needs to be made generic to any path type
using path_type = mapnik::coord_transform<mapnik::CoordTransform, mapnik::geometry_type>;
using path_type = mapnik::transform_path_adapter<mapnik::view_transform, mapnik::geometry_type>;
template <>
struct is_container<path_type const> : mpl::true_ {} ;

View file

@ -24,7 +24,7 @@
#define MAPNIK_SVG_GENERATOR_HPP
// mapnik
#include <mapnik/ctrans.hpp>
#include <mapnik/view_transform.hpp>
#include <mapnik/color.hpp>
#include <mapnik/geometry.hpp>
#include <mapnik/svg/geometry_svg_generator.hpp>

View file

@ -25,8 +25,8 @@
// mapnik
#include <mapnik/geometry.hpp>
#include <mapnik/ctrans.hpp>
#include <mapnik/view_transform.hpp>
#include <mapnik/transform_path_adapter.hpp>
// boost
#include <boost/iterator/iterator_adaptor.hpp>
#include <memory>
@ -171,7 +171,7 @@ private:
// The Value type is a std::tuple that holds 5 elements, the command and the x and y coordinate.
// Each coordinate is stored twice to match the needs of the grammar.
//using path_iterator_type = path_iterator<std::tuple<unsigned, geometry_type::coord_type, geometry_type::value_type>,
// coord_transform<CoordTransform, geometry_type> >;
// transform_path_adapter<view_transform, geometry_type> >;
}}

View file

@ -33,7 +33,7 @@
#include <mapnik/rule.hpp> // for rule, symbolizers
#include <mapnik/box2d.hpp> // for box2d
#include <mapnik/color.hpp> // for color
#include <mapnik/ctrans.hpp> // for CoordTransform
#include <mapnik/view_transform.hpp> // for view_transform
#include <mapnik/image_compositing.hpp> // for composite_mode_e
#include <mapnik/pixel_position.hpp>
#include <mapnik/request.hpp>

View file

@ -478,20 +478,20 @@ struct extract_raw_value : public util::static_visitor<T1>
};
template <typename T>
MAPNIK_DECL void put(symbolizer_base & sym, keys key, T const& val)
void put(symbolizer_base & sym, keys key, T const& val)
{
constexpr bool enum_ = std::is_enum<T>::value;
detail::put_impl<T, enum_ >::apply(sym, key, val);
}
template <typename T>
MAPNIK_DECL bool has_key(symbolizer_base const& sym, keys key)
bool has_key(symbolizer_base const& sym, keys key)
{
return (sym.properties.count(key) == 1);
}
template <typename T>
MAPNIK_DECL T get(symbolizer_base const& sym, keys key, mapnik::feature_impl const& feature, attributes const& vars, T const& _default_value = T())
T get(symbolizer_base const& sym, keys key, mapnik::feature_impl const& feature, attributes const& vars, T const& _default_value = T())
{
using const_iterator = symbolizer_base::cont_type::const_iterator;
const_iterator itr = sym.properties.find(key);
@ -503,7 +503,7 @@ MAPNIK_DECL T get(symbolizer_base const& sym, keys key, mapnik::feature_impl con
}
template <typename T>
MAPNIK_DECL boost::optional<T> get_optional(symbolizer_base const& sym, keys key, mapnik::feature_impl const& feature, attributes const& vars)
boost::optional<T> get_optional(symbolizer_base const& sym, keys key, mapnik::feature_impl const& feature, attributes const& vars)
{
using const_iterator = symbolizer_base::cont_type::const_iterator;
const_iterator itr = sym.properties.find(key);
@ -515,7 +515,7 @@ MAPNIK_DECL boost::optional<T> get_optional(symbolizer_base const& sym, keys key
}
template <typename T>
MAPNIK_DECL T get(symbolizer_base const& sym, keys key, T const& _default_value = T())
T get(symbolizer_base const& sym, keys key, T const& _default_value = T())
{
using const_iterator = symbolizer_base::cont_type::const_iterator;
const_iterator itr = sym.properties.find(key);
@ -527,7 +527,7 @@ MAPNIK_DECL T get(symbolizer_base const& sym, keys key, T const& _default_value
}
template <typename T>
MAPNIK_DECL boost::optional<T> get_optional(symbolizer_base const& sym, keys key)
boost::optional<T> get_optional(symbolizer_base const& sym, keys key)
{
using const_iterator = symbolizer_base::cont_type::const_iterator;
const_iterator itr = sym.properties.find(key);

View file

@ -22,7 +22,7 @@
//mapnik
#include <mapnik/debug.hpp>
#include <mapnik/label_collision_detector.hpp>
#include <mapnik/ctrans.hpp>
#include <mapnik/view_transform.hpp>
#include <mapnik/expression_evaluator.hpp>
#include <mapnik/text/placement_finder.hpp>
#include <mapnik/text/text_layout.hpp>

View file

@ -29,7 +29,7 @@
#include <mapnik/marker_cache.hpp>
#include <mapnik/text/placement_finder.hpp>
#include <mapnik/proj_transform.hpp>
#include <mapnik/ctrans.hpp>
#include <mapnik/view_transform.hpp>
#include <mapnik/vertex_converters.hpp>
namespace mapnik {
@ -58,7 +58,7 @@ struct placement_finder_adapter
using conv_types = boost::mpl::vector<clip_line_tag , transform_tag, affine_transform_tag, simplify_tag, smooth_tag>;
using vertex_converter_type = vertex_converter<box2d<double>, placement_finder_adapter<placement_finder> , symbolizer_base,
CoordTransform, proj_transform, agg::trans_affine,
view_transform, proj_transform, agg::trans_affine,
conv_types, feature_impl>;
class base_symbolizer_helper
@ -71,7 +71,7 @@ public:
unsigned width,
unsigned height,
double scale_factor,
CoordTransform const& t,
view_transform const& t,
box2d<double> const& query_extent);
protected:
@ -83,7 +83,7 @@ protected:
feature_impl const& feature_;
attributes const& vars_;
proj_transform const& prj_trans_;
CoordTransform const& t_;
view_transform const& t_;
box2d<double> dims_;
box2d<double> const& query_extent_;
float scale_factor_;
@ -119,7 +119,7 @@ public:
unsigned width,
unsigned height,
double scale_factor,
CoordTransform const& t,
view_transform const& t,
FaceManagerT & font_manager,
DetectorT & detector,
box2d<double> const& query_extent,
@ -133,7 +133,7 @@ public:
unsigned width,
unsigned height,
double scale_factor,
CoordTransform const& t,
view_transform const& t,
FaceManagerT & font_manager,
DetectorT & detector,
box2d<double> const& query_extent,

View file

@ -0,0 +1,128 @@
/*****************************************************************************
*
* This file is part of Mapnik (c++ mapping toolkit)
*
* Copyright (C) 2014 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_TRANSFORM_PATH_ADAPTER_HPP
#define MAPNIK_TRANSFORM_PATH_ADAPTER_HPP
#include <mapnik/proj_transform.hpp>
namespace mapnik {
template <typename Transform, typename Geometry>
struct MAPNIK_DECL transform_path_adapter
{
// SFINAE value_type detector
template <typename T>
struct void_type
{
using type = void;
};
template <typename T, typename D, typename _ = void>
struct select_value_type
{
using type = D;
};
template <typename T, typename D>
struct select_value_type<T, D, typename void_type<typename T::value_type>::type>
{
using type = typename T::value_type;
};
using size_type = std::size_t;
using value_type = typename select_value_type<Geometry, void>::type;
transform_path_adapter(Transform const& t,
Geometry & geom,
proj_transform const& prj_trans)
: t_(&t),
geom_(geom),
prj_trans_(&prj_trans) {}
explicit transform_path_adapter(Geometry & geom)
: t_(0),
geom_(geom),
prj_trans_(0) {}
void set_proj_trans(proj_transform const& prj_trans)
{
prj_trans_ = &prj_trans;
}
void set_trans(Transform const& t)
{
t_ = &t;
}
unsigned vertex(double *x, double *y) const
{
unsigned command;
bool ok = false;
bool skipped_points = false;
while (!ok)
{
command = geom_.vertex(x,y);
if (command == SEG_END)
{
return command;
}
double z=0;
ok = prj_trans_->backward(*x, *y, z);
if (!ok) {
skipped_points = true;
}
}
if (skipped_points && (command == SEG_LINETO))
{
command = SEG_MOVETO;
}
t_->forward(x,y);
return command;
}
void rewind(unsigned pos) const
{
geom_.rewind(pos);
}
unsigned type() const
{
return static_cast<unsigned>(geom_.type());
}
Geometry const& geom() const
{
return geom_;
}
private:
Transform const* t_;
Geometry & geom_;
proj_transform const* prj_trans_;
};
}
#endif // MAPNIK_TRANSFORM_PATH_ADAPTER_HPP

View file

@ -27,7 +27,8 @@
// mapnik
#include <mapnik/config.hpp>
#include <mapnik/attribute.hpp>
#include <mapnik/ctrans.hpp>
#include <mapnik/view_transform.hpp>
#include <mapnik/transform_path_adapter.hpp>
#include <mapnik/offset_converter.hpp>
#include <mapnik/simplify.hpp>
#include <mapnik/simplify_converter.hpp>
@ -254,7 +255,7 @@ template <typename T>
struct converter_traits<T,mapnik::transform_tag>
{
using geometry_type = T;
using conv_type = coord_transform<CoordTransform, geometry_type>;
using conv_type = transform_path_adapter<view_transform, geometry_type>;
template <typename Args>
static void setup(geometry_type & geom, Args const& args)

View file

@ -20,8 +20,8 @@
*
*****************************************************************************/
#ifndef MAPNIK_CTRANS_HPP
#define MAPNIK_CTRANS_HPP
#ifndef MAPNIK_VIEW_TRANSFORM_HPP
#define MAPNIK_VIEW_TRANSFORM_HPP
// mapnik
#include <mapnik/config.hpp>
@ -36,129 +36,31 @@
namespace mapnik
{
template <typename Transform, typename Geometry>
struct MAPNIK_DECL coord_transform
{
// SFINAE value_type detector
template <typename T>
struct void_type
{
using type = void;
};
template <typename T, typename D, typename _ = void>
struct select_value_type
{
using type = D;
};
template <typename T, typename D>
struct select_value_type<T, D, typename void_type<typename T::value_type>::type>
{
using type = typename T::value_type;
};
using size_type = std::size_t;
using value_type = typename select_value_type<Geometry, void>::type;
coord_transform(Transform const& t,
Geometry & geom,
proj_transform const& prj_trans)
: t_(&t),
geom_(geom),
prj_trans_(&prj_trans) {}
explicit coord_transform(Geometry & geom)
: t_(0),
geom_(geom),
prj_trans_(0) {}
void set_proj_trans(proj_transform const& prj_trans)
{
prj_trans_ = &prj_trans;
}
void set_trans(Transform const& t)
{
t_ = &t;
}
unsigned vertex(double *x, double *y) const
{
unsigned command;
bool ok = false;
bool skipped_points = false;
while (!ok)
{
command = geom_.vertex(x,y);
if (command == SEG_END)
{
return command;
}
double z=0;
ok = prj_trans_->backward(*x, *y, z);
if (!ok) {
skipped_points = true;
}
}
if (skipped_points && (command == SEG_LINETO))
{
command = SEG_MOVETO;
}
t_->forward(x,y);
return command;
}
void rewind(unsigned pos) const
{
geom_.rewind(pos);
}
unsigned type() const
{
return static_cast<unsigned>(geom_.type());
}
Geometry const& geom() const
{
return geom_;
}
private:
Transform const* t_;
Geometry & geom_;
proj_transform const* prj_trans_;
};
class CoordTransform
class view_transform
{
private:
int width_;
int height_;
box2d<double> extent_;
double offset_x_;
double offset_y_;
const int width_;
const int height_;
const box2d<double> extent_;
const double sx_;
const double sy_;
const double offset_x_;
const double offset_y_;
int offset_;
double sx_;
double sy_;
public:
CoordTransform(int width, int height, const box2d<double>& extent,
view_transform(int width, int height, box2d<double> const& extent,
double offset_x = 0.0, double offset_y = 0.0)
: width_(width),
height_(height),
extent_(extent),
sx_(extent_.width() > 0 ? static_cast<double>(width_) / extent_.width() : 1.0),
sy_(extent_.height() > 0 ? static_cast<double>(height_) / extent_.height() : 1.0),
offset_x_(offset_x),
offset_y_(offset_y),
offset_(0),
sx_(1.0),
sy_(1.0)
{
if (extent_.width() > 0)
sx_ = static_cast<double>(width_) / extent_.width();
if (extent_.height() > 0)
sy_ = static_cast<double>(height_) / extent_.height();
}
offset_(0) {}
view_transform(view_transform const&) = default;
inline int offset() const
{
@ -224,7 +126,7 @@ public:
return c;
}
inline box2d<double> forward(const box2d<double>& e,
inline box2d<double> forward(box2d<double> const& e,
proj_transform const& prj_trans) const
{
double x0 = e.minx();
@ -239,7 +141,7 @@ public:
return box2d<double>(x0, y0, x1, y1);
}
inline box2d<double> forward(const box2d<double>& e) const
inline box2d<double> forward(box2d<double> const& e) const
{
double x0 = e.minx();
double y0 = e.miny();
@ -250,7 +152,7 @@ public:
return box2d<double>(x0, y0, x1, y1);
}
inline box2d<double> backward(const box2d<double>& e,
inline box2d<double> backward(box2d<double> const& e,
proj_transform const& prj_trans) const
{
double x0 = e.minx();
@ -265,7 +167,7 @@ public:
return box2d<double>(x0, y0, x1, y1);
}
inline box2d<double> backward(const box2d<double>& e) const
inline box2d<double> backward(box2d<double> const& e) const
{
double x0 = e.minx();
double y0 = e.miny();
@ -283,4 +185,4 @@ public:
};
}
#endif // MAPNIK_CTRANS_HPP
#endif // MAPNIK_VIEW_TRANSFORM_HPP

View file

@ -26,7 +26,7 @@
#include <mapnik/debug.hpp>
#include <mapnik/image_data.hpp>
#include <mapnik/raster.hpp>
#include <mapnik/ctrans.hpp>
#include <mapnik/view_transform.hpp>
#include <mapnik/feature.hpp>
#include <mapnik/feature_factory.hpp>
#include <mapnik/util/variant.hpp>
@ -43,7 +43,7 @@ using mapnik::query;
using mapnik::coord2d;
using mapnik::box2d;
using mapnik::feature_ptr;
using mapnik::CoordTransform;
using mapnik::view_transform;
using mapnik::geometry_type;
using mapnik::datasource_exception;
using mapnik::feature_factory;
@ -116,7 +116,7 @@ feature_ptr gdal_featureset::get_feature(mapnik::query const& q)
#endif
*/
CoordTransform t(raster_width_, raster_height_, raster_extent_, 0, 0);
view_transform t(raster_width_, raster_height_, raster_extent_, 0, 0);
box2d<double> intersect = raster_extent_.intersect(q.get_bbox());
box2d<double> box = t.forward(intersect);

View file

@ -85,7 +85,6 @@ public:
void parse_geojson(T & stream);
private:
mapnik::datasource::datasource_t type_;
std::map<std::string, mapnik::parameters> statistics_;
mapnik::layer_descriptor desc_;
std::string filename_;
std::string inline_string_;

View file

@ -35,7 +35,7 @@
#include <mapnik/unicode.hpp>
#include <mapnik/value_types.hpp>
#include <mapnik/feature_factory.hpp>
#include <mapnik/ctrans.hpp>
#include <mapnik/view_transform.hpp>
#include <mapnik/raster.hpp>
#include <mapnik/image_data.hpp>
#include <mapnik/util/conversions.hpp>

View file

@ -30,7 +30,7 @@
#include <mapnik/datasource.hpp> // for datasource_exception
#include <mapnik/global.hpp>
#include <mapnik/debug.hpp>
#include <mapnik/ctrans.hpp>
#include <mapnik/view_transform.hpp>
#include <mapnik/raster.hpp>
#include <mapnik/image_data.hpp>
#include <mapnik/util/conversions.hpp>

View file

@ -778,7 +778,7 @@ featureset_ptr postgis_datasource::features_with_context(query const& q,processo
// 1/20 of pixel seems to be a good compromise to avoid
// drop of collapsed polygons.
// See https://github.com/mapnik/mapnik/issues/1639
const double tolerance = std::min(px_gw, px_gh) / 2.0;
const double tolerance = std::min(px_gw, px_gh) / 20.0;
s << ", " << tolerance << ")";
}

View file

@ -25,7 +25,7 @@
// mapnik
#include <mapnik/util/fs.hpp>
#include <mapnik/debug.hpp>
#include <mapnik/ctrans.hpp>
#include <mapnik/view_transform.hpp>
#include <mapnik/image_util.hpp>
#include <mapnik/image_reader.hpp>
#include <mapnik/boolean.hpp>
@ -173,7 +173,7 @@ layer_descriptor raster_datasource::get_descriptor() const
featureset_ptr raster_datasource::features(query const& q) const
{
mapnik::CoordTransform t(width_, height_, extent_, 0, 0);
mapnik::view_transform t(width_, height_, extent_, 0, 0);
mapnik::box2d<double> intersect = extent_.intersect(q.get_bbox());
mapnik::box2d<double> ext = t.forward(intersect);

View file

@ -24,7 +24,7 @@
#include <mapnik/debug.hpp>
#include <mapnik/image_data.hpp>
#include <mapnik/raster.hpp>
#include <mapnik/ctrans.hpp>
#include <mapnik/view_transform.hpp>
#include <mapnik/image_reader.hpp>
#include <mapnik/image_util.hpp>
#include <mapnik/feature_factory.hpp>
@ -82,7 +82,7 @@ feature_ptr raster_featureset<LookupPolicy>::next()
if (image_width > 0 && image_height > 0)
{
mapnik::CoordTransform t(image_width, image_height, extent_, 0, 0);
mapnik::view_transform t(image_width, image_height, extent_, 0, 0);
box2d<double> intersect = bbox_.intersect(curIter_->envelope());
box2d<double> ext = t.forward(intersect);
box2d<double> rem = policy_.transform(ext);
@ -95,14 +95,11 @@ feature_ptr raster_featureset<LookupPolicy>::next()
int end_y = static_cast<int>(std::ceil(ext.maxy()));
// clip to available data
if (x_off < 0)
x_off = 0;
if (y_off < 0)
y_off = 0;
if (end_x > image_width)
end_x = image_width;
if (end_y > image_height)
end_y = image_height;
if (x_off < 0) x_off = 0;
if (y_off < 0) y_off = 0;
if (end_x > image_width) end_x = image_width;
if (end_y > image_height) end_y = image_height;
int width = end_x - x_off;
int height = end_y - y_off;

View file

@ -31,7 +31,7 @@
#include <mapnik/expression_evaluator.hpp>
#include <mapnik/expression.hpp>
#include <mapnik/renderer_common/process_building_symbolizer.hpp>
#include <mapnik/transform_path_adapter.hpp>
// stl
#include <deque>
@ -53,7 +53,7 @@ void agg_renderer<T0,T1>::process(building_symbolizer const& sym,
mapnik::feature_impl & feature,
proj_transform const& prj_trans)
{
using path_type = coord_transform<CoordTransform,geometry_type>;
using path_type = transform_path_adapter<view_transform,geometry_type>;
using ren_base = agg::renderer_base<agg::pixfmt_rgba32_pre>;
using renderer = agg::renderer_scanline_aa_solid<ren_base>;

View file

@ -127,7 +127,7 @@ void agg_renderer<T0,T1>::process(line_pattern_symbolizer const& sym,
simplify_tag,smooth_tag,
offset_transform_tag>;
vertex_converter<box2d<double>, rasterizer_type, line_pattern_symbolizer,
CoordTransform, proj_transform, agg::trans_affine, conv_types, feature_impl>
view_transform, proj_transform, agg::trans_affine, conv_types, feature_impl>
converter(clip_box,ras,sym,common_.t_,prj_trans,tr,feature,common_.vars_,common_.scale_factor_);
if (clip) converter.set<clip_line_tag>(); //optional clip (default: true)

View file

@ -171,7 +171,7 @@ void agg_renderer<T0,T1>::process(line_symbolizer const& sym,
set_join_caps_aa(sym, ras, feature, common_.vars_);
vertex_converter<box2d<double>, rasterizer_type, line_symbolizer,
CoordTransform, proj_transform, agg::trans_affine, conv_types, feature_impl>
view_transform, proj_transform, agg::trans_affine, conv_types, feature_impl>
converter(clip_box,ras,sym,common_.t_,prj_trans,tr,feature,common_.vars_,common_.scale_factor_);
if (clip) converter.set<clip_line_tag>(); // optional clip (default: true)
converter.set<transform_tag>(); // always transform
@ -191,7 +191,7 @@ void agg_renderer<T0,T1>::process(line_symbolizer const& sym,
else
{
vertex_converter<box2d<double>, rasterizer, line_symbolizer,
CoordTransform, proj_transform, agg::trans_affine, conv_types, feature_impl>
view_transform, proj_transform, agg::trans_affine, conv_types, feature_impl>
converter(clip_box,*ras_ptr,sym,common_.t_,prj_trans,tr,feature,common_.vars_,common_.scale_factor_);
if (clip) converter.set<clip_line_tag>(); // optional clip (default: true)

View file

@ -37,6 +37,7 @@
#include <mapnik/svg/svg_path_adapter.hpp>
#include <mapnik/renderer_common/clipping_extent.hpp>
#include <mapnik/renderer_common/render_pattern.hpp>
// agg
#include "agg_basics.h"
#include "agg_rendering_buffer.h"
@ -80,7 +81,7 @@ void agg_renderer<T0,T1>::process(polygon_pattern_symbolizer const& sym,
if (!pat) return;
using clipped_geometry_type = agg::conv_clip_polygon<geometry_type>;
using path_type = coord_transform<CoordTransform,clipped_geometry_type>;
using path_type = transform_path_adapter<view_transform,clipped_geometry_type>;
agg::rendering_buffer buf(current_buffer_->raw_data(), current_buffer_->width(),
current_buffer_->height(), current_buffer_->width() * 4);
@ -159,7 +160,7 @@ void agg_renderer<T0,T1>::process(polygon_pattern_symbolizer const& sym,
using conv_types = boost::mpl::vector<clip_poly_tag,transform_tag,affine_transform_tag,simplify_tag,smooth_tag>;
vertex_converter<box2d<double>, rasterizer, polygon_pattern_symbolizer,
CoordTransform, proj_transform, agg::trans_affine, conv_types, feature_impl>
view_transform, proj_transform, agg::trans_affine, conv_types, feature_impl>
converter(clip_box,*ras_ptr,sym,common_.t_,prj_trans,tr,feature,common_.vars_,common_.scale_factor_);
if (prj_trans.equal() && clip) converter.set<clip_poly_tag>(); //optional clip (default: true)

View file

@ -51,7 +51,7 @@ void agg_renderer<T0,T1>::process(polygon_symbolizer const& sym,
{
using conv_types = boost::mpl::vector<clip_poly_tag,transform_tag,affine_transform_tag,simplify_tag,smooth_tag>;
using vertex_converter_type = vertex_converter<box2d<double>, rasterizer, polygon_symbolizer,
CoordTransform, proj_transform, agg::trans_affine,
view_transform, proj_transform, agg::trans_affine,
conv_types, feature_impl>;
ras_ptr->reset();

View file

@ -27,6 +27,7 @@
#include <mapnik/feature.hpp>
#include <mapnik/proj_transform.hpp>
#include <mapnik/cairo/cairo_renderer.hpp>
#include <mapnik/transform_path_adapter.hpp>
// mapnik symbolizer generics
#include <mapnik/renderer_common/process_building_symbolizer.hpp>
@ -41,7 +42,7 @@ void cairo_renderer<T>::process(building_symbolizer const& sym,
mapnik::feature_impl & feature,
proj_transform const& prj_trans)
{
using path_type = coord_transform<CoordTransform,geometry_type>;
using path_type = transform_path_adapter<view_transform,geometry_type>;
cairo_save_restore guard(context_);
composite_mode_e comp_op = get<composite_mode_e>(sym, keys::comp_op, feature, common_.vars_, src_over);
mapnik::color fill = get<mapnik::color>(sym, keys::fill, feature, common_.vars_, mapnik::color(128,128,128));

View file

@ -112,7 +112,7 @@ void cairo_renderer<T>::process(line_pattern_symbolizer const& sym,
using rasterizer_type = line_pattern_rasterizer<cairo_context>;
rasterizer_type ras(context_, *pattern, width, height);
vertex_converter<box2d<double>, rasterizer_type, line_pattern_symbolizer,
CoordTransform, proj_transform, agg::trans_affine, conv_types, feature_impl>
view_transform, proj_transform, agg::trans_affine, conv_types, feature_impl>
converter(clipping_extent, ras, sym, common_.t_, prj_trans, tr, feature, common_.vars_, common_.scale_factor_);
if (clip) converter.set<clip_line_tag>(); // optional clip (default: true)

View file

@ -85,7 +85,7 @@ void cairo_renderer<T>::process(line_symbolizer const& sym,
clipping_extent.pad(padding);
}
vertex_converter<box2d<double>, cairo_context, line_symbolizer,
CoordTransform, proj_transform, agg::trans_affine, conv_types, feature_impl>
view_transform, proj_transform, agg::trans_affine, conv_types, feature_impl>
converter(clipping_extent,context_,sym,common_.t_,prj_trans,tr,feature,common_.vars_,common_.scale_factor_);
if (clip) converter.set<clip_line_tag>(); // optional clip (default: true)

View file

@ -70,7 +70,7 @@ void cairo_renderer<T>::process(polygon_pattern_symbolizer const& sym,
if (feature.num_geometries() > 0)
{
using clipped_geometry_type = agg::conv_clip_polygon<geometry_type>;
using path_type = coord_transform<CoordTransform,clipped_geometry_type>;
using path_type = transform_path_adapter<view_transform,clipped_geometry_type>;
clipped_geometry_type clipped(feature.get_geometry(0));
clipped.clip_box(clip_box.minx(), clip_box.miny(),
clip_box.maxx(), clip_box.maxy());
@ -104,7 +104,7 @@ void cairo_renderer<T>::process(polygon_pattern_symbolizer const& sym,
using conv_types = boost::mpl::vector<clip_poly_tag,transform_tag,affine_transform_tag,simplify_tag,smooth_tag>;
vertex_converter<box2d<double>, cairo_context, polygon_pattern_symbolizer,
CoordTransform, proj_transform, agg::trans_affine, conv_types, feature_impl>
view_transform, proj_transform, agg::trans_affine, conv_types, feature_impl>
converter(clip_box, context_,sym,common_.t_,prj_trans,tr,feature,common_.vars_,common_.scale_factor_);
if (prj_trans.equal() && clip) converter.set<clip_poly_tag>(); //optional clip (default: true)

View file

@ -40,7 +40,7 @@ void cairo_renderer<T>::process(polygon_symbolizer const& sym,
{
using conv_types = boost::mpl::vector<clip_poly_tag,transform_tag,affine_transform_tag,simplify_tag,smooth_tag>;
using vertex_converter_type = vertex_converter<box2d<double>, cairo_context, polygon_symbolizer,
CoordTransform, proj_transform, agg::trans_affine,
view_transform, proj_transform, agg::trans_affine,
conv_types, feature_impl>;
cairo_save_restore guard(context_);

View file

@ -73,9 +73,9 @@ struct expression_string : util::static_visitor<void>
str_ += "(";
}
util::apply_visitor(expression_string(str_),x.left);
util::apply_visitor(*this,x.left);
str_ += x.type();
util::apply_visitor(expression_string(str_),x.right);
util::apply_visitor(*this,x.right);
if (x.type() != tags::mult::str() && x.type() != tags::div::str())
{
str_ += ")";
@ -87,13 +87,13 @@ struct expression_string : util::static_visitor<void>
{
str_ += Tag::str();
str_ += "(";
util::apply_visitor(expression_string(str_),x.expr);
util::apply_visitor(*this,x.expr);
str_ += ")";
}
void operator() (regex_match_node const & x) const
{
util::apply_visitor(expression_string(str_),x.expr);
util::apply_visitor(*this,x.expr);
str_ +=".match('";
#if defined(BOOST_REGEX_HAS_ICU)
std::string utf8;
@ -108,7 +108,7 @@ struct expression_string : util::static_visitor<void>
void operator() (regex_replace_node const & x) const
{
util::apply_visitor(expression_string(str_),x.expr);
util::apply_visitor(*this,x.expr);
str_ +=".replace(";
str_ += "'";
#if defined(BOOST_REGEX_HAS_ICU)
@ -129,11 +129,21 @@ struct expression_string : util::static_visitor<void>
void operator() (unary_function_call const& call) const
{
str_ += "fun(arg)";// FIXME
str_ += unary_function_name(call.fun);
str_ += "(";
util::apply_visitor(*this,call.arg);
str_ += ")";
}
void operator() (binary_function_call const& call) const
{
str_ += "fun(arg1,arg2)";// FIXME
str_ += binary_function_name(call.fun);
str_ += "(";
util::apply_visitor(*this,call.arg1);
str_ += ",";
util::apply_visitor(*this,call.arg2);
str_ += ")";
}
private:
std::string & str_;

View file

@ -27,48 +27,91 @@ namespace mapnik {
// functions
// exp
inline value_type exp_impl (value_type const& val)
//template <typename T>
struct exp_impl
{
return std::exp(val.to_double());
}
//using type = T;
static constexpr char const* name = "exp";
value_type operator() (value_type const& val) const
{
return std::exp(val.to_double());
}
};
// sin
inline value_type sin_impl (value_type const& val)
struct sin_impl
{
return std::sin(val.to_double());
}
static constexpr char const* name = "sin";
value_type operator() (value_type const& val) const
{
return std::sin(val.to_double());
}
};
// cos
inline value_type cos_impl (value_type const& val)
struct cos_impl
{
return std::cos(val.to_double());
}
static constexpr char const* name = "cos";
value_type operator() (value_type const& val) const
{
return std::cos(val.to_double());
}
};
// tan
inline value_type tan_impl (value_type const& val)
struct tan_impl
{
return std::tan(val.to_double());
}
static constexpr char const* name = "tan";
value_type operator() (value_type const& val) const
{
return std::tan(val.to_double());
}
};
// atan
inline value_type atan_impl (value_type const& val)
struct atan_impl
{
return std::atan(val.to_double());
}
static constexpr char const* name = "atan";
value_type operator()(value_type const& val) const
{
return std::atan(val.to_double());
}
};
// abs
inline value_type abs_impl (value_type const& val)
struct abs_impl
{
return std::fabs(val.to_double());
}
static constexpr char const* name = "abs";
value_type operator() (value_type const& val) const
{
return std::fabs(val.to_double());
}
};
unary_function_types::unary_function_types()
{
add
("sin", unary_function_impl(sin_impl))
("cos", unary_function_impl(cos_impl))
("tan", unary_function_impl(tan_impl))
("atan", unary_function_impl(atan_impl))
("exp", unary_function_impl(exp_impl))
("abs", unary_function_impl(abs_impl))
("sin", sin_impl())
("cos", cos_impl())
("tan", tan_impl())
("atan", atan_impl())
("exp", exp_impl())
("abs", abs_impl())
;
}
char const* unary_function_name(unary_function_impl const& fun)
{
if (fun.target<sin_impl>()) return "sin";
else if (fun.target<cos_impl>()) return "cos";
else if (fun.target<tan_impl>()) return "tan";
else if (fun.target<atan_impl>()) return "atan";
else if (fun.target<exp_impl>()) return "exp";
else if (fun.target<abs_impl>()) return "abs";
else return "unknown";
}
// binary functions
// min
inline value_type min_impl(value_type const& arg1, value_type const& arg2)
@ -95,4 +138,18 @@ binary_function_types::binary_function_types()
;
}
char const* binary_function_name(binary_function_impl const& fun)
{
value_type(*const* f_ptr)(value_type const&, value_type const&) =
fun.target<value_type(*)
(value_type const&, value_type const&)>();
if (f_ptr)
{
if (*f_ptr == min_impl) return "min";
else if(*f_ptr == max_impl) return "max";
else if(*f_ptr == pow_impl) return "pow";
}
return "unknown";
}
}

View file

@ -29,6 +29,7 @@
#include <mapnik/grid/grid_renderer.hpp>
#include <mapnik/grid/grid_renderer_base.hpp>
#include <mapnik/grid/grid.hpp>
#include <mapnik/transform_path_adapter.hpp>
#include <mapnik/segment.hpp>
#include <mapnik/expression_evaluator.hpp>
#include <mapnik/expression.hpp>
@ -57,7 +58,7 @@ void grid_renderer<T>::process(building_symbolizer const& sym,
using pixfmt_type = typename grid_renderer_base_type::pixfmt_type;
using color_type = typename grid_renderer_base_type::pixfmt_type::color_type;
using renderer_type = agg::renderer_scanline_bin_solid<grid_renderer_base_type>;
using path_type = coord_transform<CoordTransform,geometry_type>;
using path_type = transform_path_adapter<view_transform,geometry_type>;
agg::scanline_bin sl;
grid_rendering_buffer buf(pixmap_.raw_data(), common_.width_, common_.height_, common_.width_);

View file

@ -120,7 +120,7 @@ void grid_renderer<T>::process(line_pattern_symbolizer const& sym,
put<value_double>(line, keys::smooth, value_double(smooth));
vertex_converter<box2d<double>, grid_rasterizer, line_symbolizer,
CoordTransform, proj_transform, agg::trans_affine, conv_types, feature_impl>
view_transform, proj_transform, agg::trans_affine, conv_types, feature_impl>
converter(clipping_extent,*ras_ptr,line,common_.t_,prj_trans,tr,feature,common_.vars_,common_.scale_factor_);
if (clip) converter.set<clip_line_tag>(); // optional clip (default: true)
converter.set<transform_tag>(); // always transform

View file

@ -92,7 +92,7 @@ void grid_renderer<T>::process(line_symbolizer const& sym,
}
vertex_converter<box2d<double>, grid_rasterizer, line_symbolizer,
CoordTransform, proj_transform, agg::trans_affine, conv_types, feature_impl>
view_transform, proj_transform, agg::trans_affine, conv_types, feature_impl>
converter(clipping_extent,*ras_ptr,sym,common_.t_,prj_trans,tr,feature,common_.vars_,common_.scale_factor_);
if (clip) converter.set<clip_line_tag>(); // optional clip (default: true)
converter.set<transform_tag>(); // always transform

View file

@ -79,7 +79,7 @@ void grid_renderer<T>::process(polygon_pattern_symbolizer const& sym,
using conv_types = boost::mpl::vector<clip_poly_tag,transform_tag,affine_transform_tag,smooth_tag>;
vertex_converter<box2d<double>, grid_rasterizer, polygon_pattern_symbolizer,
CoordTransform, proj_transform, agg::trans_affine, conv_types, feature_impl>
view_transform, proj_transform, agg::trans_affine, conv_types, feature_impl>
converter(common_.query_extent_,*ras_ptr,sym,common_.t_,prj_trans,tr,feature,common_.vars_,common_.scale_factor_);
if (prj_trans.equal() && clip) converter.set<clip_poly_tag>(); //optional clip (default: true)

View file

@ -55,7 +55,7 @@ void grid_renderer<T>::process(polygon_symbolizer const& sym,
using color_type = typename grid_renderer_base_type::pixfmt_type::color_type;
using conv_types = boost::mpl::vector<clip_poly_tag,transform_tag,affine_transform_tag,simplify_tag,smooth_tag>;
using vertex_converter_type = vertex_converter<box2d<double>, grid_rasterizer, polygon_symbolizer,
CoordTransform, proj_transform, agg::trans_affine,
view_transform, proj_transform, agg::trans_affine,
conv_types, feature_impl>;
ras_ptr->reset();

View file

@ -42,7 +42,7 @@ group_symbolizer_helper::group_symbolizer_helper(
attributes const& vars,
const proj_transform &prj_trans,
unsigned width, unsigned height, double scale_factor,
const CoordTransform &t, DetectorType &detector,
const view_transform &t, DetectorType &detector,
const box2d<double> &query_extent)
: base_symbolizer_helper(sym, feature, vars, prj_trans, width, height, scale_factor, t, query_extent),
detector_(detector)
@ -66,7 +66,7 @@ pixel_position_list const& group_symbolizer_helper::get()
if (clipped_)
{
using clipped_geometry_type = agg::conv_clip_polyline<geometry_type>;
using path_type = coord_transform<CoordTransform,clipped_geometry_type>;
using path_type = transform_path_adapter<view_transform,clipped_geometry_type>;
clipped_geometry_type clipped(*geom);
clipped.clip_box(query_extent_.minx(), query_extent_.miny(),
@ -76,7 +76,7 @@ pixel_position_list const& group_symbolizer_helper::get()
}
else
{
using path_type = coord_transform<CoordTransform,geometry_type>;
using path_type = transform_path_adapter<view_transform,geometry_type>;
path_type path(t_, *geom, prj_trans_);
find_line_placements(path);
}

View file

@ -32,7 +32,7 @@
#include <mapnik/datasource.hpp>
#include <mapnik/projection.hpp>
#include <mapnik/proj_transform.hpp>
#include <mapnik/ctrans.hpp>
#include <mapnik/view_transform.hpp>
#include <mapnik/filter_featureset.hpp>
#include <mapnik/hit_test_filter.hpp>
#include <mapnik/scale_denominator.hpp>
@ -612,9 +612,9 @@ double Map::scale_denominator() const
return mapnik::scale_denominator( scale(), map_proj.is_geographic());
}
CoordTransform Map::view_transform() const
view_transform Map::transform() const
{
return CoordTransform(width_,height_,current_extent_);
return view_transform(width_,height_,current_extent_);
}
featureset_ptr Map::query_point(unsigned index, double x, double y) const
@ -677,7 +677,7 @@ featureset_ptr Map::query_point(unsigned index, double x, double y) const
featureset_ptr Map::query_map_point(unsigned index, double x, double y) const
{
CoordTransform tr = view_transform();
view_transform tr = transform();
tr.backward(&x,&y);
return query_point(index,x,y);
}

View file

@ -30,7 +30,7 @@ namespace mapnik {
renderer_common::renderer_common(unsigned width, unsigned height, double scale_factor,
attributes const& vars,
CoordTransform && t,
view_transform && t,
std::shared_ptr<label_collision_detector4> detector)
: width_(width),
height_(height),
@ -48,9 +48,9 @@ renderer_common::renderer_common(Map const &m, attributes const& vars, unsigned
unsigned width, unsigned height, double scale_factor)
: renderer_common(width, height, scale_factor,
vars,
CoordTransform(m.width(),m.height(),m.get_current_extent(),offset_x,offset_y),
view_transform(m.width(),m.height(),m.get_current_extent(),offset_x,offset_y),
std::make_shared<label_collision_detector4>(
box2d<double>(-m.buffer_size(), -m.buffer_size(),
box2d<double>(-m.buffer_size(), -m.buffer_size(),
m.width() + m.buffer_size() ,m.height() + m.buffer_size())))
{}
@ -59,7 +59,7 @@ renderer_common::renderer_common(Map const &m, attributes const& vars, unsigned
std::shared_ptr<label_collision_detector4> detector)
: renderer_common(width, height, scale_factor,
vars,
CoordTransform(m.width(),m.height(),m.get_current_extent(),offset_x,offset_y),
view_transform(m.width(),m.height(),m.get_current_extent(),offset_x,offset_y),
detector)
{}
@ -67,9 +67,9 @@ renderer_common::renderer_common(request const &req, attributes const& vars, uns
unsigned width, unsigned height, double scale_factor)
: renderer_common(width, height, scale_factor,
vars,
CoordTransform(req.width(),req.height(),req.extent(),offset_x,offset_y),
view_transform(req.width(),req.height(),req.extent(),offset_x,offset_y),
std::make_shared<label_collision_detector4>(
box2d<double>(-req.buffer_size(), -req.buffer_size(),
box2d<double>(-req.buffer_size(), -req.buffer_size(),
req.width() + req.buffer_size() ,req.height() + req.buffer_size())))
{}

View file

@ -24,11 +24,13 @@
// mapnik
#include <mapnik/feature.hpp>
#include <mapnik/transform_path_adapter.hpp>
#include <mapnik/svg/output/svg_renderer.hpp>
#include <mapnik/svg/geometry_svg_generator_impl.hpp>
#include <mapnik/svg/output/svg_output_grammars.hpp>
#include <boost/spirit/include/karma.hpp>
#include <mapnik/svg/output/svg_output_attributes.hpp>
// boost
#include <boost/spirit/include/karma.hpp>
namespace mapnik {
@ -74,7 +76,7 @@ bool svg_renderer<OutputIterator>::process(rule::symbolizers const& syms,
proj_transform const& prj_trans)
{
// svg renderer supports processing of multiple symbolizers.
using path_type = coord_transform<CoordTransform, geometry_type>;
using path_type = transform_path_adapter<view_transform, geometry_type>;
bool process_path = false;
// process each symbolizer to collect its (path) information.

View file

@ -22,7 +22,7 @@
//mapnik
#include <mapnik/debug.hpp>
#include <mapnik/label_collision_detector.hpp>
#include <mapnik/ctrans.hpp>
#include <mapnik/view_transform.hpp>
#include <mapnik/expression_evaluator.hpp>
#include <mapnik/text/placement_finder_impl.hpp>
#include <mapnik/text/text_layout.hpp>

View file

@ -45,7 +45,7 @@ base_symbolizer_helper::base_symbolizer_helper(
attributes const& vars,
proj_transform const& prj_trans,
unsigned width, unsigned height, double scale_factor,
CoordTransform const& t,
view_transform const& t,
box2d<double> const& query_extent)
: sym_(sym),
feature_(feature),
@ -177,7 +177,7 @@ text_symbolizer_helper::text_symbolizer_helper(
attributes const& vars,
proj_transform const& prj_trans,
unsigned width, unsigned height, double scale_factor,
CoordTransform const& t, FaceManagerT & font_manager,
view_transform const& t, FaceManagerT & font_manager,
DetectorT &detector, box2d<double> const& query_extent,
agg::trans_affine const& affine_trans)
: base_symbolizer_helper(sym, feature, vars, prj_trans, width, height, scale_factor, t, query_extent),
@ -270,7 +270,7 @@ text_symbolizer_helper::text_symbolizer_helper(
attributes const& vars,
proj_transform const& prj_trans,
unsigned width, unsigned height, double scale_factor,
CoordTransform const& t, FaceManagerT & font_manager,
view_transform const& t, FaceManagerT & font_manager,
DetectorT & detector, box2d<double> const& query_extent, agg::trans_affine const& affine_trans)
: base_symbolizer_helper(sym, feature, vars, prj_trans, width, height, scale_factor, t, query_extent),
finder_(feature, vars, detector, dims_, *placement_, font_manager, scale_factor),
@ -340,7 +340,7 @@ template text_symbolizer_helper::text_symbolizer_helper(
unsigned width,
unsigned height,
double scale_factor,
CoordTransform const& t,
view_transform const& t,
face_manager<freetype_engine> &font_manager,
label_collision_detector4 &detector,
box2d<double> const& query_extent,
@ -354,7 +354,7 @@ template text_symbolizer_helper::text_symbolizer_helper(
unsigned width,
unsigned height,
double scale_factor,
CoordTransform const& t,
view_transform const& t,
face_manager<freetype_engine> &font_manager,
label_collision_detector4 &detector,
box2d<double> const& query_extent,

View file

@ -26,7 +26,7 @@
#include <mapnik/image_data.hpp>
#include <mapnik/image_util.hpp>
#include <mapnik/box2d.hpp>
#include <mapnik/ctrans.hpp>
#include <mapnik/view_transform.hpp>
#include <mapnik/raster.hpp>
#include <mapnik/proj_transform.hpp>
@ -53,9 +53,9 @@ void reproject_and_scale_raster(raster & target, raster const& source,
unsigned mesh_size,
scaling_method_e scaling_method)
{
CoordTransform ts(source.data_.width(), source.data_.height(),
view_transform ts(source.data_.width(), source.data_.height(),
source.ext_);
CoordTransform tt(target.data_.width(), target.data_.height(),
view_transform tt(target.data_.width(), target.data_.height(),
target.ext_, offset_x, offset_y);
unsigned mesh_nx = std::ceil(source.data_.width()/double(mesh_size) + 1);

View file

@ -8,7 +8,7 @@
#include <mapnik/feature_type_style.hpp>
#include <mapnik/rule.hpp>
#include <mapnik/debug.hpp>
#include <mapnik/ctrans.hpp>
#include <mapnik/view_transform.hpp>
#include <mapnik/feature.hpp>
#include <mapnik/vertex_converters.hpp>
#include <mapnik/geometry.hpp>
@ -56,7 +56,7 @@ boost::optional<std::string> linestring_bbox_clipping(mapnik::box2d<double> bbox
projection dst(MAPNIK_LONGLAT_PROJ);
proj_transform prj_trans(src,dst);
line_symbolizer sym;
CoordTransform t(bbox.width(),bbox.height(), bbox);
view_transform t(bbox.width(),bbox.height(), bbox);
mapnik::geometry_container output_paths;
output_geometry_backend backend(output_paths, mapnik::geometry_type::types::LineString);
@ -64,7 +64,7 @@ boost::optional<std::string> linestring_bbox_clipping(mapnik::box2d<double> bbox
mapnik::context_ptr ctx = std::make_shared<mapnik::context_type>();
mapnik::feature_impl f(ctx,0);
vertex_converter<box2d<double>, output_geometry_backend, line_symbolizer,
CoordTransform, proj_transform, agg::trans_affine, conv_types, feature_impl>
view_transform, proj_transform, agg::trans_affine, conv_types, feature_impl>
converter(bbox, backend, sym, t, prj_trans, tr, f, attributes(), 1.0);
converter.set<clip_line_tag>();
@ -100,7 +100,7 @@ boost::optional<std::string> polygon_bbox_clipping(mapnik::box2d<double> bbox,
projection dst(MAPNIK_LONGLAT_PROJ);
proj_transform prj_trans(src,dst);
polygon_symbolizer sym;
CoordTransform t(bbox.width(),bbox.height(), bbox);
view_transform t(bbox.width(),bbox.height(), bbox);
mapnik::geometry_container output_paths;
output_geometry_backend backend(output_paths, mapnik::geometry_type::types::Polygon);
@ -108,7 +108,7 @@ boost::optional<std::string> polygon_bbox_clipping(mapnik::box2d<double> bbox,
mapnik::context_ptr ctx = std::make_shared<mapnik::context_type>();
mapnik::feature_impl f(ctx,0);
vertex_converter<box2d<double>, output_geometry_backend, polygon_symbolizer,
CoordTransform, proj_transform, agg::trans_affine, conv_types, feature_impl>
view_transform, proj_transform, agg::trans_affine, conv_types, feature_impl>
converter(bbox, backend, sym, t, prj_trans, tr, f, attributes(), 1.0);
converter.set<clip_poly_tag>();

View file

@ -0,0 +1,84 @@
{
"keys": [
"",
"1"
],
"data": {},
"grid": [
" !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ",
" !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ",
" !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ",
" !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ",
" !!!!!!!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!!!!!!!!!!!!!!!!!!!!!!! ",
" !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! "
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

View file

@ -58,8 +58,7 @@
"type" : "Feature",
}
]
}
]]></Parameter>
}]]></Parameter>
</Datasource>
</Layer>
</Map>

View file

@ -0,0 +1,61 @@
<Map
background-color="#000"
srs="+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs">
<Style name="polygon">
<Rule>
<PolygonSymbolizer fill="#800000" />
<LineSymbolizer stroke="#ff0000" stroke-width="2" offset="4" />
</Rule>
</Style>
<Style name="frame">
<Rule>
<PolygonSymbolizer />
</Rule>
</Style>
<!--
frame is a layer with a single polygon that is used to ensure that
m.zoom_all() will zoom the map to a reasonable bounding extent
-->
<Layer name="frame" srs="+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs">
<StyleName>frame</StyleName>
<Datasource>
<Parameter name="type">csv</Parameter>
<Parameter name="inline">
wkt|name
Polygon((-75.0 -75.0, -75.0 75.0, 35.0 75.0, 35.0 -75.0, -75.0 -75.0))|bounds
</Parameter>
</Datasource>
</Layer>
<!--
The inline GeoJSON has two polygons with different winding order
(clockwise and counterclockwise), and each of those has two inner rings
(again, one clockwise and one counterclockwise)
-->
<Layer name="bug" srs="+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs">
<StyleName>polygon</StyleName>
<Datasource>
<Parameter name="type">geojson</Parameter>
<Parameter name="inline">{
"type": "FeatureCollection",
"crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } },
"features": [
{ "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates":
[ [ [ 30, -20 ], [ -70, -20 ], [ -70, -70 ], [ 30, -70 ], [ 30, -20 ] ],
[ [ -60, -30 ], [ -30, -30 ], [ -30, -60 ], [ -60, -60 ], [ -60, -30 ] ],
[ [ -10, -30 ], [ -10, -60 ], [ 20, -60 ], [ 20, -30 ], [ -10, -30 ] ]
] } },
{ "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates":
[ [ [ -70, 70 ], [ 30, 70 ], [ 30, 20 ], [ -70, 20 ], [ -70, 70 ] ],
[ [ -60, 60 ], [ -30, 60 ], [ -30, 30 ], [ -60, 30 ], [ -60, 60 ] ],
[ [ 20, 30 ], [ 20, 60 ], [ -10, 60 ], [ -10, 30 ], [ 20, 30 ] ]
] } }
]
}</Parameter>
</Datasource>
</Layer>
</Map>

View file

@ -256,6 +256,7 @@ files = {
'marker-symbolizer-expressions-all':{'sizes':[(256,256)]},
'polygon-symbolizer-expressions':{'sizes':[(256,256)]},
'polygon-symbolizer-expressions-all':{'sizes':[(256,256)]},
'polygon-winding-order': {'sizes':[(300,300)]},
'group-symbolizer-1':{'sizes':[(512,512)]},
'group-symbolizer-2':{'sizes':[(512,512)]},
'group-symbolizer-line-1':{'sizes':[(512,512)]},

View file

@ -56,8 +56,7 @@ int main (int argc,char** argv)
bool auto_open = false;
int return_value = 0;
std::vector<std::string> svg_files;
mapnik::logger logger;
logger.set_severity(mapnik::logger::error);
mapnik::logger::instance().set_severity(mapnik::logger::error);
try
{