+ various win32 fixes, mainly adding extra namespace qualifiers
for vc++10, MAPNIK_DECL ...
This commit is contained in:
parent
49cb8c7368
commit
9088d7bbc8
31 changed files with 110 additions and 68 deletions
|
@ -49,7 +49,7 @@ geometry_type const& getitem_impl(path_type & p, int key)
|
||||||
|
|
||||||
void from_wkt_impl(path_type& p, std::string const& wkt)
|
void from_wkt_impl(path_type& p, std::string const& wkt)
|
||||||
{
|
{
|
||||||
bool result = mapnik::from_wkt(wkt, p);
|
bool result = mapnik::from_wkt(wkt , p);
|
||||||
if (!result) throw std::runtime_error("Failed to parse WKT");
|
if (!result) throw std::runtime_error("Failed to parse WKT");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -46,7 +46,7 @@ void export_grid()
|
||||||
"Grid",
|
"Grid",
|
||||||
"This class represents a feature hitgrid.",
|
"This class represents a feature hitgrid.",
|
||||||
init<int,int,std::string,unsigned>(
|
init<int,int,std::string,unsigned>(
|
||||||
( arg("width"),arg("height"),arg("key")="__id__",arg("resolution")=1 ),
|
( boost::python::arg("width"), boost::python::arg("height"),boost::python::arg("key")="__id__", boost::python::arg("resolution")=1 ),
|
||||||
"Create a mapnik.Grid object\n"
|
"Create a mapnik.Grid object\n"
|
||||||
))
|
))
|
||||||
.def("painted",&painted)
|
.def("painted",&painted)
|
||||||
|
@ -54,7 +54,7 @@ void export_grid()
|
||||||
.def("height",&mapnik::grid::height)
|
.def("height",&mapnik::grid::height)
|
||||||
.def("view",&mapnik::grid::get_view)
|
.def("view",&mapnik::grid::get_view)
|
||||||
.def("encode",encode,
|
.def("encode",encode,
|
||||||
( arg("encoding")="utf",arg("features")=true,arg("resolution")=4 ),
|
( boost::python::arg("encoding")="utf", boost::python::arg("features")=true,boost::python::arg("resolution")=4 ),
|
||||||
"Encode the grid as as optimized json\n"
|
"Encode the grid as as optimized json\n"
|
||||||
)
|
)
|
||||||
.add_property("key",
|
.add_property("key",
|
||||||
|
|
|
@ -45,8 +45,8 @@ void export_grid_view()
|
||||||
.def("width",&mapnik::grid_view::width)
|
.def("width",&mapnik::grid_view::width)
|
||||||
.def("height",&mapnik::grid_view::height)
|
.def("height",&mapnik::grid_view::height)
|
||||||
.def("encode",encode,
|
.def("encode",encode,
|
||||||
( arg("encoding")="utf",arg("add_features")=true,arg("resolution")=4 ),
|
( boost::python::arg("encoding")="utf",boost::python::arg("add_features")=true,boost::python::arg("resolution")=4 ),
|
||||||
"Encode the grid as as optimized json\n"
|
"Encode the grid as as optimized json\n"
|
||||||
)
|
)
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,7 +35,7 @@ using mapnik::metawriter_inmem_ptr;
|
||||||
namespace {
|
namespace {
|
||||||
std::map<std::string, mapnik::value>::const_iterator
|
std::map<std::string, mapnik::value>::const_iterator
|
||||||
mapnik_value_map_begin(const std::map<std::string, mapnik::value> &m) {
|
mapnik_value_map_begin(const std::map<std::string, mapnik::value> &m) {
|
||||||
return m.begin();
|
return m.begin();
|
||||||
}
|
}
|
||||||
|
|
||||||
std::map<std::string, mapnik::value>::const_iterator
|
std::map<std::string, mapnik::value>::const_iterator
|
||||||
|
|
|
@ -148,8 +148,8 @@ struct rule_pickle_suite : boost::python::pickle_suite
|
||||||
extract_symbolizer serializer( r );
|
extract_symbolizer serializer( r );
|
||||||
for (int i=0;i<len(syms);++i)
|
for (int i=0;i<len(syms);++i)
|
||||||
{
|
{
|
||||||
symbolizer symbol = extract<symbolizer>(syms[i]);
|
//symbolizer symbol = extract<symbolizer>(syms[i]);
|
||||||
boost::apply_visitor( serializer, symbol );
|
//boost::apply_visitor( serializer, symbol );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,7 @@ template <class T>
|
||||||
void set_svg_transform(T& symbolizer, std::string const& transform_wkt)
|
void set_svg_transform(T& symbolizer, std::string const& transform_wkt)
|
||||||
{
|
{
|
||||||
agg::trans_affine tr;
|
agg::trans_affine tr;
|
||||||
if (!mapnik::svg::parse_transform(transform_wkt, tr))
|
if (!mapnik::svg::parse_transform(transform_wkt.c_str(), tr))
|
||||||
{
|
{
|
||||||
std::stringstream ss;
|
std::stringstream ss;
|
||||||
ss << "Could not parse transform from '" << transform_wkt << "', expected string like: 'matrix(1, 0, 0, 1, 0, 0)'";
|
ss << "Could not parse transform from '" << transform_wkt << "', expected string like: 'matrix(1, 0, 0, 1, 0, 0)'";
|
||||||
|
|
|
@ -50,12 +50,12 @@ static void grid2utf(T const& grid_type,
|
||||||
typename T::key_type::const_iterator key_pos;
|
typename T::key_type::const_iterator key_pos;
|
||||||
typename T::feature_key_type::const_iterator feature_pos;
|
typename T::feature_key_type::const_iterator feature_pos;
|
||||||
// start counting at utf8 codepoint 32, aka space character
|
// start counting at utf8 codepoint 32, aka space character
|
||||||
uint16_t codepoint = 32;
|
boost::uint16_t codepoint = 32;
|
||||||
|
|
||||||
unsigned array_size = data.width();
|
unsigned array_size = data.width();
|
||||||
for (unsigned y = 0; y < data.height(); ++y)
|
for (unsigned y = 0; y < data.height(); ++y)
|
||||||
{
|
{
|
||||||
uint16_t idx = 0;
|
boost::uint16_t idx = 0;
|
||||||
boost::scoped_array<Py_UNICODE> line(new Py_UNICODE[array_size]);
|
boost::scoped_array<Py_UNICODE> line(new Py_UNICODE[array_size]);
|
||||||
typename T::value_type const* row = data.getRow(y);
|
typename T::value_type const* row = data.getRow(y);
|
||||||
for (unsigned x = 0; x < data.width(); ++x)
|
for (unsigned x = 0; x < data.width(); ++x)
|
||||||
|
@ -103,13 +103,13 @@ static void grid2utf(T const& grid_type,
|
||||||
typename T::key_type::const_iterator key_pos;
|
typename T::key_type::const_iterator key_pos;
|
||||||
typename T::feature_key_type::const_iterator feature_pos;
|
typename T::feature_key_type::const_iterator feature_pos;
|
||||||
// start counting at utf8 codepoint 32, aka space character
|
// start counting at utf8 codepoint 32, aka space character
|
||||||
uint16_t codepoint = 32;
|
boost::uint16_t codepoint = 32;
|
||||||
|
|
||||||
// TODO - use double?
|
// TODO - use double?
|
||||||
unsigned array_size = static_cast<unsigned int>(grid_type.width()/resolution);
|
unsigned array_size = static_cast<unsigned int>(grid_type.width()/resolution);
|
||||||
for (unsigned y = 0; y < grid_type.height(); y=y+resolution)
|
for (unsigned y = 0; y < grid_type.height(); y=y+resolution)
|
||||||
{
|
{
|
||||||
uint16_t idx = 0;
|
boost::uint16_t idx = 0;
|
||||||
boost::scoped_array<Py_UNICODE> line(new Py_UNICODE[array_size]);
|
boost::scoped_array<Py_UNICODE> line(new Py_UNICODE[array_size]);
|
||||||
mapnik::grid::value_type const* row = grid_type.getRow(y);
|
mapnik::grid::value_type const* row = grid_type.getRow(y);
|
||||||
for (unsigned x = 0; x < grid_type.width(); x=x+resolution)
|
for (unsigned x = 0; x < grid_type.width(); x=x+resolution)
|
||||||
|
|
|
@ -43,7 +43,7 @@ enum filter_mode_enum {
|
||||||
DEFINE_ENUM( filter_mode_e, filter_mode_enum );
|
DEFINE_ENUM( filter_mode_e, filter_mode_enum );
|
||||||
|
|
||||||
typedef std::vector<rule> rules;
|
typedef std::vector<rule> rules;
|
||||||
class feature_type_style
|
class MAPNIK_DECL feature_type_style
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
rules rules_;
|
rules rules_;
|
||||||
|
|
|
@ -200,7 +200,7 @@ public:
|
||||||
|
|
||||||
void init(double radius)
|
void init(double radius)
|
||||||
{
|
{
|
||||||
FT_Stroker_Set(s_,radius * (1<<6),
|
FT_Stroker_Set(s_, (FT_Fixed) radius * (1<<6),
|
||||||
FT_STROKER_LINECAP_ROUND,
|
FT_STROKER_LINECAP_ROUND,
|
||||||
FT_STROKER_LINEJOIN_ROUND,
|
FT_STROKER_LINEJOIN_ROUND,
|
||||||
0);
|
0);
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
#define MAPNIK_GRID_HPP
|
#define MAPNIK_GRID_HPP
|
||||||
|
|
||||||
// mapnik
|
// mapnik
|
||||||
|
#include <mapnik/config.hpp>
|
||||||
#include <mapnik/image_data.hpp>
|
#include <mapnik/image_data.hpp>
|
||||||
#include <mapnik/box2d.hpp>
|
#include <mapnik/box2d.hpp>
|
||||||
#include <mapnik/grid/grid_view.hpp>
|
#include <mapnik/grid/grid_view.hpp>
|
||||||
|
@ -31,6 +32,9 @@
|
||||||
#include <mapnik/value.hpp>
|
#include <mapnik/value.hpp>
|
||||||
#include <mapnik/feature.hpp>
|
#include <mapnik/feature.hpp>
|
||||||
|
|
||||||
|
// boost
|
||||||
|
#include <boost/cstdint.hpp>
|
||||||
|
|
||||||
// stl
|
// stl
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <set>
|
#include <set>
|
||||||
|
@ -95,17 +99,17 @@ public:
|
||||||
|
|
||||||
~hit_grid() {}
|
~hit_grid() {}
|
||||||
|
|
||||||
void painted(bool painted)
|
inline void painted(bool painted)
|
||||||
{
|
{
|
||||||
painted_ = painted;
|
painted_ = painted;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool painted() const
|
inline bool painted() const
|
||||||
{
|
{
|
||||||
return painted_;
|
return painted_;
|
||||||
}
|
}
|
||||||
|
|
||||||
void add_feature(mapnik::Feature const& feature)
|
inline void add_feature(mapnik::Feature const& feature)
|
||||||
{
|
{
|
||||||
|
|
||||||
// copies feature props
|
// copies feature props
|
||||||
|
@ -152,12 +156,12 @@ public:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void add_property_name(std::string const& name)
|
inline void add_property_name(std::string const& name)
|
||||||
{
|
{
|
||||||
names_.insert(name);
|
names_.insert(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::set<std::string> property_names() const
|
inline std::set<std::string> const& property_names() const
|
||||||
{
|
{
|
||||||
return names_;
|
return names_;
|
||||||
}
|
}
|
||||||
|
@ -275,7 +279,7 @@ public:
|
||||||
|
|
||||||
inline void blendPixel(value_type feature_id,int x,int y,unsigned int rgba1,int t)
|
inline void blendPixel(value_type feature_id,int x,int y,unsigned int rgba1,int t)
|
||||||
{
|
{
|
||||||
blendPixel2(x,y,rgba1,t,1.0); // do not change opacity
|
blendPixel2(feature_id ,x,y,rgba1,t,1.0); // do not change opacity
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void blendPixel2(value_type feature_id,int x,int y,unsigned int rgba1,int t,double opacity)
|
inline void blendPixel2(value_type feature_id,int x,int y,unsigned int rgba1,int t,double opacity)
|
||||||
|
@ -331,7 +335,7 @@ public:
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef hit_grid<uint16_t> grid;
|
typedef MAPNIK_DECL hit_grid<boost::uint16_t> grid;
|
||||||
|
|
||||||
}
|
}
|
||||||
#endif //MAPNIK_GRID_HPP
|
#endif //MAPNIK_GRID_HPP
|
||||||
|
|
|
@ -30,6 +30,8 @@
|
||||||
#include <mapnik/global.hpp>
|
#include <mapnik/global.hpp>
|
||||||
#include <mapnik/value.hpp>
|
#include <mapnik/value.hpp>
|
||||||
|
|
||||||
|
// boost
|
||||||
|
#include <boost/cstdint.hpp>
|
||||||
// stl
|
// stl
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <set>
|
#include <set>
|
||||||
|
@ -188,7 +190,7 @@ private:
|
||||||
feature_type const& features_;
|
feature_type const& features_;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef hit_grid_view<mapnik::ImageData<uint16_t> > grid_view;
|
typedef hit_grid_view<mapnik::ImageData<boost::uint16_t> > grid_view;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -434,7 +434,7 @@ private:
|
||||||
}
|
}
|
||||||
tries=0;
|
tries=0;
|
||||||
// ignore leaves and also nodes with small mean error and not excessive number of pixels
|
// ignore leaves and also nodes with small mean error and not excessive number of pixels
|
||||||
if ((cur_node->reduce_cost / cur_node->pixel_count + 1) * std::log(long(cur_node->pixel_count)) > 15
|
if ((cur_node->reduce_cost / cur_node->pixel_count + 1) * std::log(double(cur_node->pixel_count)) > 15
|
||||||
&& cur_node->children_count > 0)
|
&& cur_node->children_count > 0)
|
||||||
{
|
{
|
||||||
colors_--;
|
colors_--;
|
||||||
|
|
|
@ -255,6 +255,8 @@ inline MAPNIK_DECL std::string save_to_string(image_32 const& image,
|
||||||
return save_to_string<image_data_32>(image.data(), type, palette);
|
return save_to_string<image_data_32>(image.data(), type, palette);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
template MAPNIK_DECL void save_to_file<image_data_32>(image_data_32 const&,
|
template MAPNIK_DECL void save_to_file<image_data_32>(image_data_32 const&,
|
||||||
std::string const&,
|
std::string const&,
|
||||||
|
@ -263,18 +265,31 @@ template MAPNIK_DECL void save_to_file<image_data_32>(image_data_32 const&,
|
||||||
template MAPNIK_DECL void save_to_file<image_data_32>(image_data_32 const&,
|
template MAPNIK_DECL void save_to_file<image_data_32>(image_data_32 const&,
|
||||||
std::string const&,
|
std::string const&,
|
||||||
rgba_palette const&);
|
rgba_palette const&);
|
||||||
template MAPNIK_DECL std::string save_to_string<image_data_32>(image_data_32 const&,
|
|
||||||
std::string const&,
|
template MAPNIK_DECL void save_to_file<image_data_32>(image_data_32 const&,
|
||||||
rgba_palette const&);
|
std::string const&);
|
||||||
|
|
||||||
|
|
||||||
template MAPNIK_DECL void save_to_file<image_view<image_data_32> > (image_view<image_data_32> const&,
|
template MAPNIK_DECL void save_to_file<image_view<image_data_32> > (image_view<image_data_32> const&,
|
||||||
std::string const&,
|
std::string const&,
|
||||||
std::string const&,
|
std::string const&,
|
||||||
rgba_palette const&);
|
rgba_palette const&);
|
||||||
|
|
||||||
|
template MAPNIK_DECL void save_to_file<image_view<image_data_32> > (image_view<image_data_32> const&,
|
||||||
|
std::string const&,
|
||||||
|
std::string const&);
|
||||||
|
|
||||||
template MAPNIK_DECL void save_to_file<image_view<image_data_32> > (image_view<image_data_32> const&,
|
template MAPNIK_DECL void save_to_file<image_view<image_data_32> > (image_view<image_data_32> const&,
|
||||||
std::string const&,
|
std::string const&,
|
||||||
rgba_palette const&);
|
rgba_palette const&);
|
||||||
|
|
||||||
|
template MAPNIK_DECL void save_to_file<image_view<image_data_32> > (image_view<image_data_32> const&,
|
||||||
|
std::string const&);
|
||||||
|
|
||||||
|
|
||||||
|
template MAPNIK_DECL std::string save_to_string<image_data_32>(image_data_32 const&,
|
||||||
|
std::string const&,
|
||||||
|
rgba_palette const&);
|
||||||
|
|
||||||
template MAPNIK_DECL std::string save_to_string<image_view<image_data_32> > (image_view<image_data_32> const&,
|
template MAPNIK_DECL std::string save_to_string<image_view<image_data_32> > (image_view<image_data_32> const&,
|
||||||
std::string const&,
|
std::string const&,
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
#define METAWRITER_INMEM_HPP
|
#define METAWRITER_INMEM_HPP
|
||||||
|
|
||||||
// mapnik
|
// mapnik
|
||||||
|
#include <mapnik/config.hpp>
|
||||||
#include <mapnik/metawriter.hpp>
|
#include <mapnik/metawriter.hpp>
|
||||||
|
|
||||||
// boost
|
// boost
|
||||||
|
@ -50,7 +51,7 @@ namespace mapnik {
|
||||||
* very common in the rendered image will increase memory usage, especially if
|
* very common in the rendered image will increase memory usage, especially if
|
||||||
* many attributes are also kept.
|
* many attributes are also kept.
|
||||||
*/
|
*/
|
||||||
class metawriter_inmem
|
class MAPNIK_DECL metawriter_inmem
|
||||||
: public metawriter, private boost::noncopyable {
|
: public metawriter, private boost::noncopyable {
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
|
@ -59,8 +60,8 @@ public:
|
||||||
* then the name attribute of rendered features referencing this metawriter
|
* then the name attribute of rendered features referencing this metawriter
|
||||||
* will be kept in memory.
|
* will be kept in memory.
|
||||||
*/
|
*/
|
||||||
metawriter_inmem(metawriter_properties dflt_properties);
|
metawriter_inmem(metawriter_properties dflt_properties);
|
||||||
~metawriter_inmem();
|
~metawriter_inmem();
|
||||||
|
|
||||||
virtual void add_box(box2d<double> const& box, Feature const& feature,
|
virtual void add_box(box2d<double> const& box, Feature const& feature,
|
||||||
CoordTransform const& t,
|
CoordTransform const& t,
|
||||||
|
@ -87,7 +88,7 @@ public:
|
||||||
* are the intersection of the features' properties and the "kept"
|
* are the intersection of the features' properties and the "kept"
|
||||||
* properties of the metawriter.
|
* properties of the metawriter.
|
||||||
*/
|
*/
|
||||||
struct meta_instance {
|
struct MAPNIK_DECL meta_instance {
|
||||||
box2d<double> box;
|
box2d<double> box;
|
||||||
std::map<std::string, value> properties;
|
std::map<std::string, value> properties;
|
||||||
};
|
};
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
|
|
||||||
|
|
||||||
// mapnik
|
// mapnik
|
||||||
|
#include <mapnik/config.hpp>
|
||||||
#include <mapnik/global.hpp>
|
#include <mapnik/global.hpp>
|
||||||
#include <mapnik/config_error.hpp>
|
#include <mapnik/config_error.hpp>
|
||||||
|
|
||||||
|
@ -124,7 +125,7 @@ struct rgba
|
||||||
typedef boost::unordered_map<unsigned, unsigned> rgba_hash_table;
|
typedef boost::unordered_map<unsigned, unsigned> rgba_hash_table;
|
||||||
|
|
||||||
|
|
||||||
class rgba_palette : private boost::noncopyable {
|
class MAPNIK_DECL rgba_palette : private boost::noncopyable {
|
||||||
public:
|
public:
|
||||||
enum palette_type { PALETTE_RGBA = 0, PALETTE_RGB = 1, PALETTE_ACT = 2 };
|
enum palette_type { PALETTE_RGBA = 0, PALETTE_RGB = 1, PALETTE_ACT = 2 };
|
||||||
|
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
#define MAPNIK_PARSE_PATH_HPP
|
#define MAPNIK_PARSE_PATH_HPP
|
||||||
|
|
||||||
// mapnik
|
// mapnik
|
||||||
|
#include <mapnik/config.hpp>
|
||||||
#include <mapnik/attribute.hpp>
|
#include <mapnik/attribute.hpp>
|
||||||
#include <mapnik/feature.hpp>
|
#include <mapnik/feature.hpp>
|
||||||
#include <mapnik/value.hpp>
|
#include <mapnik/value.hpp>
|
||||||
|
@ -41,7 +42,7 @@ typedef boost::variant<std::string, attribute> path_component;
|
||||||
typedef std::vector<path_component> path_expression;
|
typedef std::vector<path_component> path_expression;
|
||||||
typedef boost::shared_ptr<path_expression> path_expression_ptr;
|
typedef boost::shared_ptr<path_expression> path_expression_ptr;
|
||||||
|
|
||||||
path_expression_ptr parse_path(std::string const & str);
|
MAPNIK_DECL path_expression_ptr parse_path(std::string const & str);
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
struct path_processor
|
struct path_processor
|
||||||
|
|
|
@ -51,7 +51,7 @@
|
||||||
|
|
||||||
namespace mapnik
|
namespace mapnik
|
||||||
{
|
{
|
||||||
|
using namespace boost;
|
||||||
namespace qi = boost::spirit::qi;
|
namespace qi = boost::spirit::qi;
|
||||||
namespace phoenix = boost::phoenix;
|
namespace phoenix = boost::phoenix;
|
||||||
namespace standard_wide = boost::spirit::standard_wide;
|
namespace standard_wide = boost::spirit::standard_wide;
|
||||||
|
@ -79,7 +79,7 @@ struct path_expression_grammar : qi::grammar<Iterator, std::vector<path_componen
|
||||||
* (
|
* (
|
||||||
str [ push_back(_val, _1)]
|
str [ push_back(_val, _1)]
|
||||||
|
|
|
|
||||||
( '[' >> attr [ push_back(_val, construct<attribute>( _1 )) ] >> ']')
|
( '[' >> attr [ push_back(_val, construct<mapnik::attribute>( _1 )) ] >> ']')
|
||||||
)
|
)
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
|
@ -68,7 +68,7 @@ enum colorizer_mode_enum
|
||||||
DEFINE_ENUM( colorizer_mode, colorizer_mode_enum );
|
DEFINE_ENUM( colorizer_mode, colorizer_mode_enum );
|
||||||
|
|
||||||
//! \brief Structure to represent a stop position.
|
//! \brief Structure to represent a stop position.
|
||||||
class colorizer_stop {
|
class MAPNIK_DECL colorizer_stop {
|
||||||
public:
|
public:
|
||||||
|
|
||||||
//! \brief Constructor
|
//! \brief Constructor
|
||||||
|
@ -142,7 +142,7 @@ typedef std::vector<colorizer_stop> colorizer_stops;
|
||||||
|
|
||||||
|
|
||||||
//! \brief Class representing the raster colorizer
|
//! \brief Class representing the raster colorizer
|
||||||
class raster_colorizer {
|
class MAPNIK_DECL raster_colorizer {
|
||||||
public:
|
public:
|
||||||
//! \brief Constructor
|
//! \brief Constructor
|
||||||
raster_colorizer(colorizer_mode mode = COLORIZER_LINEAR, const color& _color = color(0,0,0,0));
|
raster_colorizer(colorizer_mode mode = COLORIZER_LINEAR, const color& _color = color(0,0,0,0));
|
||||||
|
|
|
@ -28,6 +28,11 @@
|
||||||
#include <boost/spirit/include/phoenix_core.hpp>
|
#include <boost/spirit/include/phoenix_core.hpp>
|
||||||
#include <boost/spirit/include/phoenix_operator.hpp>
|
#include <boost/spirit/include/phoenix_operator.hpp>
|
||||||
|
|
||||||
|
#ifdef _WINDOWS
|
||||||
|
#define _USE_MATH_DEFINES
|
||||||
|
#include <math.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace mapnik { namespace svg {
|
namespace mapnik { namespace svg {
|
||||||
|
|
||||||
using namespace boost::fusion;
|
using namespace boost::fusion;
|
||||||
|
|
|
@ -23,6 +23,7 @@
|
||||||
#ifndef SVG_PATH_PARSER_HPP
|
#ifndef SVG_PATH_PARSER_HPP
|
||||||
#define SVG_PATH_PARSER_HPP
|
#define SVG_PATH_PARSER_HPP
|
||||||
|
|
||||||
|
#include <mapnik/config.hpp>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
namespace mapnik { namespace svg {
|
namespace mapnik { namespace svg {
|
||||||
|
@ -34,10 +35,10 @@ template <typename PathType>
|
||||||
bool parse_points(const char * wkt, PathType & p);
|
bool parse_points(const char * wkt, PathType & p);
|
||||||
|
|
||||||
template <typename TransformType>
|
template <typename TransformType>
|
||||||
bool parse_transform(const char * wkt, TransformType & tr);
|
bool MAPNIK_DECL parse_transform(const char * wkt, TransformType & tr);
|
||||||
|
|
||||||
template <typename TransformType>
|
//template <typename TransformType>
|
||||||
bool parse_transform(std::string const& wkt, TransformType & tr);
|
//bool MAPNIK_DECL parse_transform(std::string const& wkt, TransformType & tr);
|
||||||
|
|
||||||
}}
|
}}
|
||||||
|
|
||||||
|
|
|
@ -35,6 +35,10 @@
|
||||||
#include <boost/spirit/include/phoenix_operator.hpp>
|
#include <boost/spirit/include/phoenix_operator.hpp>
|
||||||
#include <boost/spirit/home/phoenix/object/construct.hpp>
|
#include <boost/spirit/home/phoenix/object/construct.hpp>
|
||||||
|
|
||||||
|
#ifdef _WINDOWS
|
||||||
|
#define _USE_MATH_DEFINES
|
||||||
|
#include <math.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace mapnik { namespace svg {
|
namespace mapnik { namespace svg {
|
||||||
|
|
||||||
|
|
|
@ -23,6 +23,7 @@
|
||||||
#define TEXT_PLACEMENTS_HPP
|
#define TEXT_PLACEMENTS_HPP
|
||||||
|
|
||||||
//mapnik
|
//mapnik
|
||||||
|
#include <mapnik/config.hpp>
|
||||||
#include <mapnik/enumeration.hpp>
|
#include <mapnik/enumeration.hpp>
|
||||||
|
|
||||||
//stl
|
//stl
|
||||||
|
@ -154,14 +155,14 @@ typedef boost::shared_ptr<text_placements> text_placements_ptr;
|
||||||
|
|
||||||
class text_placements_info_dummy;
|
class text_placements_info_dummy;
|
||||||
|
|
||||||
class text_placements_dummy: public text_placements
|
class MAPNIK_DECL text_placements_dummy: public text_placements
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
text_placement_info_ptr get_placement_info() const;
|
text_placement_info_ptr get_placement_info() const;
|
||||||
friend class text_placement_info_dummy;
|
friend class text_placement_info_dummy;
|
||||||
};
|
};
|
||||||
|
|
||||||
class text_placement_info_dummy : public text_placement_info
|
class MAPNIK_DECL text_placement_info_dummy : public text_placement_info
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
text_placement_info_dummy(text_placements_dummy const* parent) : text_placement_info(parent),
|
text_placement_info_dummy(text_placements_dummy const* parent) : text_placement_info(parent),
|
||||||
|
|
|
@ -47,12 +47,10 @@ struct MAPNIK_DECL text_symbolizer : public symbolizer_base
|
||||||
{
|
{
|
||||||
text_symbolizer(expression_ptr name, std::string const& face_name,
|
text_symbolizer(expression_ptr name, std::string const& face_name,
|
||||||
unsigned size, color const& fill,
|
unsigned size, color const& fill,
|
||||||
text_placements_ptr placements = text_placements_ptr(
|
text_placements_ptr placements = text_placements_ptr(new text_placements_dummy)
|
||||||
boost::make_shared<text_placements_dummy>())
|
|
||||||
);
|
);
|
||||||
text_symbolizer(expression_ptr name, unsigned size, color const& fill,
|
text_symbolizer(expression_ptr name, unsigned size, color const& fill,
|
||||||
text_placements_ptr placements = text_placements_ptr(
|
text_placements_ptr placements = text_placements_ptr(new text_placements_dummy)
|
||||||
boost::make_shared<text_placements_dummy>())
|
|
||||||
);
|
);
|
||||||
text_symbolizer(text_symbolizer const& rhs);
|
text_symbolizer(text_symbolizer const& rhs);
|
||||||
text_symbolizer& operator=(text_symbolizer const& rhs);
|
text_symbolizer& operator=(text_symbolizer const& rhs);
|
||||||
|
|
|
@ -25,9 +25,12 @@
|
||||||
#define VALUE_HPP
|
#define VALUE_HPP
|
||||||
|
|
||||||
// mapnik
|
// mapnik
|
||||||
|
#include <mapnik/global.hpp>
|
||||||
#include <mapnik/unicode.hpp>
|
#include <mapnik/unicode.hpp>
|
||||||
#include <mapnik/config_error.hpp>
|
#include <mapnik/config_error.hpp>
|
||||||
|
|
||||||
// boost
|
// boost
|
||||||
|
|
||||||
#include <boost/variant.hpp>
|
#include <boost/variant.hpp>
|
||||||
#include <boost/scoped_array.hpp>
|
#include <boost/scoped_array.hpp>
|
||||||
#include <boost/concept_check.hpp>
|
#include <boost/concept_check.hpp>
|
||||||
|
@ -49,9 +52,9 @@ inline void to_utf8(UnicodeString const& input, std::string & target)
|
||||||
{
|
{
|
||||||
if (input.length() == 0) return;
|
if (input.length() == 0) return;
|
||||||
|
|
||||||
const int32_t BUF_SIZE = 256;
|
const int BUF_SIZE = 256;
|
||||||
char buf [BUF_SIZE];
|
char buf [BUF_SIZE];
|
||||||
int32_t len;
|
int len;
|
||||||
|
|
||||||
UErrorCode err = U_ZERO_ERROR;
|
UErrorCode err = U_ZERO_ERROR;
|
||||||
u_strToUTF8(buf, BUF_SIZE, &len, input.getBuffer(), input.length(), &err);
|
u_strToUTF8(buf, BUF_SIZE, &len, input.getBuffer(), input.length(), &err);
|
||||||
|
@ -106,10 +109,8 @@ struct equals
|
||||||
|
|
||||||
bool operator() (value_null, value_null) const
|
bool operator() (value_null, value_null) const
|
||||||
{
|
{
|
||||||
// this changed from false to true - see http://trac.mapnik.org/ticket/794
|
return false;
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct not_equals
|
struct not_equals
|
||||||
|
@ -145,21 +146,18 @@ struct not_equals
|
||||||
|
|
||||||
bool operator() (value_null, value_null) const
|
bool operator() (value_null, value_null) const
|
||||||
{
|
{
|
||||||
// TODO - needs review http://trac.mapnik.org/ticket/794
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
bool operator() (value_null, const T &) const
|
bool operator() (value_null, const T &) const
|
||||||
{
|
{
|
||||||
// TODO - needs review http://trac.mapnik.org/ticket/794
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
bool operator() (const T &, value_null) const
|
bool operator() (const T &, value_null) const
|
||||||
{
|
{
|
||||||
// TODO - needs review http://trac.mapnik.org/ticket/794
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -533,7 +531,7 @@ struct to_bool : public boost::static_visitor<bool>
|
||||||
template <typename T>
|
template <typename T>
|
||||||
bool operator() (T val) const
|
bool operator() (T val) const
|
||||||
{
|
{
|
||||||
return bool(val);
|
return val > 0 ? true : false;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -23,13 +23,16 @@
|
||||||
#ifndef MAPNIK_WKT_FACTORY_HPP
|
#ifndef MAPNIK_WKT_FACTORY_HPP
|
||||||
#define MAPNIK_WKT_FACTORY_HPP
|
#define MAPNIK_WKT_FACTORY_HPP
|
||||||
|
|
||||||
#include <string>
|
// mapnik
|
||||||
|
#include <mapnik/config.hpp>
|
||||||
#include <mapnik/geometry.hpp>
|
#include <mapnik/geometry.hpp>
|
||||||
#include <boost/ptr_container/ptr_vector.hpp>
|
#include <boost/ptr_container/ptr_vector.hpp>
|
||||||
|
// stl
|
||||||
|
#include <string>
|
||||||
|
|
||||||
namespace mapnik {
|
namespace mapnik {
|
||||||
|
|
||||||
bool from_wkt(std::string const& wkt, boost::ptr_vector<geometry_type> & paths);
|
MAPNIK_DECL bool from_wkt(std::string const& wkt, boost::ptr_vector<geometry_type> & paths);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -173,5 +173,7 @@ void grid_renderer<T>::render_marker(Feature const& feature, unsigned int step,
|
||||||
pixmap_.add_feature(feature);
|
pixmap_.add_feature(feature);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template class hit_grid<boost::uint16_t>;
|
||||||
template class grid_renderer<grid>;
|
template class grid_renderer<grid>;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -896,7 +896,7 @@ void map_parser::parse_point_symbolizer( rule & rule, ptree const & sym )
|
||||||
if (transform_wkt)
|
if (transform_wkt)
|
||||||
{
|
{
|
||||||
agg::trans_affine tr;
|
agg::trans_affine tr;
|
||||||
if (!mapnik::svg::parse_transform(*transform_wkt,tr))
|
if (!mapnik::svg::parse_transform((*transform_wkt).c_str(),tr))
|
||||||
{
|
{
|
||||||
std::stringstream ss;
|
std::stringstream ss;
|
||||||
ss << "Could not parse transform from '" << transform_wkt
|
ss << "Could not parse transform from '" << transform_wkt
|
||||||
|
@ -1025,7 +1025,7 @@ void map_parser::parse_markers_symbolizer( rule & rule, ptree const & sym )
|
||||||
if (transform_wkt)
|
if (transform_wkt)
|
||||||
{
|
{
|
||||||
agg::trans_affine tr;
|
agg::trans_affine tr;
|
||||||
if (!mapnik::svg::parse_transform(*transform_wkt,tr))
|
if (!mapnik::svg::parse_transform((*transform_wkt).c_str(),tr))
|
||||||
{
|
{
|
||||||
std::stringstream ss;
|
std::stringstream ss;
|
||||||
ss << "Could not parse transform from '" << transform_wkt
|
ss << "Could not parse transform from '" << transform_wkt
|
||||||
|
@ -1671,7 +1671,7 @@ void map_parser::parse_shield_symbolizer( rule & rule, ptree const & sym )
|
||||||
if (transform_wkt)
|
if (transform_wkt)
|
||||||
{
|
{
|
||||||
agg::trans_affine tr;
|
agg::trans_affine tr;
|
||||||
if (!mapnik::svg::parse_transform(*transform_wkt,tr))
|
if (!mapnik::svg::parse_transform((*transform_wkt).c_str(),tr))
|
||||||
{
|
{
|
||||||
std::stringstream ss;
|
std::stringstream ss;
|
||||||
ss << "Could not parse transform from '" << transform_wkt << "', expected string like: 'matrix(1, 0, 0, 1, 0, 0)'";
|
ss << "Could not parse transform from '" << transform_wkt << "', expected string like: 'matrix(1, 0, 0, 1, 0, 0)'";
|
||||||
|
|
|
@ -23,6 +23,7 @@
|
||||||
//$Id$
|
//$Id$
|
||||||
|
|
||||||
// mapnik
|
// mapnik
|
||||||
|
#include <mapnik/global.hpp>
|
||||||
#include <mapnik/proj_transform.hpp>
|
#include <mapnik/proj_transform.hpp>
|
||||||
#include <mapnik/coord.hpp>
|
#include <mapnik/coord.hpp>
|
||||||
#include <mapnik/utils.hpp>
|
#include <mapnik/utils.hpp>
|
||||||
|
|
|
@ -118,12 +118,15 @@ void raster_colorizer::colorize(raster_ptr const& raster,const std::map<std::str
|
||||||
bool hasNoData = false;
|
bool hasNoData = false;
|
||||||
float noDataValue = 0;
|
float noDataValue = 0;
|
||||||
|
|
||||||
if (Props.count("NODATA")>0)
|
const std::map<std::string,value>::const_iterator fi = Props.find("NODATA");
|
||||||
|
if (fi != Props.end())
|
||||||
|
//if (Props.count("NODATA")>0)
|
||||||
{
|
{
|
||||||
hasNoData = true;
|
hasNoData = true;
|
||||||
noDataValue = Props.at("NODATA").to_double();
|
//noDataValue = Props.at("NODATA").to_double();
|
||||||
|
noDataValue = fi->second.to_double();
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i=0; i<len; ++i)
|
for (int i=0; i<len; ++i)
|
||||||
{
|
{
|
||||||
// the GDAL plugin reads single bands as floats
|
// the GDAL plugin reads single bands as floats
|
||||||
|
|
|
@ -42,6 +42,7 @@ bool parse_transform(const char * wkt, TransformType & p)
|
||||||
return qi::phrase_parse(first, last, g, skip_type());
|
return qi::phrase_parse(first, last, g, skip_type());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
template <typename TransformType>
|
template <typename TransformType>
|
||||||
bool parse_transform(std::string const& wkt, TransformType & p)
|
bool parse_transform(std::string const& wkt, TransformType & p)
|
||||||
{
|
{
|
||||||
|
@ -53,8 +54,9 @@ bool parse_transform(std::string const& wkt, TransformType & p)
|
||||||
iterator_type last = wkt.end();
|
iterator_type last = wkt.end();
|
||||||
return qi::phrase_parse(first, last, g, skip_type());
|
return qi::phrase_parse(first, last, g, skip_type());
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
template bool parse_transform<agg::trans_affine>(const char*, agg::trans_affine&);
|
template MAPNIK_DECL bool parse_transform<agg::trans_affine>(const char*, agg::trans_affine&);
|
||||||
template bool parse_transform<agg::trans_affine>(std::string const& , agg::trans_affine&);
|
//template bool parse_transform<agg::trans_affine>(std::string const& , agg::trans_affine&);
|
||||||
|
|
||||||
}}
|
}}
|
||||||
|
|
|
@ -168,8 +168,8 @@ void text_placements_simple::set_positions(std::string positions)
|
||||||
|
|
||||||
std::string::iterator first = positions.begin(), last = positions.end();
|
std::string::iterator first = positions.begin(), last = positions.end();
|
||||||
qi::phrase_parse(first, last,
|
qi::phrase_parse(first, last,
|
||||||
(direction_name[push_back(ref(direction_), _1)] % ',') >> *(',' >> qi::int_[push_back(ref(text_sizes_), _1)]),
|
(direction_name[push_back(phoenix::ref(direction_), _1)] % ',') >> *(',' >> qi::int_[push_back(phoenix::ref(text_sizes_), _1)]),
|
||||||
space
|
space
|
||||||
);
|
);
|
||||||
if (first != last) {
|
if (first != last) {
|
||||||
std::cerr << "WARNING: Could not parse text_placement_simple placement string ('" << positions << "').\n";
|
std::cerr << "WARNING: Could not parse text_placement_simple placement string ('" << positions << "').\n";
|
||||||
|
|
Loading…
Reference in a new issue