whitespace fixes - closes #911
This commit is contained in:
parent
1cafc03a46
commit
17d13cff67
242 changed files with 5431 additions and 5431 deletions
|
@ -45,7 +45,7 @@
|
|||
// apps using mapnik do not
|
||||
// need agg headers
|
||||
namespace agg {
|
||||
struct trans_affine;
|
||||
struct trans_affine;
|
||||
}
|
||||
|
||||
namespace mapnik {
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
// apps using mapnik do not
|
||||
// need agg headers
|
||||
namespace agg {
|
||||
struct trans_affine;
|
||||
struct trans_affine;
|
||||
}
|
||||
|
||||
namespace mapnik {
|
||||
|
|
|
@ -239,10 +239,10 @@ struct MAPNIK_DECL coord_transform_parallel
|
|||
angle_a = atan2((m_pre_y-m_cur_y),(m_pre_x-m_cur_x));
|
||||
dx_pre = cos(angle_a + pi_by_2);
|
||||
dy_pre = sin(angle_a + pi_by_2);
|
||||
#ifdef MAPNIK_DEBUG
|
||||
#ifdef MAPNIK_DEBUG
|
||||
std::clog << "offsetting line by: " << offset_ << "\n";
|
||||
std::clog << "initial dx=" << (dx_pre * offset_) << " dy=" << (dy_pre * offset_) << "\n";
|
||||
#endif
|
||||
#endif
|
||||
*x = m_pre_x + (dx_pre * offset_);
|
||||
*y = m_pre_y + (dy_pre * offset_);
|
||||
m_status = process;
|
||||
|
@ -290,7 +290,7 @@ struct MAPNIK_DECL coord_transform_parallel
|
|||
else // skip sharp spikes
|
||||
{
|
||||
|
||||
#ifdef MAPNIK_DEBUG
|
||||
#ifdef MAPNIK_DEBUG
|
||||
dx_curr = cos(angle_a + pi_by_2);
|
||||
dy_curr = sin(angle_a + pi_by_2);
|
||||
sin_curve = dx_curr*dy_pre-dy_curr*dx_pre;
|
||||
|
@ -298,7 +298,7 @@ struct MAPNIK_DECL coord_transform_parallel
|
|||
std::clog << "angle b: " << angle_b << "\n";
|
||||
std::clog << "h: " << h << "\n";
|
||||
std::clog << "sin_curve: " << sin_curve << "\n";
|
||||
#endif
|
||||
#endif
|
||||
m_status = process;
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -29,22 +29,22 @@
|
|||
|
||||
namespace mapnik { namespace sql_utils {
|
||||
|
||||
inline std::string unquote_double(const std::string& sql)
|
||||
{
|
||||
inline std::string unquote_double(const std::string& sql)
|
||||
{
|
||||
std::string table_name = boost::algorithm::to_lower_copy(sql);
|
||||
boost::algorithm::trim_if(table_name,boost::algorithm::is_any_of("\""));
|
||||
return table_name;
|
||||
}
|
||||
}
|
||||
|
||||
inline std::string unquote(const std::string& sql)
|
||||
{
|
||||
inline std::string unquote(const std::string& sql)
|
||||
{
|
||||
std::string table_name = boost::algorithm::to_lower_copy(sql);
|
||||
boost::algorithm::trim_if(table_name,boost::algorithm::is_any_of("\"\'"));
|
||||
return table_name;
|
||||
}
|
||||
}
|
||||
|
||||
inline void quote_attr(std::ostringstream& s, const std::string& field)
|
||||
{
|
||||
inline void quote_attr(std::ostringstream& s, const std::string& field)
|
||||
{
|
||||
if (boost::algorithm::icontains(field,".")) {
|
||||
std::vector<std::string> parts;
|
||||
boost::split(parts, field, boost::is_any_of("."));
|
||||
|
@ -54,10 +54,10 @@ inline void quote_attr(std::ostringstream& s, const std::string& field)
|
|||
{
|
||||
s << ",\"" + field + "\"";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
inline std::string table_from_sql(const std::string& sql)
|
||||
{
|
||||
inline std::string table_from_sql(const std::string& sql)
|
||||
{
|
||||
std::string table_name = boost::algorithm::to_lower_copy(sql);
|
||||
boost::algorithm::replace_all(table_name,"\n"," ");
|
||||
|
||||
|
@ -76,10 +76,10 @@ inline std::string table_from_sql(const std::string& sql)
|
|||
}
|
||||
}
|
||||
return table_name;
|
||||
}
|
||||
}
|
||||
|
||||
inline std::string numeric2string(const char* buf)
|
||||
{
|
||||
inline std::string numeric2string(const char* buf)
|
||||
{
|
||||
int16_t ndigits = int2net(buf);
|
||||
int16_t weight = int2net(buf+2);
|
||||
int16_t sign = int2net(buf+4);
|
||||
|
@ -188,8 +188,8 @@ inline std::string numeric2string(const char* buf)
|
|||
}
|
||||
}
|
||||
return ss.str();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -65,6 +65,6 @@ namespace mapnik { namespace svg {
|
|||
private:
|
||||
OutputIterator& output_iterator_;
|
||||
};
|
||||
}}
|
||||
}}
|
||||
|
||||
#endif // MAPNIK_SVG_GENERATOR_HPP
|
||||
|
|
|
@ -198,6 +198,6 @@ namespace mapnik { namespace svg {
|
|||
double svg_version_;
|
||||
std::string svg_namespace_url_;
|
||||
};
|
||||
}}
|
||||
}}
|
||||
|
||||
#endif // MAPNIK_SVG_OUTPUT_ATTRIBUTES
|
||||
|
|
|
@ -60,7 +60,7 @@ BOOST_FUSION_ADAPT_STRUCT(
|
|||
(std::string, stroke_linecap_)
|
||||
(std::string, stroke_linejoin_)
|
||||
(double, stroke_dashoffset_)
|
||||
)
|
||||
)
|
||||
|
||||
/*!
|
||||
* mapnik::svg::rect_output_attributes is adapted as a fusion sequence
|
||||
|
@ -73,7 +73,7 @@ BOOST_FUSION_ADAPT_STRUCT(
|
|||
(unsigned, width_)
|
||||
(unsigned, height_)
|
||||
(std::string, fill_color_)
|
||||
)
|
||||
)
|
||||
|
||||
/*!
|
||||
* mapnik::svg::root_output_attributes is adapted as a fusion sequence
|
||||
|
@ -85,7 +85,7 @@ BOOST_FUSION_ADAPT_STRUCT(
|
|||
(unsigned, height_)
|
||||
(double, svg_version_)
|
||||
(std::string, svg_namespace_url_)
|
||||
)
|
||||
)
|
||||
|
||||
/*!
|
||||
* mapnik::geometry_type is adapted to conform to the concepts
|
||||
|
@ -125,7 +125,7 @@ namespace boost { namespace spirit { namespace traits {
|
|||
return mapnik::svg::path_iterator_type(path);
|
||||
}
|
||||
};
|
||||
}}}
|
||||
}}}
|
||||
|
||||
namespace mapnik { namespace svg {
|
||||
|
||||
|
@ -166,9 +166,9 @@ namespace mapnik { namespace svg {
|
|||
PathType const& path_type_;
|
||||
};
|
||||
|
||||
template <typename OutputIterator>
|
||||
struct svg_path_attributes_grammar : karma::grammar<OutputIterator, mapnik::svg::path_output_attributes()>
|
||||
{
|
||||
template <typename OutputIterator>
|
||||
struct svg_path_attributes_grammar : karma::grammar<OutputIterator, mapnik::svg::path_output_attributes()>
|
||||
{
|
||||
explicit svg_path_attributes_grammar()
|
||||
: svg_path_attributes_grammar::base_type(svg_path_attributes)
|
||||
{
|
||||
|
@ -188,11 +188,11 @@ namespace mapnik { namespace svg {
|
|||
}
|
||||
|
||||
karma::rule<OutputIterator, mapnik::svg::path_output_attributes()> svg_path_attributes;
|
||||
};
|
||||
};
|
||||
|
||||
template <typename OutputIterator>
|
||||
struct svg_path_dash_array_grammar : karma::grammar<OutputIterator, mapnik::dash_array()>
|
||||
{
|
||||
template <typename OutputIterator>
|
||||
struct svg_path_dash_array_grammar : karma::grammar<OutputIterator, mapnik::dash_array()>
|
||||
{
|
||||
explicit svg_path_dash_array_grammar()
|
||||
: svg_path_dash_array_grammar::base_type(svg_path_dash_array)
|
||||
{
|
||||
|
@ -206,11 +206,11 @@ namespace mapnik { namespace svg {
|
|||
}
|
||||
|
||||
karma::rule<OutputIterator, mapnik::dash_array()> svg_path_dash_array;
|
||||
};
|
||||
};
|
||||
|
||||
template <typename OutputIterator>
|
||||
struct svg_rect_attributes_grammar : karma::grammar<OutputIterator, mapnik::svg::rect_output_attributes()>
|
||||
{
|
||||
template <typename OutputIterator>
|
||||
struct svg_rect_attributes_grammar : karma::grammar<OutputIterator, mapnik::svg::rect_output_attributes()>
|
||||
{
|
||||
explicit svg_rect_attributes_grammar()
|
||||
: svg_rect_attributes_grammar::base_type(svg_rect_attributes)
|
||||
{
|
||||
|
@ -227,11 +227,11 @@ namespace mapnik { namespace svg {
|
|||
}
|
||||
|
||||
karma::rule<OutputIterator, mapnik::svg::rect_output_attributes()> svg_rect_attributes;
|
||||
};
|
||||
};
|
||||
|
||||
template <typename OutputIterator>
|
||||
struct svg_root_attributes_grammar : karma::grammar<OutputIterator, mapnik::svg::root_output_attributes()>
|
||||
{
|
||||
template <typename OutputIterator>
|
||||
struct svg_root_attributes_grammar : karma::grammar<OutputIterator, mapnik::svg::root_output_attributes()>
|
||||
{
|
||||
explicit svg_root_attributes_grammar()
|
||||
: svg_root_attributes_grammar::base_type(svg_root_attributes)
|
||||
{
|
||||
|
@ -248,7 +248,7 @@ namespace mapnik { namespace svg {
|
|||
}
|
||||
|
||||
karma::rule<OutputIterator, mapnik::svg::root_output_attributes()> svg_root_attributes;
|
||||
};
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -38,13 +38,13 @@
|
|||
|
||||
namespace mapnik { namespace svg {
|
||||
|
||||
class svg_parser : private boost::noncopyable
|
||||
{
|
||||
public:
|
||||
class svg_parser : private boost::noncopyable
|
||||
{
|
||||
public:
|
||||
explicit svg_parser(svg_converter_type & path);
|
||||
~svg_parser();
|
||||
void parse(std::string const& filename);
|
||||
private:
|
||||
private:
|
||||
void process_node(xmlTextReaderPtr reader);
|
||||
void start_element(xmlTextReaderPtr reader);
|
||||
void end_element(xmlTextReaderPtr reader);
|
||||
|
@ -64,14 +64,14 @@ private:
|
|||
void parse_attr(const xmlChar * name, const xmlChar * value );
|
||||
|
||||
|
||||
private:
|
||||
private:
|
||||
svg_converter_type & path_;
|
||||
bool is_defs_;
|
||||
std::map<std::string, gradient> gradient_map_;
|
||||
std::pair<std::string, gradient> temporary_gradient_;
|
||||
};
|
||||
};
|
||||
|
||||
}}
|
||||
}}
|
||||
|
||||
|
||||
#endif // MAPNIK_SVG_PARSER_HPP
|
||||
|
|
|
@ -51,7 +51,7 @@ using namespace mapnik;
|
|||
*
|
||||
* @tparam Value the type of sequence element dereferenced.
|
||||
* @tparam Container the sequence over which it iterates.
|
||||
*/
|
||||
*/
|
||||
template <typename Value, typename Container>
|
||||
class path_iterator
|
||||
: public boost::iterator_adaptor<path_iterator<Value, Container>,
|
||||
|
|
|
@ -28,18 +28,18 @@
|
|||
|
||||
namespace mapnik { namespace svg {
|
||||
|
||||
template <typename PathType>
|
||||
bool parse_path(const char * wkt, PathType & p);
|
||||
template <typename PathType>
|
||||
bool parse_path(const char * wkt, PathType & p);
|
||||
|
||||
template <typename PathType>
|
||||
bool parse_points(const char * wkt, PathType & p);
|
||||
template <typename PathType>
|
||||
bool parse_points(const char * wkt, PathType & p);
|
||||
|
||||
template <typename TransformType>
|
||||
bool MAPNIK_DECL parse_transform(const char * wkt, TransformType & tr);
|
||||
template <typename TransformType>
|
||||
bool MAPNIK_DECL parse_transform(const char * wkt, TransformType & tr);
|
||||
|
||||
//template <typename TransformType>
|
||||
//bool MAPNIK_DECL parse_transform(std::string const& wkt, TransformType & tr);
|
||||
|
||||
}}
|
||||
}}
|
||||
|
||||
#endif // MAPNIK_SVG_PATH_PARSER_HPP
|
||||
|
|
|
@ -34,14 +34,14 @@
|
|||
|
||||
namespace mapnik
|
||||
{
|
||||
// parameterized with the type of output iterator it will use for output.
|
||||
// output iterators add more flexibility than streams, because iterators
|
||||
// can target many other output destinations besides streams.
|
||||
template <typename OutputIterator>
|
||||
class MAPNIK_DECL svg_renderer : public feature_style_processor<svg_renderer<OutputIterator> >,
|
||||
// parameterized with the type of output iterator it will use for output.
|
||||
// output iterators add more flexibility than streams, because iterators
|
||||
// can target many other output destinations besides streams.
|
||||
template <typename OutputIterator>
|
||||
class MAPNIK_DECL svg_renderer : public feature_style_processor<svg_renderer<OutputIterator> >,
|
||||
private boost::noncopyable
|
||||
{
|
||||
public:
|
||||
{
|
||||
public:
|
||||
svg_renderer(Map const& m, OutputIterator& output_iterator, unsigned offset_x=0, unsigned offset_y=0);
|
||||
~svg_renderer();
|
||||
|
||||
|
@ -107,7 +107,7 @@ namespace mapnik
|
|||
return output_iterator_;
|
||||
}
|
||||
|
||||
private:
|
||||
private:
|
||||
OutputIterator& output_iterator_;
|
||||
const int width_;
|
||||
const int height_;
|
||||
|
@ -141,7 +141,7 @@ namespace mapnik
|
|||
Feature const& feature_;
|
||||
proj_transform const& prj_trans_;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
#endif // MAPNIK_SVG_RENDERER_HPP
|
||||
|
|
|
@ -37,7 +37,7 @@ namespace mapnik
|
|||
class Map;
|
||||
|
||||
class MAPNIK_DECL symbolizer_base {
|
||||
public:
|
||||
public:
|
||||
symbolizer_base():
|
||||
properties_(),
|
||||
properties_complete_(),
|
||||
|
@ -77,7 +77,7 @@ class MAPNIK_DECL symbolizer_base {
|
|||
metawriter_properties const& get_metawriter_properties_overrides() const { return properties_; }
|
||||
/** Get metawriter name. */
|
||||
std::string const& get_metawriter_name() const { return writer_name_; }
|
||||
private:
|
||||
private:
|
||||
metawriter_properties properties_;
|
||||
metawriter_properties properties_complete_;
|
||||
std::string writer_name_;
|
||||
|
|
|
@ -30,14 +30,14 @@
|
|||
extern "C"
|
||||
{
|
||||
#ifdef HAVE_GEOTIFF
|
||||
#include <xtiffio.h>
|
||||
#include <geotiffio.h>
|
||||
#define RealTIFFOpen XTIFFClientOpen
|
||||
#define RealTIFFClose XTIFFClose
|
||||
#include <xtiffio.h>
|
||||
#include <geotiffio.h>
|
||||
#define RealTIFFOpen XTIFFClientOpen
|
||||
#define RealTIFFClose XTIFFClose
|
||||
#else
|
||||
#include <tiffio.h>
|
||||
#define RealTIFFOpen TIFFClientOpen
|
||||
#define RealTIFFClose TIFFClose
|
||||
#include <tiffio.h>
|
||||
#define RealTIFFOpen TIFFClientOpen
|
||||
#define RealTIFFClose TIFFClose
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -36,35 +36,35 @@
|
|||
|
||||
namespace boost { namespace spirit { namespace traits {
|
||||
|
||||
template <>
|
||||
struct is_container<mapnik::geometry_type const> : mpl::true_ {} ;
|
||||
template <>
|
||||
struct is_container<mapnik::geometry_type const> : mpl::true_ {} ;
|
||||
|
||||
template <>
|
||||
struct container_iterator<mapnik::geometry_type const>
|
||||
{
|
||||
template <>
|
||||
struct container_iterator<mapnik::geometry_type const>
|
||||
{
|
||||
typedef mapnik::util::vertex_iterator<double> type;
|
||||
};
|
||||
};
|
||||
|
||||
template <>
|
||||
struct begin_container<mapnik::geometry_type const>
|
||||
{
|
||||
template <>
|
||||
struct begin_container<mapnik::geometry_type const>
|
||||
{
|
||||
static mapnik::util::vertex_iterator<double>
|
||||
call (mapnik::geometry_type const& g)
|
||||
{
|
||||
return mapnik::util::vertex_iterator<double>(g.data());
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
template <>
|
||||
struct end_container<mapnik::geometry_type const>
|
||||
{
|
||||
template <>
|
||||
struct end_container<mapnik::geometry_type const>
|
||||
{
|
||||
static mapnik::util::vertex_iterator<double>
|
||||
call (mapnik::geometry_type const& g)
|
||||
{
|
||||
return mapnik::util::vertex_iterator<double>();
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
}}}
|
||||
}}}
|
||||
|
||||
#endif // CONTAINER_ADAPTER_HPP
|
||||
|
|
|
@ -30,8 +30,8 @@
|
|||
namespace mapnik { namespace util {
|
||||
|
||||
// poor man deepcopy implementation
|
||||
void deepcopy(Map const& map_in, Map & map_out);
|
||||
void deepcopy(Map const& map_in, Map & map_out);
|
||||
|
||||
}}
|
||||
}}
|
||||
|
||||
#endif // MAPNIK_DEEPSOPY_HPP
|
||||
|
|
|
@ -44,12 +44,12 @@
|
|||
|
||||
namespace mapnik { namespace util {
|
||||
|
||||
namespace karma = boost::spirit::karma;
|
||||
namespace phoenix = boost::phoenix;
|
||||
namespace karma = boost::spirit::karma;
|
||||
namespace phoenix = boost::phoenix;
|
||||
|
||||
namespace detail {
|
||||
struct get_type
|
||||
{
|
||||
namespace detail {
|
||||
struct get_type
|
||||
{
|
||||
template <typename T>
|
||||
struct result { typedef int type; };
|
||||
|
||||
|
@ -57,10 +57,10 @@ struct get_type
|
|||
{
|
||||
return (int)geom.type();
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
struct get_first
|
||||
{
|
||||
struct get_first
|
||||
{
|
||||
template <typename T>
|
||||
struct result { typedef geometry_type::value_type const type; };
|
||||
|
||||
|
@ -70,21 +70,21 @@ struct get_first
|
|||
boost::get<0>(coord) = geom.get_vertex(0,&boost::get<1>(coord),&boost::get<2>(coord));
|
||||
return coord;
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct coordinate_policy : karma::real_policies<T>
|
||||
{
|
||||
template <typename T>
|
||||
struct coordinate_policy : karma::real_policies<T>
|
||||
{
|
||||
typedef boost::spirit::karma::real_policies<T> base_type;
|
||||
static int floatfield(T n) { return base_type::fmtflags::fixed; }
|
||||
static unsigned precision(T n) { return 6u ;}
|
||||
};
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
template <typename OutputIterator>
|
||||
struct svg_generator :
|
||||
template <typename OutputIterator>
|
||||
struct svg_generator :
|
||||
karma::grammar<OutputIterator, geometry_type const& ()>
|
||||
{
|
||||
{
|
||||
|
||||
svg_generator()
|
||||
: svg_generator::base_type(svg)
|
||||
|
@ -139,7 +139,7 @@ struct svg_generator :
|
|||
//
|
||||
karma::real_generator<double, detail::coordinate_policy<double> > coord_type;
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
}}
|
||||
|
||||
|
|
|
@ -35,9 +35,9 @@
|
|||
|
||||
namespace mapnik { namespace util {
|
||||
|
||||
void to_ds_type(mapnik::geometry_container const& paths,
|
||||
void to_ds_type(mapnik::geometry_container const& paths,
|
||||
boost::optional<mapnik::datasource::geometry_t> & result)
|
||||
{
|
||||
{
|
||||
if (paths.size() == 1)
|
||||
{
|
||||
result.reset(static_cast<mapnik::datasource::geometry_t>(paths.front().type()));
|
||||
|
@ -58,9 +58,9 @@ void to_ds_type(mapnik::geometry_container const& paths,
|
|||
result.reset(static_cast<mapnik::datasource::geometry_t>(type));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}}
|
||||
}}
|
||||
|
||||
|
||||
#endif // MAPNIK_GEOMETRY_TO_DS_TYPE
|
||||
|
|
|
@ -39,8 +39,8 @@
|
|||
|
||||
namespace mapnik { namespace util {
|
||||
|
||||
std::string to_hex(const char* blob, unsigned size)
|
||||
{
|
||||
std::string to_hex(const char* blob, unsigned size)
|
||||
{
|
||||
std::string buf;
|
||||
buf.reserve(size*2);
|
||||
std::ostringstream s(buf);
|
||||
|
@ -53,16 +53,16 @@ std::string to_hex(const char* blob, unsigned size)
|
|||
s << hex;
|
||||
}
|
||||
return s.str();
|
||||
}
|
||||
}
|
||||
|
||||
enum wkbByteOrder {
|
||||
enum wkbByteOrder {
|
||||
wkbXDR=0,
|
||||
wkbNDR=1
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
inline void reverse_bytes(char size, char *address)
|
||||
{
|
||||
inline void reverse_bytes(char size, char *address)
|
||||
{
|
||||
char * first = address;
|
||||
char * last = first + size - 1;
|
||||
for(;first < last;++first, --last)
|
||||
|
@ -71,11 +71,11 @@ inline void reverse_bytes(char size, char *address)
|
|||
*last = *first;
|
||||
*first = x;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
template <typename S, typename T>
|
||||
inline void write (S & stream, T val, std::size_t size, wkbByteOrder byte_order)
|
||||
{
|
||||
template <typename S, typename T>
|
||||
inline void write (S & stream, T val, std::size_t size, wkbByteOrder byte_order)
|
||||
{
|
||||
#ifdef MAPNIK_BIG_ENDIAN
|
||||
bool need_swap = byte_order ? wkbNDR : wkbXDR;
|
||||
#else
|
||||
|
@ -87,10 +87,10 @@ inline void write (S & stream, T val, std::size_t size, wkbByteOrder byte_order)
|
|||
reverse_bytes(size,buf);
|
||||
}
|
||||
stream.write(buf,size);
|
||||
}
|
||||
}
|
||||
|
||||
struct wkb_buffer
|
||||
{
|
||||
struct wkb_buffer
|
||||
{
|
||||
wkb_buffer(std::size_t size)
|
||||
: size_(size),
|
||||
data_( (size_!=0) ? static_cast<char*>(::operator new (size_)):0)
|
||||
|
@ -113,12 +113,12 @@ struct wkb_buffer
|
|||
|
||||
std::size_t size_;
|
||||
char * data_;
|
||||
};
|
||||
};
|
||||
|
||||
typedef boost::shared_ptr<wkb_buffer> wkb_buffer_ptr;
|
||||
typedef boost::shared_ptr<wkb_buffer> wkb_buffer_ptr;
|
||||
|
||||
wkb_buffer_ptr to_point_wkb( geometry_type const& g, wkbByteOrder byte_order)
|
||||
{
|
||||
wkb_buffer_ptr to_point_wkb( geometry_type const& g, wkbByteOrder byte_order)
|
||||
{
|
||||
assert(g.num_points() == 1);
|
||||
std::size_t size = 1 + 4 + 8*2 ; // byteOrder + wkbType + Point
|
||||
wkb_buffer_ptr wkb = boost::make_shared<wkb_buffer>(size);
|
||||
|
@ -132,10 +132,10 @@ wkb_buffer_ptr to_point_wkb( geometry_type const& g, wkbByteOrder byte_order)
|
|||
write(ss,y,8,byte_order);
|
||||
assert(ss.good());
|
||||
return wkb;
|
||||
}
|
||||
}
|
||||
|
||||
wkb_buffer_ptr to_line_string_wkb( geometry_type const& g, wkbByteOrder byte_order)
|
||||
{
|
||||
wkb_buffer_ptr to_line_string_wkb( geometry_type const& g, wkbByteOrder byte_order)
|
||||
{
|
||||
unsigned num_points = g.num_points();
|
||||
assert(num_points > 1);
|
||||
std::size_t size = 1 + 4 + 4 + 8*2*num_points ; // byteOrder + wkbType + numPoints + Point*numPoints
|
||||
|
@ -154,10 +154,10 @@ wkb_buffer_ptr to_line_string_wkb( geometry_type const& g, wkbByteOrder byte_ord
|
|||
}
|
||||
assert(ss.good());
|
||||
return wkb;
|
||||
}
|
||||
}
|
||||
|
||||
wkb_buffer_ptr to_polygon_wkb( geometry_type const& g, wkbByteOrder byte_order)
|
||||
{
|
||||
wkb_buffer_ptr to_polygon_wkb( geometry_type const& g, wkbByteOrder byte_order)
|
||||
{
|
||||
unsigned num_points = g.num_points();
|
||||
assert(num_points > 1);
|
||||
|
||||
|
@ -202,10 +202,10 @@ wkb_buffer_ptr to_polygon_wkb( geometry_type const& g, wkbByteOrder byte_order)
|
|||
|
||||
assert(ss.good());
|
||||
return wkb;
|
||||
}
|
||||
}
|
||||
|
||||
wkb_buffer_ptr to_wkb(geometry_type const& g, wkbByteOrder byte_order )
|
||||
{
|
||||
wkb_buffer_ptr to_wkb(geometry_type const& g, wkbByteOrder byte_order )
|
||||
{
|
||||
wkb_buffer_ptr wkb;
|
||||
|
||||
switch (g.type())
|
||||
|
@ -223,10 +223,10 @@ wkb_buffer_ptr to_wkb(geometry_type const& g, wkbByteOrder byte_order )
|
|||
break;
|
||||
}
|
||||
return wkb;
|
||||
}
|
||||
}
|
||||
|
||||
wkb_buffer_ptr to_wkb(geometry_container const& paths, wkbByteOrder byte_order )
|
||||
{
|
||||
wkb_buffer_ptr to_wkb(geometry_container const& paths, wkbByteOrder byte_order )
|
||||
{
|
||||
if (paths.size() == 1)
|
||||
{
|
||||
// single geometry
|
||||
|
@ -268,9 +268,9 @@ wkb_buffer_ptr to_wkb(geometry_container const& paths, wkbByteOrder byte_order )
|
|||
}
|
||||
|
||||
return wkb_buffer_ptr();
|
||||
}
|
||||
}
|
||||
|
||||
}}
|
||||
}}
|
||||
|
||||
|
||||
#endif // MAPNIK_GEOMETRY_TO_WKB_HPP
|
||||
|
|
|
@ -36,27 +36,27 @@
|
|||
|
||||
namespace mapnik { namespace util {
|
||||
|
||||
namespace karma = boost::spirit::karma;
|
||||
namespace karma = boost::spirit::karma;
|
||||
|
||||
bool to_wkt(std::string & wkt, mapnik::geometry_type const& geom)
|
||||
{
|
||||
bool to_wkt(std::string & wkt, mapnik::geometry_type const& geom)
|
||||
{
|
||||
typedef std::back_insert_iterator<std::string> sink_type;
|
||||
sink_type sink(wkt);
|
||||
wkt_generator<sink_type> generator(true);
|
||||
bool result = karma::generate(sink, generator, geom);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
bool to_wkt(std::string & wkt, mapnik::geometry_container const& geom)
|
||||
{
|
||||
bool to_wkt(std::string & wkt, mapnik::geometry_container const& geom)
|
||||
{
|
||||
typedef std::back_insert_iterator<std::string> sink_type;
|
||||
sink_type sink(wkt);
|
||||
wkt_multi_generator<sink_type> generator;
|
||||
bool result = karma::generate(sink, generator, geom);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
}}
|
||||
}}
|
||||
|
||||
|
||||
#endif // MAPNIK_GEOMETRY_TO_WKT_HPP
|
||||
|
|
|
@ -46,23 +46,23 @@
|
|||
namespace boost { namespace spirit { namespace traits {
|
||||
|
||||
// make gcc and darwin toolsets happy.
|
||||
template <>
|
||||
struct is_container<mapnik::geometry_container>
|
||||
template <>
|
||||
struct is_container<mapnik::geometry_container>
|
||||
: mpl::false_
|
||||
{};
|
||||
{};
|
||||
|
||||
}}}
|
||||
}}}
|
||||
|
||||
|
||||
namespace mapnik { namespace util {
|
||||
|
||||
namespace karma = boost::spirit::karma;
|
||||
namespace phoenix = boost::phoenix;
|
||||
namespace karma = boost::spirit::karma;
|
||||
namespace phoenix = boost::phoenix;
|
||||
|
||||
namespace {
|
||||
namespace {
|
||||
|
||||
struct get_type
|
||||
{
|
||||
struct get_type
|
||||
{
|
||||
template <typename T>
|
||||
struct result { typedef int type; };
|
||||
|
||||
|
@ -70,10 +70,10 @@ struct get_type
|
|||
{
|
||||
return static_cast<int>(geom.type());
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
struct get_first
|
||||
{
|
||||
struct get_first
|
||||
{
|
||||
template <typename T>
|
||||
struct result { typedef geometry_type::value_type const type; };
|
||||
|
||||
|
@ -83,11 +83,11 @@ struct get_first
|
|||
boost::get<0>(coord) = geom.get_vertex(0,&boost::get<1>(coord),&boost::get<2>(coord));
|
||||
return coord;
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
struct multi_geometry_
|
||||
{
|
||||
struct multi_geometry_
|
||||
{
|
||||
template <typename T>
|
||||
struct result { typedef bool type; };
|
||||
|
||||
|
@ -95,10 +95,10 @@ struct multi_geometry_
|
|||
{
|
||||
return geom.size() > 1 ? true : false;
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
struct multi_geometry_type
|
||||
{
|
||||
struct multi_geometry_type
|
||||
{
|
||||
template <typename T>
|
||||
struct result { typedef boost::tuple<unsigned,bool> type; };
|
||||
|
||||
|
@ -121,23 +121,23 @@ struct multi_geometry_type
|
|||
}
|
||||
return boost::tuple<unsigned,bool>(type, collection);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
template <typename T>
|
||||
struct wkt_coordinate_policy : karma::real_policies<T>
|
||||
{
|
||||
template <typename T>
|
||||
struct wkt_coordinate_policy : karma::real_policies<T>
|
||||
{
|
||||
typedef boost::spirit::karma::real_policies<T> base_type;
|
||||
static int floatfield(T n) { return base_type::fmtflags::fixed; }
|
||||
static unsigned precision(T n) { return 6 ;}
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
template <typename OutputIterator>
|
||||
struct wkt_generator :
|
||||
template <typename OutputIterator>
|
||||
struct wkt_generator :
|
||||
karma::grammar<OutputIterator, geometry_type const& ()>
|
||||
{
|
||||
{
|
||||
|
||||
wkt_generator(bool single = false)
|
||||
: wkt_generator::base_type(wkt)
|
||||
|
@ -209,7 +209,7 @@ struct wkt_generator :
|
|||
//
|
||||
karma::real_generator<double, wkt_coordinate_policy<double> > coord_type;
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -35,15 +35,15 @@
|
|||
|
||||
namespace mapnik { namespace util {
|
||||
|
||||
template <typename T>
|
||||
class vertex_iterator
|
||||
template <typename T>
|
||||
class vertex_iterator
|
||||
: public boost::iterator_facade< vertex_iterator<T>,
|
||||
typename boost::tuple<unsigned,T,T> const,
|
||||
boost::forward_traversal_tag
|
||||
>
|
||||
{
|
||||
{
|
||||
|
||||
public:
|
||||
public:
|
||||
typedef typename boost::tuple<unsigned, T, T> value_type;
|
||||
typedef vertex_vector<T> container_type;
|
||||
|
||||
|
@ -58,7 +58,7 @@ public:
|
|||
increment();
|
||||
}
|
||||
|
||||
private:
|
||||
private:
|
||||
friend class boost::iterator_core_access;
|
||||
|
||||
void increment()
|
||||
|
@ -79,9 +79,9 @@ private:
|
|||
container_type const *vertices_;
|
||||
value_type v_;
|
||||
unsigned pos_;
|
||||
};
|
||||
};
|
||||
|
||||
}}
|
||||
}}
|
||||
|
||||
|
||||
#endif // MAPNIK_VERTEX_ITERATOR_HPP
|
||||
|
|
|
@ -39,12 +39,12 @@
|
|||
|
||||
namespace mapnik { namespace wkt {
|
||||
|
||||
using namespace boost::spirit;
|
||||
using namespace boost::fusion;
|
||||
using namespace boost::phoenix;
|
||||
using namespace boost::spirit;
|
||||
using namespace boost::fusion;
|
||||
using namespace boost::phoenix;
|
||||
|
||||
struct push_vertex
|
||||
{
|
||||
struct push_vertex
|
||||
{
|
||||
template <typename T0,typename T1, typename T2, typename T3>
|
||||
struct result
|
||||
{
|
||||
|
@ -57,10 +57,10 @@ struct push_vertex
|
|||
BOOST_ASSERT( path!=0 );
|
||||
path->push_vertex(x,y,c);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
struct cleanup
|
||||
{
|
||||
struct cleanup
|
||||
{
|
||||
template <typename T0>
|
||||
struct result
|
||||
{
|
||||
|
@ -72,11 +72,11 @@ struct cleanup
|
|||
{
|
||||
if (path) delete path,path=0;
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
template <typename Iterator>
|
||||
struct wkt_grammar : qi::grammar<Iterator, boost::ptr_vector<mapnik::geometry_type>() , ascii::space_type>
|
||||
{
|
||||
template <typename Iterator>
|
||||
struct wkt_grammar : qi::grammar<Iterator, boost::ptr_vector<mapnik::geometry_type>() , ascii::space_type>
|
||||
{
|
||||
wkt_grammar()
|
||||
: wkt_grammar::base_type(geometry_tagged_text)
|
||||
{
|
||||
|
@ -192,7 +192,7 @@ struct wkt_grammar : qi::grammar<Iterator, boost::ptr_vector<mapnik::geometry_t
|
|||
qi::rule<Iterator,ascii::space_type> empty_set;
|
||||
boost::phoenix::function<push_vertex> push_vertex_;
|
||||
boost::phoenix::function<cleanup> cleanup_;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
template <typename Iterator>
|
||||
|
|
|
@ -59,7 +59,7 @@ box2d<T>::box2d(const box2d &rhs)
|
|||
// http://trac.mapnik.org/ticket/749
|
||||
/*{
|
||||
init(rhs.minx_,rhs.miny_,rhs.maxx_,rhs.maxy_);
|
||||
}*/
|
||||
}*/
|
||||
|
||||
template <typename T>
|
||||
#if !defined(__SUNPRO_CC)
|
||||
|
|
|
@ -661,8 +661,8 @@ void cairo_renderer_base::start_map_processing(Map const& map)
|
|||
std::clog << "start map processing bbox="
|
||||
<< map.get_current_extent() << "\n";
|
||||
#else
|
||||
void cairo_renderer_base::start_map_processing(Map const& /*map*/)
|
||||
{
|
||||
void cairo_renderer_base::start_map_processing(Map const& /*map*/)
|
||||
{
|
||||
#endif
|
||||
|
||||
#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 6, 0)
|
||||
|
@ -678,27 +678,27 @@ void cairo_renderer_base::start_map_processing(Map const& /*map*/)
|
|||
context.set_color(*bg);
|
||||
context.paint();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
template <>
|
||||
void cairo_renderer<Cairo::Context>::end_map_processing(Map const& )
|
||||
{
|
||||
template <>
|
||||
void cairo_renderer<Cairo::Context>::end_map_processing(Map const& )
|
||||
{
|
||||
#ifdef MAPNIK_DEBUG
|
||||
std::clog << "end map processing\n";
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
template <>
|
||||
void cairo_renderer<Cairo::Surface>::end_map_processing(Map const& )
|
||||
{
|
||||
template <>
|
||||
void cairo_renderer<Cairo::Surface>::end_map_processing(Map const& )
|
||||
{
|
||||
#ifdef MAPNIK_DEBUG
|
||||
std::clog << "end map processing\n";
|
||||
#endif
|
||||
context_->show_page();
|
||||
}
|
||||
}
|
||||
|
||||
void cairo_renderer_base::start_layer_processing(layer const& lay)
|
||||
{
|
||||
void cairo_renderer_base::start_layer_processing(layer const& lay)
|
||||
{
|
||||
#ifdef MAPNIK_DEBUG
|
||||
std::clog << "start layer processing : " << lay.name() << "\n";
|
||||
std::clog << "datasource = " << lay.datasource().get() << "\n";
|
||||
|
@ -707,19 +707,19 @@ void cairo_renderer_base::start_layer_processing(layer const& lay)
|
|||
{
|
||||
detector_.clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void cairo_renderer_base::end_layer_processing(layer const&)
|
||||
{
|
||||
void cairo_renderer_base::end_layer_processing(layer const&)
|
||||
{
|
||||
#ifdef MAPNIK_DEBUG
|
||||
std::clog << "end layer processing\n";
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
void cairo_renderer_base::process(polygon_symbolizer const& sym,
|
||||
void cairo_renderer_base::process(polygon_symbolizer const& sym,
|
||||
mapnik::feature_ptr const& feature,
|
||||
proj_transform const& prj_trans)
|
||||
{
|
||||
{
|
||||
typedef coord_transform2<CoordTransform,geometry_type> path_type;
|
||||
|
||||
cairo_context context(context_);
|
||||
|
@ -738,12 +738,12 @@ void cairo_renderer_base::process(polygon_symbolizer const& sym,
|
|||
context.fill();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void cairo_renderer_base::process(building_symbolizer const& sym,
|
||||
void cairo_renderer_base::process(building_symbolizer const& sym,
|
||||
mapnik::feature_ptr const& feature,
|
||||
proj_transform const& prj_trans)
|
||||
{
|
||||
{
|
||||
typedef coord_transform2<CoordTransform,geometry_type> path_type;
|
||||
typedef coord_transform3<CoordTransform,geometry_type> path_type_roof;
|
||||
|
||||
|
@ -849,12 +849,12 @@ void cairo_renderer_base::process(building_symbolizer const& sym,
|
|||
context.fill();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void cairo_renderer_base::process(line_symbolizer const& sym,
|
||||
void cairo_renderer_base::process(line_symbolizer const& sym,
|
||||
mapnik::feature_ptr const& feature,
|
||||
proj_transform const& prj_trans)
|
||||
{
|
||||
{
|
||||
typedef coord_transform2<CoordTransform,geometry_type> path_type;
|
||||
|
||||
cairo_context context(context_);
|
||||
|
@ -884,11 +884,11 @@ void cairo_renderer_base::process(line_symbolizer const& sym,
|
|||
context.stroke();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void cairo_renderer_base::render_marker(const int x, const int y, marker &marker, const agg::trans_affine & tr, double opacity)
|
||||
void cairo_renderer_base::render_marker(const int x, const int y, marker &marker, const agg::trans_affine & tr, double opacity)
|
||||
|
||||
{
|
||||
{
|
||||
cairo_context context(context_);
|
||||
if (marker.is_vector())
|
||||
{
|
||||
|
@ -985,12 +985,12 @@ void cairo_renderer_base::render_marker(const int x, const int y, marker &marker
|
|||
{
|
||||
context.add_image(x, y, **marker.get_bitmap_data(), opacity);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void cairo_renderer_base::process(point_symbolizer const& sym,
|
||||
void cairo_renderer_base::process(point_symbolizer const& sym,
|
||||
mapnik::feature_ptr const& feature,
|
||||
proj_transform const& prj_trans)
|
||||
{
|
||||
{
|
||||
std::string filename = path_processor_type::evaluate( *sym.get_filename(), *feature);
|
||||
|
||||
boost::optional<marker_ptr> marker;
|
||||
|
@ -1045,12 +1045,12 @@ void cairo_renderer_base::process(point_symbolizer const& sym,
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void cairo_renderer_base::process(shield_symbolizer const& sym,
|
||||
void cairo_renderer_base::process(shield_symbolizer const& sym,
|
||||
mapnik::feature_ptr const& feature,
|
||||
proj_transform const& prj_trans)
|
||||
{
|
||||
{
|
||||
shield_symbolizer_helper<face_manager<freetype_engine>,
|
||||
label_collision_detector4> helper(
|
||||
sym, *feature, prj_trans,
|
||||
|
@ -1071,12 +1071,12 @@ void cairo_renderer_base::process(shield_symbolizer const& sym,
|
|||
context.add_text(placement->placements[ii], face_manager_, font_manager_);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void cairo_renderer_base::process(line_pattern_symbolizer const& sym,
|
||||
void cairo_renderer_base::process(line_pattern_symbolizer const& sym,
|
||||
mapnik::feature_ptr const& feature,
|
||||
proj_transform const& prj_trans)
|
||||
{
|
||||
{
|
||||
typedef coord_transform2<CoordTransform,geometry_type> path_type;
|
||||
|
||||
std::string filename = path_processor_type::evaluate( *sym.get_filename(), *feature);
|
||||
|
@ -1140,12 +1140,12 @@ void cairo_renderer_base::process(line_pattern_symbolizer const& sym,
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void cairo_renderer_base::process(polygon_pattern_symbolizer const& sym,
|
||||
void cairo_renderer_base::process(polygon_pattern_symbolizer const& sym,
|
||||
mapnik::feature_ptr const& feature,
|
||||
proj_transform const& prj_trans)
|
||||
{
|
||||
{
|
||||
typedef coord_transform2<CoordTransform,geometry_type> path_type;
|
||||
|
||||
cairo_context context(context_);
|
||||
|
@ -1171,12 +1171,12 @@ void cairo_renderer_base::process(polygon_pattern_symbolizer const& sym,
|
|||
context.fill();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void cairo_renderer_base::process(raster_symbolizer const& sym,
|
||||
void cairo_renderer_base::process(raster_symbolizer const& sym,
|
||||
mapnik::feature_ptr const& feature,
|
||||
proj_transform const& prj_trans)
|
||||
{
|
||||
{
|
||||
raster_ptr const& source = feature->get_raster();
|
||||
if (source)
|
||||
{
|
||||
|
@ -1215,13 +1215,13 @@ void cairo_renderer_base::process(raster_symbolizer const& sym,
|
|||
context.add_image(start_x, start_y, target.data_, sym.get_opacity());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// TODO - this is woefully behind the AGG version.
|
||||
void cairo_renderer_base::process(markers_symbolizer const& sym,
|
||||
void cairo_renderer_base::process(markers_symbolizer const& sym,
|
||||
mapnik::feature_ptr const& feature,
|
||||
proj_transform const& prj_trans)
|
||||
{
|
||||
{
|
||||
typedef coord_transform2<CoordTransform,geometry_type> path_type;
|
||||
arrow arrow_;
|
||||
cairo_context context(context_);
|
||||
|
@ -1248,12 +1248,12 @@ void cairo_renderer_base::process(markers_symbolizer const& sym,
|
|||
}
|
||||
context.fill();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void cairo_renderer_base::process(text_symbolizer const& sym,
|
||||
void cairo_renderer_base::process(text_symbolizer const& sym,
|
||||
mapnik::feature_ptr const& feature,
|
||||
proj_transform const& prj_trans)
|
||||
{
|
||||
{
|
||||
text_symbolizer_helper<face_manager<freetype_engine>, label_collision_detector4> helper(sym, *feature, prj_trans, detector_.extent().width(), detector_.extent().height(), 1.0 /*scale_factor*/, t_, font_manager_, detector_);
|
||||
|
||||
cairo_context context(context_);
|
||||
|
@ -1264,10 +1264,10 @@ void cairo_renderer_base::process(text_symbolizer const& sym,
|
|||
context.add_text(placement->placements[ii], face_manager_, font_manager_);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
template class cairo_renderer<Cairo::Surface>;
|
||||
template class cairo_renderer<Cairo::Context>;
|
||||
template class cairo_renderer<Cairo::Surface>;
|
||||
template class cairo_renderer<Cairo::Context>;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -87,9 +87,9 @@ datasource_ptr datasource_cache::create(const parameters& params, bool bind)
|
|||
lt_dlerror());
|
||||
}
|
||||
// http://www.mr-edd.co.uk/blog/supressing_gcc_warnings
|
||||
#ifdef __GNUC__
|
||||
#ifdef __GNUC__
|
||||
__extension__
|
||||
#endif
|
||||
#endif
|
||||
create_ds* create_datasource =
|
||||
reinterpret_cast<create_ds*>(lt_dlsym(itr->second->handle(), "create"));
|
||||
|
||||
|
@ -168,9 +168,9 @@ void datasource_cache::register_datasources(const std::string& str)
|
|||
if (module)
|
||||
{
|
||||
// http://www.mr-edd.co.uk/blog/supressing_gcc_warnings
|
||||
#ifdef __GNUC__
|
||||
#ifdef __GNUC__
|
||||
__extension__
|
||||
#endif
|
||||
#endif
|
||||
datasource_name* ds_name =
|
||||
reinterpret_cast<datasource_name*>(lt_dlsym(module, "datasource_name"));
|
||||
if (ds_name && insert(ds_name(),module))
|
||||
|
|
|
@ -41,8 +41,8 @@ namespace mapnik { namespace util {
|
|||
|
||||
// poor man's deepcopy implementation
|
||||
|
||||
void deepcopy(Map const& map_in, Map & map_out)
|
||||
{
|
||||
void deepcopy(Map const& map_in, Map & map_out)
|
||||
{
|
||||
// * width_(rhs.width_),
|
||||
// * height_(rhs.height_),
|
||||
// * srs_(rhs.srs_),
|
||||
|
@ -122,6 +122,6 @@ void deepcopy(Map const& map_in, Map & map_out)
|
|||
map_out.insert_style(kv.first, style_out);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}}
|
||||
}}
|
||||
|
|
|
@ -35,7 +35,7 @@ IMPLEMENT_ENUM( filter_mode_e, filter_mode_strings )
|
|||
|
||||
|
||||
feature_type_style::feature_type_style()
|
||||
: filter_mode_(FILTER_ALL),
|
||||
: filter_mode_(FILTER_ALL),
|
||||
scale_denom_validity_(-1) {}
|
||||
|
||||
feature_type_style::feature_type_style(feature_type_style const& rhs, bool deep_copy)
|
||||
|
|
|
@ -37,7 +37,7 @@ IMPLEMENT_ENUM( gradient_e, gradient_strings )
|
|||
|
||||
|
||||
gradient::gradient()
|
||||
: gradient_type_(NO_GRADIENT),
|
||||
: gradient_type_(NO_GRADIENT),
|
||||
stops_(),
|
||||
x1_(0),
|
||||
y1_(0),
|
||||
|
|
|
@ -124,7 +124,7 @@ void image_32::set_color_to_alpha(const color& /*c*/)
|
|||
|
||||
void image_32::set_alpha(float opacity)
|
||||
{
|
||||
{
|
||||
{
|
||||
for (unsigned int y = 0; y < height_; ++y)
|
||||
{
|
||||
unsigned int* row_to = data_.getRow(y);
|
||||
|
@ -158,7 +158,7 @@ void image_32::set_alpha(float opacity)
|
|||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -45,43 +45,43 @@ extern "C"
|
|||
|
||||
namespace mapnik
|
||||
{
|
||||
class JpegReader : public image_reader, boost::noncopyable
|
||||
{
|
||||
private:
|
||||
class JpegReader : public image_reader, boost::noncopyable
|
||||
{
|
||||
private:
|
||||
std::string fileName_;
|
||||
unsigned width_;
|
||||
unsigned height_;
|
||||
public:
|
||||
public:
|
||||
explicit JpegReader(const std::string& fileName);
|
||||
~JpegReader();
|
||||
unsigned width() const;
|
||||
unsigned height() const;
|
||||
void read(unsigned x,unsigned y,image_data_32& image);
|
||||
private:
|
||||
private:
|
||||
void init();
|
||||
};
|
||||
};
|
||||
|
||||
namespace
|
||||
{
|
||||
image_reader* createJpegReader(const std::string& file)
|
||||
{
|
||||
namespace
|
||||
{
|
||||
image_reader* createJpegReader(const std::string& file)
|
||||
{
|
||||
return new JpegReader(file);
|
||||
}
|
||||
const bool registered = register_image_reader("jpeg",createJpegReader);
|
||||
}
|
||||
}
|
||||
const bool registered = register_image_reader("jpeg",createJpegReader);
|
||||
}
|
||||
|
||||
JpegReader::JpegReader(const std::string& fileName)
|
||||
JpegReader::JpegReader(const std::string& fileName)
|
||||
: fileName_(fileName),
|
||||
width_(0),
|
||||
height_(0)
|
||||
{
|
||||
{
|
||||
init();
|
||||
}
|
||||
}
|
||||
|
||||
JpegReader::~JpegReader() {}
|
||||
JpegReader::~JpegReader() {}
|
||||
|
||||
void JpegReader::init()
|
||||
{
|
||||
void JpegReader::init()
|
||||
{
|
||||
FILE *fp = fopen(fileName_.c_str(),"rb");
|
||||
if (!fp) throw image_reader_exception("JPEG Reader: cannot open image file " + fileName_);
|
||||
|
||||
|
@ -101,20 +101,20 @@ namespace mapnik
|
|||
//jpeg_finish_decompress(&cinfo);
|
||||
jpeg_destroy_decompress(&cinfo);
|
||||
fclose(fp);
|
||||
}
|
||||
}
|
||||
|
||||
unsigned JpegReader::width() const
|
||||
{
|
||||
unsigned JpegReader::width() const
|
||||
{
|
||||
return width_;
|
||||
}
|
||||
}
|
||||
|
||||
unsigned JpegReader::height() const
|
||||
{
|
||||
unsigned JpegReader::height() const
|
||||
{
|
||||
return height_;
|
||||
}
|
||||
}
|
||||
|
||||
void JpegReader::read(unsigned x0, unsigned y0, image_data_32& image)
|
||||
{
|
||||
void JpegReader::read(unsigned x0, unsigned y0, image_data_32& image)
|
||||
{
|
||||
struct jpeg_decompress_struct cinfo;
|
||||
|
||||
FILE *fp = fopen(fileName_.c_str(),"rb");
|
||||
|
@ -174,5 +174,5 @@ namespace mapnik
|
|||
jpeg_finish_decompress(&cinfo);
|
||||
jpeg_destroy_decompress(&cinfo);
|
||||
fclose(fp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -219,11 +219,11 @@ void map_parser::parse_map( Map & map, ptree const & pt, std::string const& base
|
|||
{
|
||||
boost::filesystem::path xml_path(filename_);
|
||||
// TODO - should we make this absolute?
|
||||
#if (BOOST_FILESYSTEM_VERSION == 3)
|
||||
#if (BOOST_FILESYSTEM_VERSION == 3)
|
||||
std::string base = xml_path.parent_path().string();
|
||||
#else // v2
|
||||
#else // v2
|
||||
std::string base = xml_path.branch_path().string();
|
||||
#endif
|
||||
#endif
|
||||
|
||||
map.set_base_path( base );
|
||||
}
|
||||
|
@ -1794,18 +1794,18 @@ std::string map_parser::ensure_relative_to_xml( boost::optional<std::string> opt
|
|||
boost::filesystem::path rel_path = *opt_path;
|
||||
if ( !rel_path.has_root_path() )
|
||||
{
|
||||
#if (BOOST_FILESYSTEM_VERSION == 3)
|
||||
#if (BOOST_FILESYSTEM_VERSION == 3)
|
||||
// TODO - normalize is now deprecated, use make_preferred?
|
||||
boost::filesystem::path full = boost::filesystem::absolute(xml_path.parent_path()/rel_path);
|
||||
#else // v2
|
||||
#else // v2
|
||||
boost::filesystem::path full = boost::filesystem::complete(xml_path.branch_path()/rel_path).normalize();
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef MAPNIK_DEBUG
|
||||
#ifdef MAPNIK_DEBUG
|
||||
std::clog << "\nModifying relative paths to be relative to xml...\n";
|
||||
std::clog << "original base path: " << *opt_path << "\n";
|
||||
std::clog << "relative base path: " << full.string() << "\n";
|
||||
#endif
|
||||
#endif
|
||||
return full.string();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -63,7 +63,7 @@ static const char * aspect_fix_mode_strings[] = {
|
|||
IMPLEMENT_ENUM( aspect_fix_mode_e, aspect_fix_mode_strings )
|
||||
|
||||
Map::Map()
|
||||
: width_(400),
|
||||
: width_(400),
|
||||
height_(400),
|
||||
srs_("+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs"),
|
||||
buffer_size_(0),
|
||||
|
@ -408,10 +408,10 @@ void Map::zoom_all()
|
|||
if (prj_trans.backward(layer_ext))
|
||||
{
|
||||
success = true;
|
||||
#ifdef MAPNIK_DEBUG
|
||||
#ifdef MAPNIK_DEBUG
|
||||
std::clog << " layer " << itr->name() << " original ext: " << itr->envelope() << "\n";
|
||||
std::clog << " layer " << itr->name() << " transformed to map srs: " << layer_ext << "\n";
|
||||
#endif
|
||||
#endif
|
||||
if (first)
|
||||
{
|
||||
ext = layer_ext;
|
||||
|
|
|
@ -44,7 +44,7 @@ static const char * marker_type_strings[] = {
|
|||
IMPLEMENT_ENUM( marker_type_e, marker_type_strings )
|
||||
|
||||
markers_symbolizer::markers_symbolizer()
|
||||
: symbolizer_with_image(path_expression_ptr(new path_expression)),
|
||||
: symbolizer_with_image(path_expression_ptr(new path_expression)),
|
||||
symbolizer_base(),
|
||||
allow_overlap_(false),
|
||||
fill_(color(0,0,255)),
|
||||
|
|
|
@ -37,7 +37,7 @@ static const char * point_placement_strings[] = {
|
|||
IMPLEMENT_ENUM( point_placement_e, point_placement_strings )
|
||||
|
||||
point_symbolizer::point_symbolizer()
|
||||
: symbolizer_with_image(path_expression_ptr(new path_expression)), // FIXME
|
||||
: symbolizer_with_image(path_expression_ptr(new path_expression)), // FIXME
|
||||
symbolizer_base(),
|
||||
overlap_(false),
|
||||
point_p_(CENTROID_POINT_PLACEMENT),
|
||||
|
|
|
@ -36,7 +36,7 @@ static const char * pattern_alignment_strings[] = {
|
|||
IMPLEMENT_ENUM( pattern_alignment_e, pattern_alignment_strings )
|
||||
|
||||
polygon_pattern_symbolizer::polygon_pattern_symbolizer(path_expression_ptr file)
|
||||
: symbolizer_with_image(file), symbolizer_base(),
|
||||
: symbolizer_with_image(file), symbolizer_base(),
|
||||
alignment_(LOCAL_ALIGNMENT),
|
||||
gamma_(1.0),
|
||||
gamma_method_(GAMMA_POWER) {}
|
||||
|
|
|
@ -566,7 +566,7 @@ void serialize_datasource( ptree & layer_node, datasource_ptr datasource)
|
|||
|
||||
class serialize_type : public boost::static_visitor<>
|
||||
{
|
||||
public:
|
||||
public:
|
||||
serialize_type( boost::property_tree::ptree & node):
|
||||
node_(node) {}
|
||||
|
||||
|
@ -590,7 +590,7 @@ class serialize_type : public boost::static_visitor<>
|
|||
node_.put("<xmlattr>.type", "string" );
|
||||
}
|
||||
|
||||
private:
|
||||
private:
|
||||
boost::property_tree::ptree & node_;
|
||||
};
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ static const char * line_join_strings[] = {
|
|||
IMPLEMENT_ENUM( line_join_e, line_join_strings )
|
||||
|
||||
stroke::stroke()
|
||||
: c_(0,0,0),
|
||||
: c_(0,0,0),
|
||||
width_(1.0),
|
||||
opacity_(1.0),
|
||||
line_cap_(BUTT_CAP),
|
||||
|
|
|
@ -26,15 +26,15 @@
|
|||
|
||||
namespace mapnik
|
||||
{
|
||||
template <typename T>
|
||||
void svg_renderer<T>::process(building_symbolizer const& sym,
|
||||
template <typename T>
|
||||
void svg_renderer<T>::process(building_symbolizer const& sym,
|
||||
Feature const& feature,
|
||||
proj_transform const& prj_trans)
|
||||
{
|
||||
{
|
||||
// nothing yet.
|
||||
}
|
||||
}
|
||||
|
||||
template void svg_renderer<std::ostream_iterator<char> >::process(building_symbolizer const& sym,
|
||||
template void svg_renderer<std::ostream_iterator<char> >::process(building_symbolizer const& sym,
|
||||
Feature const& feature,
|
||||
proj_transform const& prj_trans);
|
||||
}
|
||||
|
|
|
@ -26,15 +26,15 @@
|
|||
|
||||
namespace mapnik
|
||||
{
|
||||
template <typename T>
|
||||
void svg_renderer<T>::process(line_pattern_symbolizer const& sym,
|
||||
template <typename T>
|
||||
void svg_renderer<T>::process(line_pattern_symbolizer const& sym,
|
||||
Feature const& feature,
|
||||
proj_transform const& prj_trans)
|
||||
{
|
||||
{
|
||||
// nothing yet.
|
||||
}
|
||||
}
|
||||
|
||||
template void svg_renderer<std::ostream_iterator<char> >::process(line_pattern_symbolizer const& sym,
|
||||
template void svg_renderer<std::ostream_iterator<char> >::process(line_pattern_symbolizer const& sym,
|
||||
Feature const& feature,
|
||||
proj_transform const& prj_trans);
|
||||
}
|
||||
|
|
|
@ -26,14 +26,14 @@
|
|||
|
||||
namespace mapnik
|
||||
{
|
||||
/*!
|
||||
/*!
|
||||
* @brief Collect presentation attributes found in line symbolizer.
|
||||
*/
|
||||
template <typename T>
|
||||
void svg_renderer<T>::process(line_symbolizer const& sym,
|
||||
template <typename T>
|
||||
void svg_renderer<T>::process(line_symbolizer const& sym,
|
||||
Feature const& feature,
|
||||
proj_transform const& prj_trans)
|
||||
{
|
||||
{
|
||||
path_attributes_.set_stroke_color(sym.get_stroke().get_color());
|
||||
path_attributes_.set_stroke_opacity(sym.get_stroke().get_opacity());
|
||||
path_attributes_.set_stroke_width(sym.get_stroke().get_width());
|
||||
|
@ -41,9 +41,9 @@ namespace mapnik
|
|||
path_attributes_.set_stroke_linejoin(sym.get_stroke().get_line_join());
|
||||
path_attributes_.set_stroke_dasharray(sym.get_stroke().get_dash_array());
|
||||
path_attributes_.set_stroke_dashoffset(sym.get_stroke().dash_offset());
|
||||
}
|
||||
}
|
||||
|
||||
template void svg_renderer<std::ostream_iterator<char> >::process(line_symbolizer const& sym,
|
||||
template void svg_renderer<std::ostream_iterator<char> >::process(line_symbolizer const& sym,
|
||||
Feature const& feature,
|
||||
proj_transform const& prj_trans);
|
||||
}
|
||||
|
|
|
@ -26,15 +26,15 @@
|
|||
|
||||
namespace mapnik
|
||||
{
|
||||
template <typename T>
|
||||
void svg_renderer<T>::process(markers_symbolizer const& sym,
|
||||
template <typename T>
|
||||
void svg_renderer<T>::process(markers_symbolizer const& sym,
|
||||
Feature const& feature,
|
||||
proj_transform const& prj_trans)
|
||||
{
|
||||
{
|
||||
// nothing yet.
|
||||
}
|
||||
}
|
||||
|
||||
template void svg_renderer<std::ostream_iterator<char> >::process(markers_symbolizer const& sym,
|
||||
template void svg_renderer<std::ostream_iterator<char> >::process(markers_symbolizer const& sym,
|
||||
Feature const& feature,
|
||||
proj_transform const& prj_trans);
|
||||
}
|
||||
|
|
|
@ -26,15 +26,15 @@
|
|||
|
||||
namespace mapnik
|
||||
{
|
||||
template <typename T>
|
||||
void svg_renderer<T>::process(point_symbolizer const& sym,
|
||||
template <typename T>
|
||||
void svg_renderer<T>::process(point_symbolizer const& sym,
|
||||
Feature const& feature,
|
||||
proj_transform const& prj_trans)
|
||||
{
|
||||
{
|
||||
// nothing yet.
|
||||
}
|
||||
}
|
||||
|
||||
template void svg_renderer<std::ostream_iterator<char> >::process(point_symbolizer const& sym,
|
||||
template void svg_renderer<std::ostream_iterator<char> >::process(point_symbolizer const& sym,
|
||||
Feature const& feature,
|
||||
proj_transform const& prj_trans);
|
||||
}
|
||||
|
|
|
@ -26,15 +26,15 @@
|
|||
|
||||
namespace mapnik
|
||||
{
|
||||
template <typename T>
|
||||
void svg_renderer<T>::process(polygon_pattern_symbolizer const& sym,
|
||||
template <typename T>
|
||||
void svg_renderer<T>::process(polygon_pattern_symbolizer const& sym,
|
||||
Feature const& feature,
|
||||
proj_transform const& prj_trans)
|
||||
{
|
||||
{
|
||||
// nothing yet.
|
||||
}
|
||||
}
|
||||
|
||||
template void svg_renderer<std::ostream_iterator<char> >::process(polygon_pattern_symbolizer const& sym,
|
||||
template void svg_renderer<std::ostream_iterator<char> >::process(polygon_pattern_symbolizer const& sym,
|
||||
Feature const& feature,
|
||||
proj_transform const& prj_trans);
|
||||
}
|
||||
|
|
|
@ -26,19 +26,19 @@
|
|||
|
||||
namespace mapnik
|
||||
{
|
||||
/*!
|
||||
/*!
|
||||
* @brief Collect presentation attributes found in polygon symbolizer.
|
||||
*/
|
||||
template <typename T>
|
||||
void svg_renderer<T>::process(polygon_symbolizer const& sym,
|
||||
template <typename T>
|
||||
void svg_renderer<T>::process(polygon_symbolizer const& sym,
|
||||
Feature const& feature,
|
||||
proj_transform const& prj_trans)
|
||||
{
|
||||
{
|
||||
path_attributes_.set_fill_color(sym.get_fill());
|
||||
path_attributes_.set_fill_opacity(sym.get_opacity());
|
||||
}
|
||||
}
|
||||
|
||||
template void svg_renderer<std::ostream_iterator<char> >::process(polygon_symbolizer const& sym,
|
||||
template void svg_renderer<std::ostream_iterator<char> >::process(polygon_symbolizer const& sym,
|
||||
Feature const& feature,
|
||||
proj_transform const& prj_trans);
|
||||
}
|
||||
|
|
|
@ -26,15 +26,15 @@
|
|||
|
||||
namespace mapnik
|
||||
{
|
||||
template <typename T>
|
||||
void svg_renderer<T>::process(raster_symbolizer const& sym,
|
||||
template <typename T>
|
||||
void svg_renderer<T>::process(raster_symbolizer const& sym,
|
||||
Feature const& feature,
|
||||
proj_transform const& prj_trans)
|
||||
{
|
||||
{
|
||||
// nothing yet.
|
||||
}
|
||||
}
|
||||
|
||||
template void svg_renderer<std::ostream_iterator<char> >::process(raster_symbolizer const& sym,
|
||||
template void svg_renderer<std::ostream_iterator<char> >::process(raster_symbolizer const& sym,
|
||||
Feature const& feature,
|
||||
proj_transform const& prj_trans);
|
||||
}
|
||||
|
|
|
@ -26,15 +26,15 @@
|
|||
|
||||
namespace mapnik
|
||||
{
|
||||
template <typename T>
|
||||
void svg_renderer<T>::process(shield_symbolizer const& sym,
|
||||
template <typename T>
|
||||
void svg_renderer<T>::process(shield_symbolizer const& sym,
|
||||
Feature const& feature,
|
||||
proj_transform const& prj_trans)
|
||||
{
|
||||
{
|
||||
// nothing yet.
|
||||
}
|
||||
}
|
||||
|
||||
template void svg_renderer<std::ostream_iterator<char> >::process(shield_symbolizer const& sym,
|
||||
template void svg_renderer<std::ostream_iterator<char> >::process(shield_symbolizer const& sym,
|
||||
Feature const& feature,
|
||||
proj_transform const& prj_trans);
|
||||
}
|
||||
|
|
|
@ -26,15 +26,15 @@
|
|||
|
||||
namespace mapnik
|
||||
{
|
||||
template <typename T>
|
||||
void svg_renderer<T>::process(text_symbolizer const& sym,
|
||||
template <typename T>
|
||||
void svg_renderer<T>::process(text_symbolizer const& sym,
|
||||
Feature const& feature,
|
||||
proj_transform const& prj_trans)
|
||||
{
|
||||
{
|
||||
// nothing yet.
|
||||
}
|
||||
}
|
||||
|
||||
template void svg_renderer<std::ostream_iterator<char> >::process(text_symbolizer const& sym,
|
||||
template void svg_renderer<std::ostream_iterator<char> >::process(text_symbolizer const& sym,
|
||||
Feature const& feature,
|
||||
proj_transform const& prj_trans);
|
||||
}
|
||||
|
|
|
@ -78,4 +78,4 @@ namespace mapnik { namespace svg {
|
|||
}
|
||||
|
||||
template class svg_generator<std::ostream_iterator<char> >;
|
||||
}}
|
||||
}}
|
||||
|
|
|
@ -289,4 +289,4 @@ namespace mapnik { namespace svg {
|
|||
svg_version_ = SVG_VERSION;
|
||||
svg_namespace_url_ = SVG_NAMESPACE_URL;
|
||||
}
|
||||
}}
|
||||
}}
|
||||
|
|
|
@ -33,25 +33,25 @@
|
|||
|
||||
namespace mapnik
|
||||
{
|
||||
template <typename T>
|
||||
svg_renderer<T>::svg_renderer(Map const& m, T & output_iterator, unsigned offset_x, unsigned offset_y) :
|
||||
template <typename T>
|
||||
svg_renderer<T>::svg_renderer(Map const& m, T & output_iterator, unsigned offset_x, unsigned offset_y) :
|
||||
feature_style_processor<svg_renderer>(m),
|
||||
output_iterator_(output_iterator),
|
||||
width_(m.width()),
|
||||
height_(m.height()),
|
||||
t_(m.width(),m.height(),m.get_current_extent(),offset_x,offset_y),
|
||||
generator_(output_iterator)
|
||||
{}
|
||||
{}
|
||||
|
||||
template <typename T>
|
||||
svg_renderer<T>::~svg_renderer() {}
|
||||
template <typename T>
|
||||
svg_renderer<T>::~svg_renderer() {}
|
||||
|
||||
template <typename T>
|
||||
void svg_renderer<T>::start_map_processing(Map const& map)
|
||||
{
|
||||
#ifdef MAPNIK_DEBUG
|
||||
template <typename T>
|
||||
void svg_renderer<T>::start_map_processing(Map const& map)
|
||||
{
|
||||
#ifdef MAPNIK_DEBUG
|
||||
std::clog << "start map processing" << std::endl;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// generate XML header.
|
||||
generator_.generate_header();
|
||||
|
@ -69,34 +69,34 @@ namespace mapnik
|
|||
svg::rect_output_attributes bg_attributes(0, 0, width_, height_, *bgcolor);
|
||||
generator_.generate_rect(bg_attributes);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void svg_renderer<T>::end_map_processing(Map const& map)
|
||||
{
|
||||
template <typename T>
|
||||
void svg_renderer<T>::end_map_processing(Map const& map)
|
||||
{
|
||||
// generate SVG root element closing tag.
|
||||
generator_.generate_closing_root();
|
||||
|
||||
#ifdef MAPNIK_DEBUG
|
||||
#ifdef MAPNIK_DEBUG
|
||||
std::clog << "end map processing" << std::endl;
|
||||
#endif
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void svg_renderer<T>::start_layer_processing(layer const& lay)
|
||||
{
|
||||
#ifdef MAPNIK_DEBUG
|
||||
std::clog << "start layer processing: " << lay.name() << std::endl;
|
||||
#endif
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void svg_renderer<T>::end_layer_processing(layer const& lay)
|
||||
{
|
||||
#ifdef MAPNIK_DEBUG
|
||||
std::clog << "end layer processing: " << lay.name() << std::endl;
|
||||
#endif
|
||||
}
|
||||
|
||||
template class svg_renderer<std::ostream_iterator<char> >;
|
||||
#endif
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void svg_renderer<T>::start_layer_processing(layer const& lay)
|
||||
{
|
||||
#ifdef MAPNIK_DEBUG
|
||||
std::clog << "start layer processing: " << lay.name() << std::endl;
|
||||
#endif
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void svg_renderer<T>::end_layer_processing(layer const& lay)
|
||||
{
|
||||
#ifdef MAPNIK_DEBUG
|
||||
std::clog << "end layer processing: " << lay.name() << std::endl;
|
||||
#endif
|
||||
}
|
||||
|
||||
template class svg_renderer<std::ostream_iterator<char> >;
|
||||
}
|
||||
|
|
|
@ -45,16 +45,16 @@
|
|||
namespace mapnik { namespace svg {
|
||||
|
||||
|
||||
typedef std::vector<std::pair<double, agg::rgba8> > color_lookup_type;
|
||||
typedef std::vector<std::pair<double, agg::rgba8> > color_lookup_type;
|
||||
|
||||
namespace qi = boost::spirit::qi;
|
||||
namespace qi = boost::spirit::qi;
|
||||
|
||||
typedef std::vector<std::pair<std::string, std::string> > pairs_type;
|
||||
typedef std::vector<std::pair<std::string, std::string> > pairs_type;
|
||||
|
||||
template <typename Iterator,typename SkipType>
|
||||
struct key_value_sequence_ordered
|
||||
template <typename Iterator,typename SkipType>
|
||||
struct key_value_sequence_ordered
|
||||
: qi::grammar<Iterator, pairs_type(), SkipType>
|
||||
{
|
||||
{
|
||||
key_value_sequence_ordered()
|
||||
: key_value_sequence_ordered::base_type(query)
|
||||
{
|
||||
|
@ -67,7 +67,7 @@ struct key_value_sequence_ordered
|
|||
qi::rule<Iterator, pairs_type(), SkipType> query;
|
||||
qi::rule<Iterator, std::pair<std::string, std::string>(), SkipType> pair;
|
||||
qi::rule<Iterator, std::string(), SkipType> key, value;
|
||||
};
|
||||
};
|
||||
|
||||
agg::rgba8 parse_color(const char* str)
|
||||
{
|
||||
|
@ -612,7 +612,7 @@ void svg_parser::parse_rect(xmlTextReaderPtr reader)
|
|||
style="stop-color:#ffffff;stop-opacity:1;"
|
||||
offset="1"
|
||||
id="stop3763" />
|
||||
*/
|
||||
*/
|
||||
void svg_parser::parse_gradient_stop(xmlTextReaderPtr reader)
|
||||
{
|
||||
const xmlChar *value;
|
||||
|
@ -747,7 +747,7 @@ bool svg_parser::parse_common_gradient(xmlTextReaderPtr reader)
|
|||
fy="-21.425594"
|
||||
r="5.1999998"
|
||||
gradientUnits="userSpaceOnUse" />
|
||||
*/
|
||||
*/
|
||||
void svg_parser::parse_radial_gradient(xmlTextReaderPtr reader)
|
||||
{
|
||||
if (!parse_common_gradient(reader))
|
||||
|
|
|
@ -34,9 +34,9 @@
|
|||
|
||||
namespace mapnik { namespace svg {
|
||||
|
||||
template <typename PathType>
|
||||
bool parse_path(const char* wkt, PathType & p)
|
||||
{
|
||||
template <typename PathType>
|
||||
bool parse_path(const char* wkt, PathType & p)
|
||||
{
|
||||
using namespace boost::spirit;
|
||||
typedef const char* iterator_type;
|
||||
typedef ascii::space_type skip_type;
|
||||
|
@ -44,8 +44,8 @@ bool parse_path(const char* wkt, PathType & p)
|
|||
iterator_type first = wkt;
|
||||
iterator_type last = wkt + std::strlen(wkt);
|
||||
return qi::phrase_parse(first, last, g, skip_type());
|
||||
}
|
||||
}
|
||||
|
||||
template bool parse_path<svg_converter_type>(const char*, svg_converter_type&);
|
||||
template bool parse_path<svg_converter_type>(const char*, svg_converter_type&);
|
||||
|
||||
}}
|
||||
}}
|
||||
|
|
|
@ -29,9 +29,9 @@
|
|||
|
||||
namespace mapnik { namespace svg {
|
||||
|
||||
template <typename PathType>
|
||||
bool parse_points(const char* wkt, PathType & p)
|
||||
{
|
||||
template <typename PathType>
|
||||
bool parse_points(const char* wkt, PathType & p)
|
||||
{
|
||||
using namespace boost::spirit;
|
||||
typedef const char* iterator_type;
|
||||
typedef ascii::space_type skip_type;
|
||||
|
@ -39,8 +39,8 @@ bool parse_points(const char* wkt, PathType & p)
|
|||
iterator_type first = wkt;
|
||||
iterator_type last = wkt + std::strlen(wkt);
|
||||
return qi::phrase_parse(first, last, g, skip_type());
|
||||
}
|
||||
}
|
||||
|
||||
template bool parse_points<svg_converter_type>(const char*, svg_converter_type&);
|
||||
template bool parse_points<svg_converter_type>(const char*, svg_converter_type&);
|
||||
|
||||
}}
|
||||
}}
|
||||
|
|
|
@ -30,9 +30,9 @@
|
|||
|
||||
namespace mapnik { namespace svg {
|
||||
|
||||
template <typename TransformType>
|
||||
bool parse_transform(const char * wkt, TransformType & p)
|
||||
{
|
||||
template <typename TransformType>
|
||||
bool parse_transform(const char * wkt, TransformType & p)
|
||||
{
|
||||
using namespace boost::spirit;
|
||||
typedef const char * iterator_type;
|
||||
typedef ascii::space_type skip_type;
|
||||
|
@ -40,12 +40,12 @@ bool parse_transform(const char * wkt, TransformType & p)
|
|||
iterator_type first = wkt;
|
||||
iterator_type last = wkt + std::strlen(wkt);
|
||||
return qi::phrase_parse(first, last, g, skip_type());
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
template <typename TransformType>
|
||||
bool parse_transform(std::string const& wkt, TransformType & p)
|
||||
{
|
||||
template <typename TransformType>
|
||||
bool parse_transform(std::string const& wkt, TransformType & p)
|
||||
{
|
||||
using namespace boost::spirit;
|
||||
typedef std::string::const_iterator iterator_type;
|
||||
typedef ascii::space_type skip_type;
|
||||
|
@ -53,10 +53,10 @@ bool parse_transform(std::string const& wkt, TransformType & p)
|
|||
iterator_type first = wkt.begin();
|
||||
iterator_type last = wkt.end();
|
||||
return qi::phrase_parse(first, last, g, skip_type());
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
template MAPNIK_DECL 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&);
|
||||
|
||||
}}
|
||||
}}
|
||||
|
|
|
@ -87,7 +87,7 @@ IMPLEMENT_ENUM( text_transform_e, text_transform_strings )
|
|||
|
||||
|
||||
text_symbolizer::text_symbolizer(text_placements_ptr placements)
|
||||
: symbolizer_base(),
|
||||
: symbolizer_base(),
|
||||
placement_options_(placements)
|
||||
{
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue