Merge commit '32760318a4905efa45bb459d891e5e7ec1a7bf2a' into harfbuzz
Conflicts: include/mapnik/font_engine_freetype.hpp include/mapnik/text/formatting/base.hpp include/mapnik/text/formatting/list.hpp include/mapnik/text/text_properties.hpp src/font_engine_freetype.cpp src/grid/process_shield_symbolizer.cpp src/symbolizer_helpers.cpp src/text/formatting/expression.cpp src/text/formatting/format.cpp src/text/formatting/list.cpp src/text/text_properties.cpp
This commit is contained in:
commit
25d00ad26f
130 changed files with 608 additions and 391 deletions
|
@ -8,6 +8,8 @@ For a complete change history, see the git log.
|
|||
|
||||
## Future
|
||||
|
||||
- Fixed building symbolizer rendering to be fully sensitive to alpha (8b66128c892 / bc8ea1c5a7a)
|
||||
|
||||
- Added 64 bit integer support in the grid_renderer (#1662)
|
||||
|
||||
- `<Filter>[attr]</Filter>` now returns false if attr is an empty string (#1665)
|
||||
|
|
|
@ -370,6 +370,7 @@ opts.AddVariables(
|
|||
BoolVariable('PGSQL2SQLITE', 'Compile and install a utility to convert postgres tables to sqlite', 'False'),
|
||||
BoolVariable('COLOR_PRINT', 'Print build status information in color', 'True'),
|
||||
BoolVariable('SAMPLE_INPUT_PLUGINS', 'Compile and install sample plugins', 'False'),
|
||||
BoolVariable('BIGINT', 'Compile support for 64-bit integers in mapnik::value', 'True'),
|
||||
)
|
||||
|
||||
# variables to pickle after successful configure step
|
||||
|
@ -433,7 +434,8 @@ pickle_store = [# Scons internal variables
|
|||
'CAIROMM_CPPPATHS',
|
||||
'SVG_RENDERER',
|
||||
'SQLITE_LINKFLAGS',
|
||||
'BOOST_LIB_VERSION_FROM_HEADER'
|
||||
'BOOST_LIB_VERSION_FROM_HEADER',
|
||||
'BIGINT'
|
||||
]
|
||||
|
||||
# Add all other user configurable options to pickle pickle_store
|
||||
|
@ -1120,6 +1122,9 @@ if not preconfigured:
|
|||
# expression_string.cpp and map.cpp use fromUTF* function only available in >= ICU 4.2
|
||||
env['MISSING_DEPS'].append(env['ICU_LIB_NAME'])
|
||||
|
||||
if env['BIGINT']:
|
||||
env.Append(CXXFLAGS = '-DBIGINT')
|
||||
|
||||
if env['THREADING'] == 'multi':
|
||||
thread_flag = thread_suffix
|
||||
else:
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
#include <boost/python/suite/indexing/vector_indexing_suite.hpp>
|
||||
|
||||
// mapnik
|
||||
#include <mapnik/rule.hpp>
|
||||
#include <mapnik/layer.hpp>
|
||||
#include <mapnik/map.hpp>
|
||||
#include <mapnik/projection.hpp>
|
||||
|
|
|
@ -79,6 +79,9 @@ void export_logger();
|
|||
#include <mapnik/cairo_renderer.hpp>
|
||||
#endif
|
||||
#include <mapnik/graphics.hpp>
|
||||
#include <mapnik/stroke.hpp>
|
||||
#include <mapnik/font_set.hpp>
|
||||
#include <mapnik/rule.hpp>
|
||||
#include <mapnik/image_util.hpp>
|
||||
#include <mapnik/load_map.hpp>
|
||||
#include <mapnik/config_error.hpp>
|
||||
|
|
|
@ -34,7 +34,8 @@
|
|||
// mapnik
|
||||
#include <mapnik/shield_symbolizer.hpp>
|
||||
#include <mapnik/image_util.hpp>
|
||||
#include <mapnik/path_expression_grammar.hpp>
|
||||
#include <mapnik/parse_path.hpp>
|
||||
#include <mapnik/path_expression.hpp>
|
||||
#include "mapnik_svg.hpp"
|
||||
|
||||
using mapnik::color;
|
||||
|
|
|
@ -22,6 +22,9 @@
|
|||
#ifndef MAPNIK_PYTHON_BINDING_VALUE_CONVERTER_INCLUDED
|
||||
#define MAPNIK_PYTHON_BINDING_VALUE_CONVERTER_INCLUDED
|
||||
|
||||
// mapnik
|
||||
#include <mapnik/value.hpp>
|
||||
|
||||
// boost
|
||||
#include <boost/python.hpp>
|
||||
#include <boost/implicit_cast.hpp>
|
||||
|
@ -54,7 +57,7 @@ namespace boost { namespace python {
|
|||
return ::PyUnicode_DecodeUTF8(s.c_str(),implicit_cast<ssize_t>(s.length()),0);
|
||||
}
|
||||
|
||||
PyObject * operator() (UnicodeString const& s) const
|
||||
PyObject * operator() (mapnik::value_unicode_string const& s) const
|
||||
{
|
||||
std::string buffer;
|
||||
mapnik::to_utf8(s,buffer);
|
||||
|
|
|
@ -23,6 +23,9 @@
|
|||
#include <mapnik/map.hpp>
|
||||
#include <mapnik/layer.hpp>
|
||||
#include <mapnik/rule.hpp>
|
||||
#include <mapnik/line_symbolizer.hpp>
|
||||
#include <mapnik/polygon_symbolizer.hpp>
|
||||
#include <mapnik/text_symbolizer.hpp>
|
||||
#include <mapnik/feature_type_style.hpp>
|
||||
#include <mapnik/graphics.hpp>
|
||||
#include <mapnik/datasource_cache.hpp>
|
||||
|
|
|
@ -533,19 +533,20 @@ void render_grid(mapnik::Map const& map, double scaling_factor, QPixmap & pix)
|
|||
try
|
||||
{
|
||||
ren.apply();
|
||||
int * imdata = static_cast<int*>(buf.raw_data());
|
||||
mapnik::value_integer * imdata = static_cast<mapnik::value_integer*>(buf.raw_data());
|
||||
|
||||
QImage image(width,height,QImage::Format_RGB32);
|
||||
for (unsigned i = 0 ; i < height ; ++i)
|
||||
{
|
||||
for (unsigned j = 0 ; j < width ; ++j)
|
||||
{
|
||||
image.setPixel(j,i,qRgb((uint8_t)(imdata[i*width+j]>>8),
|
||||
(uint8_t)(imdata[i*width+j+1]>>8),
|
||||
(uint8_t)(imdata[i*width+j+2]>>8)));
|
||||
}
|
||||
}
|
||||
pix = QPixmap::fromImage(image);
|
||||
// Not sure how to display long long values ??
|
||||
//QImage image(width,height,QImage::Format_RGB32);
|
||||
//for (unsigned i = 0 ; i < height ; ++i)
|
||||
//{
|
||||
// for (unsigned j = 0 ; j < width ; ++j)
|
||||
// {
|
||||
// image.setPixel(j,i,qRgb((uint8_t)(imdata[i*width+j]>>8),
|
||||
// (uint8_t)(imdata[i*width+j+1]>>8),
|
||||
// (uint8_t)(imdata[i*width+j+2]>>8)));
|
||||
// }
|
||||
//}
|
||||
//pix = QPixmap::fromImage(image);
|
||||
}
|
||||
catch (mapnik::config_error & ex)
|
||||
{
|
||||
|
|
|
@ -2,11 +2,11 @@
|
|||
|
||||
## Community
|
||||
|
||||
Mapnik is an open source community creating a tool to enable to the craft of making beautiful maps. Working together collaboratively towards this goal is what makes it all possible and fun.
|
||||
Mapnik is a creative community focused on making beautiful maps with beautiful software.
|
||||
|
||||
We host our code on github.com/mapnik and encourage anyone interested to fork the repository and provide pull requests or patches for things they want to see added.
|
||||
We host our code on github.com/mapnik and encourage anyone interested to fork the repository and provide pull requests or patches for things they want to see added or fixed.
|
||||
|
||||
If you just have a question about the code, or a feature you want to discuss then feel free to create a new issue.
|
||||
If you just have a question about the code, or a feature you want to discuss then feel free to create a new issue at github.com/mapnik-support.
|
||||
|
||||
|
||||
## Code Philosophy
|
||||
|
@ -15,10 +15,9 @@ Look through the code to get an idea, and do not hesitate to ask questions.
|
|||
|
||||
Also read the design philosophy page for the motivations that lead to code decisions.
|
||||
|
||||
Templates are good, within reason. We seek to use templates were possible for flexible code, but not in cases where functional
|
||||
patterns would be just as concise and clear.
|
||||
Templates are good, within reason. We seek to use templates where possible for flexible code, but not in cases where functional patterns would be just as concise and clear.
|
||||
|
||||
In general we use Boost, it makes more possible in C++. It is a big build time dependency (as in time to compile against and # of headers) but ultimately compiles to small object code and is very fast (particularly spirit). It also has no dependencies itself (it's really an extension to the C++ language) so requiring it is much easier than requiring a hard dependency that itself has other dependencies. This is a big reason that we prefer AGG to Cairo as our primary renderer. Also AGG, besides producing the best visual output, strikes an excellent balance between speed and thread safety by using very lightweight objects. Cairo not so much.
|
||||
In general we use Boost, it makes more possible in C++. It is a big build time dependency (as in time to compile against and # of headers) but ultimately compiles to small object code and is very fast (particularly spirit). It also has no dependencies itself (it's really an extension to the C++ language) so requiring it is much easier than requiring a hard dependency that itself has other dependencies. This is a big reason that we prefer AGG to Cairo as our primary renderer. Also AGG produces the best visual output and strikes an excellent balance between speed and thread safety by using very lightweight objects. Cairo not so much.
|
||||
|
||||
You will also notice that we don't use many of the standard geo libraries when we could. For instance we don't use GDAL, OGR, or GEOS anywhere in core, and only leverage them in optional plugins. We feel we can often write code that is faster and more thread safe than these libraries but that still does the job. If this ever changes we can adapt and start using these libraries or others as dependencies - nothing is nicer than standing on the shoulders of giants when it makes sense.
|
||||
|
||||
|
@ -85,6 +84,15 @@ Mapnik is written in C++, and we try to follow general coding guidelines.
|
|||
|
||||
If you see bits of code around that do not follow these please don't hesitate to flag the issue or correct it yourself.
|
||||
|
||||
#### Avoid boost::lexical_cast
|
||||
|
||||
It's slow both to compile and at runtime.
|
||||
|
||||
#### Avoid sstream objects if possible
|
||||
|
||||
They should never be used in performance critical code because they trigger std::locale usage
|
||||
which triggers locks
|
||||
|
||||
#### Spaces not tabs, and avoid trailing whitespace
|
||||
|
||||
#### Indentation is four spaces
|
||||
|
|
|
@ -117,7 +117,7 @@ public:
|
|||
{
|
||||
// agg renderer doesn't support processing of multiple symbolizers.
|
||||
return false;
|
||||
};
|
||||
}
|
||||
|
||||
void painted(bool painted);
|
||||
inline eAttributeCollectionPolicy attribute_collection_policy() const
|
||||
|
|
|
@ -24,9 +24,25 @@
|
|||
#define MAPNIK_ATTRIBUTE_COLLECTOR_HPP
|
||||
|
||||
// mapnik
|
||||
#include <mapnik/rule.hpp>
|
||||
#include <mapnik/transform_processor.hpp>
|
||||
#include <mapnik/noncopyable.hpp>
|
||||
#include <mapnik/attribute.hpp>
|
||||
#include <mapnik/building_symbolizer.hpp>
|
||||
#include <mapnik/line_symbolizer.hpp>
|
||||
#include <mapnik/line_pattern_symbolizer.hpp>
|
||||
#include <mapnik/polygon_symbolizer.hpp>
|
||||
#include <mapnik/polygon_pattern_symbolizer.hpp>
|
||||
#include <mapnik/point_symbolizer.hpp>
|
||||
#include <mapnik/raster_symbolizer.hpp>
|
||||
#include <mapnik/shield_symbolizer.hpp>
|
||||
#include <mapnik/text_symbolizer.hpp>
|
||||
#include <mapnik/markers_symbolizer.hpp>
|
||||
#include <mapnik/expression.hpp> // for expression_ptr, etc
|
||||
#include <mapnik/expression_node.hpp>
|
||||
#include <mapnik/parse_path.hpp> // for path_processor_type
|
||||
#include <mapnik/path_expression.hpp> // for path_expression_ptr
|
||||
#include <mapnik/text_placements/base.hpp> // for text_placements
|
||||
#include <mapnik/transform_expression.hpp>
|
||||
|
||||
// boost
|
||||
#include <boost/variant.hpp>
|
||||
|
|
|
@ -79,7 +79,7 @@ public:
|
|||
return name_;
|
||||
}
|
||||
|
||||
unsigned get_type() const
|
||||
unsigned int get_type() const
|
||||
{
|
||||
return type_;
|
||||
}
|
||||
|
@ -101,7 +101,7 @@ public:
|
|||
|
||||
private:
|
||||
std::string name_;
|
||||
int type_;
|
||||
unsigned int type_;
|
||||
bool primary_key_;
|
||||
int size_;
|
||||
int precision_;
|
||||
|
|
|
@ -24,9 +24,8 @@
|
|||
|
||||
// std
|
||||
#include <istream>
|
||||
|
||||
// boost
|
||||
#include <boost/algorithm/string.hpp>
|
||||
#include <algorithm>
|
||||
#include <string>
|
||||
|
||||
namespace mapnik
|
||||
{
|
||||
|
@ -65,7 +64,7 @@ operator >> ( std::basic_istream<charT, traits> & s, boolean & b )
|
|||
{
|
||||
std::string word;
|
||||
s >> word;
|
||||
boost::algorithm::to_lower(word);
|
||||
std::transform(word.begin(), word.end(), word.begin(), ::tolower);
|
||||
if ( s )
|
||||
{
|
||||
if ( word == "true" || word == "yes" || word == "on" ||
|
||||
|
|
|
@ -118,7 +118,7 @@ public:
|
|||
{
|
||||
// cairo renderer doesn't support processing of multiple symbolizers.
|
||||
return false;
|
||||
};
|
||||
}
|
||||
void painted(bool /*painted*/)
|
||||
{
|
||||
// nothing to do
|
||||
|
|
|
@ -53,7 +53,7 @@ public:
|
|||
alpha_(0xff)
|
||||
{}
|
||||
|
||||
color(unsigned red, unsigned green, unsigned blue, unsigned alpha = 0xff)
|
||||
color(boost::uint8_t red, boost::uint8_t green, boost::uint8_t blue, boost::uint8_t alpha = 0xff)
|
||||
: red_(red),
|
||||
green_(green),
|
||||
blue_(blue),
|
||||
|
@ -76,14 +76,14 @@ public:
|
|||
|
||||
color& operator=(color const& rhs)
|
||||
{
|
||||
if (this==&rhs)
|
||||
if (this==&rhs)
|
||||
return *this;
|
||||
|
||||
|
||||
red_ = rhs.red_;
|
||||
green_ = rhs.green_;
|
||||
blue_ = rhs.blue_;
|
||||
alpha_ = rhs.alpha_;
|
||||
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
@ -95,38 +95,38 @@ public:
|
|||
(alpha_ == rhs.alpha());
|
||||
}
|
||||
|
||||
inline unsigned red() const
|
||||
inline boost::uint8_t red() const
|
||||
{
|
||||
return red_;
|
||||
}
|
||||
|
||||
inline unsigned green() const
|
||||
inline boost::uint8_t green() const
|
||||
{
|
||||
return green_;
|
||||
}
|
||||
inline unsigned blue() const
|
||||
inline boost::uint8_t blue() const
|
||||
{
|
||||
return blue_;
|
||||
}
|
||||
inline unsigned alpha() const
|
||||
inline boost::uint8_t alpha() const
|
||||
{
|
||||
return alpha_;
|
||||
}
|
||||
|
||||
inline void set_red(unsigned red)
|
||||
inline void set_red(boost::uint8_t red)
|
||||
{
|
||||
red_ = red;
|
||||
}
|
||||
inline void set_green(unsigned green)
|
||||
inline void set_green(boost::uint8_t green)
|
||||
{
|
||||
green_ = green;
|
||||
}
|
||||
|
||||
inline void set_blue(unsigned blue)
|
||||
inline void set_blue(boost::uint8_t blue)
|
||||
{
|
||||
blue_ = blue;
|
||||
}
|
||||
inline void set_alpha(unsigned alpha)
|
||||
inline void set_alpha(boost::uint8_t alpha)
|
||||
{
|
||||
alpha_ = alpha;
|
||||
}
|
||||
|
|
|
@ -52,8 +52,8 @@ struct coord<T,2>
|
|||
public:
|
||||
coord()
|
||||
: x(),y() {}
|
||||
coord(T x,T y)
|
||||
: x(x),y(y) {}
|
||||
coord(T x_,T y_)
|
||||
: x(x_),y(y_) {}
|
||||
template <typename T2>
|
||||
coord (const coord<T2,2>& rhs)
|
||||
: x(type(rhs.x)),
|
||||
|
@ -128,8 +128,8 @@ struct coord<T,3>
|
|||
public:
|
||||
coord()
|
||||
: x(),y(),z() {}
|
||||
coord(T x,T y,T z)
|
||||
: x(x),y(y),z(z) {}
|
||||
coord(T x_,T y_,T z_)
|
||||
: x(x_),y(y_),z(z_) {}
|
||||
template <typename T2>
|
||||
coord (const coord<T2,3>& rhs)
|
||||
: x(type(rhs.x)),
|
||||
|
|
|
@ -101,4 +101,4 @@ css_color_grammar<Iterator>::css_color_grammar()
|
|||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -24,7 +24,6 @@
|
|||
#define MAPNIK_CTRANS_HPP
|
||||
|
||||
// mapnik
|
||||
#include <mapnik/debug.hpp>
|
||||
#include <mapnik/box2d.hpp>
|
||||
#include <mapnik/vertex.hpp>
|
||||
#include <mapnik/proj_transform.hpp>
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
|
||||
// mapnik
|
||||
#include <mapnik/config.hpp>
|
||||
#include <mapnik/debug.hpp>
|
||||
|
||||
// stl
|
||||
#include <vector>
|
||||
|
@ -45,7 +44,7 @@ public:
|
|||
what_( what )
|
||||
{
|
||||
}
|
||||
virtual ~illegal_enum_value() throw() {};
|
||||
virtual ~illegal_enum_value() throw() {}
|
||||
|
||||
virtual const char * what() const throw()
|
||||
{
|
||||
|
@ -261,21 +260,17 @@ public:
|
|||
{
|
||||
if (our_strings_[i] == 0 )
|
||||
{
|
||||
MAPNIK_LOG_ERROR(enumeration)
|
||||
<< "### FATAL: Not enough strings for enum "
|
||||
std::cerr << "### FATAL: Not enough strings for enum "
|
||||
<< our_name_ << " defined in file '" << filename
|
||||
<< "' at line " << line_no;
|
||||
//std::exit(1);
|
||||
}
|
||||
}
|
||||
if ( std::string("") != our_strings_[THE_MAX])
|
||||
{
|
||||
MAPNIK_LOG_ERROR(enumeration)
|
||||
<< "### FATAL: The string array for enum " << our_name_
|
||||
<< " defined in file '" << filename << "' at line " << line_no
|
||||
<< " has too many items or is not terminated with an "
|
||||
<< "empty string";
|
||||
//std::exit(1);
|
||||
std::cerr << "### FATAL: The string array for enum " << our_name_
|
||||
<< " defined in file '" << filename << "' at line " << line_no
|
||||
<< " has too many items or is not terminated with an "
|
||||
<< "empty string";
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -30,11 +30,13 @@
|
|||
|
||||
// stl
|
||||
#include <string>
|
||||
#include <set>
|
||||
|
||||
namespace mapnik
|
||||
{
|
||||
|
||||
typedef boost::shared_ptr<expr_node> expression_ptr;
|
||||
typedef std::set<expression_ptr> expression_set;
|
||||
|
||||
|
||||
MAPNIK_DECL expression_ptr parse_expression (std::string const& wkt, std::string const& encoding = "UTF8");
|
||||
|
|
|
@ -23,6 +23,11 @@
|
|||
#ifndef MAPNIK_EXPRESSION_EVALUATOR_HPP
|
||||
#define MAPNIK_EXPRESSION_EVALUATOR_HPP
|
||||
|
||||
// mapnik
|
||||
#include <mapnik/attribute.hpp>
|
||||
#include <mapnik/unicode.hpp>
|
||||
#include <mapnik/expression_node.hpp>
|
||||
|
||||
// boost
|
||||
#include <boost/regex.hpp>
|
||||
#if defined(BOOST_REGEX_HAS_ICU)
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
|
||||
// mapnik
|
||||
#include <mapnik/value.hpp>
|
||||
#include <mapnik/unicode.hpp>
|
||||
#include <mapnik/expression_node.hpp>
|
||||
|
||||
// boost
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
#include <boost/iterator/iterator_traits.hpp>
|
||||
#include <boost/iterator/iterator_facade.hpp>
|
||||
#include <boost/iterator/filter_iterator.hpp>
|
||||
#include <boost/variant.hpp>
|
||||
|
||||
// stl
|
||||
#include <map>
|
||||
|
||||
|
|
|
@ -24,8 +24,7 @@
|
|||
#define MAPNIK_FEATURE_STYLE_PROCESSOR_HPP
|
||||
|
||||
// mapnik
|
||||
#include <mapnik/map.hpp>
|
||||
#include <mapnik/memory_datasource.hpp>
|
||||
#include <mapnik/datasource.hpp> // for featureset_ptr
|
||||
|
||||
// stl
|
||||
#include <set>
|
||||
|
@ -39,6 +38,7 @@ class Map;
|
|||
class layer;
|
||||
class projection;
|
||||
class proj_transform;
|
||||
class feature_type_style;
|
||||
|
||||
enum eAttributeCollectionPolicy
|
||||
{
|
||||
|
@ -54,17 +54,17 @@ public:
|
|||
explicit feature_style_processor(Map const& m, double scale_factor = 1.0);
|
||||
|
||||
/*!
|
||||
* @return apply renderer to all map layers.
|
||||
* \brief apply renderer to all map layers.
|
||||
*/
|
||||
void apply();
|
||||
|
||||
/*!
|
||||
* @return apply renderer to a single layer, providing pre-populated set of query attribute names.
|
||||
* \brief apply renderer to a single layer, providing pre-populated set of query attribute names.
|
||||
*/
|
||||
void apply(mapnik::layer const& lyr, std::set<std::string>& names);
|
||||
private:
|
||||
/*!
|
||||
* @return render a layer given a projection and scale.
|
||||
* \brief render a layer given a projection and scale.
|
||||
*/
|
||||
void apply_to_layer(layer const& lay,
|
||||
Processor & p,
|
||||
|
@ -73,7 +73,7 @@ private:
|
|||
std::set<std::string>& names);
|
||||
|
||||
/*!
|
||||
* @return renders a featureset with the given styles.
|
||||
* \brief renders a featureset with the given styles.
|
||||
*/
|
||||
void render_style(layer const& lay,
|
||||
Processor & p,
|
||||
|
|
|
@ -26,13 +26,18 @@
|
|||
// the template with the desired template arguments.
|
||||
|
||||
// mapnik
|
||||
#include <mapnik/map.hpp>
|
||||
#include <mapnik/debug.hpp>
|
||||
#include <mapnik/feature.hpp>
|
||||
#include <mapnik/feature_style_processor.hpp>
|
||||
#include <mapnik/query.hpp>
|
||||
#include <mapnik/feature_type_style.hpp>
|
||||
#include <mapnik/box2d.hpp>
|
||||
#include <mapnik/feature.hpp>
|
||||
#include <mapnik/datasource.hpp>
|
||||
#include <mapnik/memory_datasource.hpp>
|
||||
#include <mapnik/feature_type_style.hpp>
|
||||
#include <mapnik/box2d.hpp>
|
||||
#include <mapnik/layer.hpp>
|
||||
#include <mapnik/rule.hpp>
|
||||
#include <mapnik/attribute_collector.hpp>
|
||||
#include <mapnik/expression_evaluator.hpp>
|
||||
#include <mapnik/utils.hpp>
|
||||
|
|
|
@ -24,19 +24,23 @@
|
|||
#define MAPNIK_FEATURE_TYPE_STYLE_HPP
|
||||
|
||||
// mapnik
|
||||
#include <mapnik/config.hpp>
|
||||
#include <mapnik/rule.hpp>
|
||||
#include <mapnik/feature.hpp>
|
||||
#include <mapnik/enumeration.hpp>
|
||||
#include <mapnik/image_filter_types.hpp>
|
||||
#include <mapnik/image_compositing.hpp>
|
||||
|
||||
// boost
|
||||
#include <boost/optional.hpp>
|
||||
|
||||
// stl
|
||||
#include <vector>
|
||||
|
||||
namespace mapnik
|
||||
{
|
||||
|
||||
class rule;
|
||||
|
||||
enum filter_mode_enum {
|
||||
FILTER_ALL,
|
||||
FILTER_FIRST,
|
||||
|
|
|
@ -51,6 +51,9 @@ extern "C"
|
|||
|
||||
namespace mapnik
|
||||
{
|
||||
typedef std::vector<face_ptr> container_type;
|
||||
typedef container_type::size_type size_type;
|
||||
|
||||
|
||||
// FT_Stroker wrapper
|
||||
class stroker : mapnik::noncopyable
|
||||
|
@ -78,7 +81,7 @@ public:
|
|||
*/
|
||||
static bool register_font(std::string const& file_name);
|
||||
/*! \brief register a font file
|
||||
* @param file_name - path to a directory containing fonts or subdirectories.
|
||||
* @param dir - path to a directory containing fonts or subdirectories.
|
||||
* @param recurse - default false, whether to search for fonts in sub directories.
|
||||
* @return bool - true if at least one face was successfully registered.
|
||||
*/
|
||||
|
|
|
@ -505,9 +505,9 @@ bool interior_position(PathType & path, double & x, double & y)
|
|||
double max_width = 0;
|
||||
for (unsigned ii = 1; ii < intersections.size(); ++ii)
|
||||
{
|
||||
double x1=intersections[ii];
|
||||
double xc=(x0+x1)/2.0;
|
||||
double width = std::fabs(x1-x0);
|
||||
double xi=intersections[ii];
|
||||
double xc=(x0+xi)/2.0;
|
||||
double width = std::fabs(xi-x0);
|
||||
if (width > max_width && hit_test(path,xc,y,0))
|
||||
{
|
||||
x=xc;
|
||||
|
|
|
@ -42,7 +42,7 @@ enum eGeomType {
|
|||
};
|
||||
|
||||
template <typename T, template <typename> class Container=vertex_vector>
|
||||
class geometry : private::mapnik::noncopyable
|
||||
class geometry : private mapnik::noncopyable
|
||||
{
|
||||
public:
|
||||
typedef T coord_type;
|
||||
|
|
|
@ -105,7 +105,7 @@ public:
|
|||
{
|
||||
// grid renderer doesn't support processing of multiple symbolizers.
|
||||
return false;
|
||||
};
|
||||
}
|
||||
void painted(bool painted)
|
||||
{
|
||||
pixmap_.painted(painted);
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#ifndef DUMP_XML_HPP
|
||||
#define DUMP_XML_HPP
|
||||
#include <mapnik/xml_node.hpp>
|
||||
|
||||
namespace mapnik
|
||||
{
|
||||
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
#define MAPNIK_FEATURE_COLLECTION_GRAMMAR_HPP
|
||||
|
||||
// mapnik
|
||||
#include <mapnik/unicode.hpp>
|
||||
#include <mapnik/json/feature_grammar.hpp>
|
||||
#include <mapnik/feature.hpp>
|
||||
|
||||
|
|
|
@ -25,6 +25,8 @@
|
|||
|
||||
// mapnik
|
||||
#include <mapnik/json/geometry_grammar.hpp>
|
||||
#include <mapnik/feature.hpp>
|
||||
#include <mapnik/unicode.hpp>
|
||||
#include <mapnik/value.hpp>
|
||||
|
||||
// spirit::qi
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
|
||||
// mapnik
|
||||
#include <mapnik/geometry.hpp>
|
||||
#include <mapnik/feature.hpp>
|
||||
|
||||
// spirit::qi
|
||||
#include <boost/config/warning_disable.hpp>
|
||||
|
|
|
@ -90,7 +90,7 @@ public:
|
|||
std::vector<std::string>& styles();
|
||||
|
||||
/*!
|
||||
* @param max_zoom The minimum zoom level to set
|
||||
* @param min_zoom The minimum zoom level to set
|
||||
*/
|
||||
void set_min_zoom(double min_zoom);
|
||||
|
||||
|
@ -136,7 +136,7 @@ public:
|
|||
*
|
||||
* @return true if this layer's data is active and visible at a given scale.
|
||||
* Otherwise returns False.
|
||||
* @return false if:
|
||||
* false if:
|
||||
* scale >= minzoom - 1e-6
|
||||
* or
|
||||
* scale < maxzoom + 1e-6
|
||||
|
@ -154,7 +154,7 @@ public:
|
|||
bool clear_label_cache() const;
|
||||
|
||||
/*!
|
||||
* @param clear_cache Set whether this layer's features should be cached if used by multiple styles.
|
||||
* @param cache_features Set whether this layer's features should be cached if used by multiple styles.
|
||||
*/
|
||||
void set_cache_features(bool cache_features);
|
||||
|
||||
|
@ -164,7 +164,7 @@ public:
|
|||
bool cache_features() const;
|
||||
|
||||
/*!
|
||||
* @param group_by Set the field rendering of this layer is grouped by.
|
||||
* @param column Set the field rendering of this layer is grouped by.
|
||||
*/
|
||||
void set_group_by(std::string column);
|
||||
|
||||
|
|
|
@ -153,7 +153,7 @@ public:
|
|||
* @param name The name of the style.
|
||||
* @param style The style to insert.
|
||||
* @return true If success.
|
||||
* @return false If no success.
|
||||
* false If no success.
|
||||
*/
|
||||
bool insert_style(std::string const& name,feature_type_style const& style);
|
||||
|
||||
|
@ -170,9 +170,9 @@ public:
|
|||
|
||||
/*! \brief Insert a fontset into the map.
|
||||
* @param name The name of the fontset.
|
||||
* @param style The fontset to insert.
|
||||
* @param fontset The fontset to insert.
|
||||
* @return true If success.
|
||||
* @return false If failure.
|
||||
* false If failure.
|
||||
*/
|
||||
bool insert_fontset(std::string const& name, font_set const& fontset);
|
||||
|
||||
|
@ -274,7 +274,7 @@ public:
|
|||
boost::optional<color> const& background() const;
|
||||
|
||||
/*! \brief Set the map background image filename.
|
||||
* @param c Background image filename.
|
||||
* @param image_filename Background image filename.
|
||||
*/
|
||||
void set_background_image(std::string const& image_filename);
|
||||
|
||||
|
@ -310,8 +310,8 @@ public:
|
|||
*/
|
||||
std::string const& base_path() const;
|
||||
|
||||
/*! \brief Set the map base path where paths should be releative to.
|
||||
* @param srs Map base_path.
|
||||
/*! \brief Set the map base path where paths should be relative to.
|
||||
* @param base Map base_path.
|
||||
*/
|
||||
void set_base_path(std::string const& base);
|
||||
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
#include <mapnik/markers_placement.hpp>
|
||||
#include <mapnik/geometry.hpp>
|
||||
#include <mapnik/ctrans.hpp>
|
||||
#include <mapnik/debug.hpp>
|
||||
#include <mapnik/label_collision_detector.hpp>
|
||||
#include <mapnik/global.hpp> //round
|
||||
#include <mapnik/box2d.hpp>
|
||||
|
|
|
@ -24,7 +24,10 @@
|
|||
#define MAPNIK_MEMORY_FEATURESET_HPP
|
||||
|
||||
// mapnik
|
||||
#include <mapnik/datasource.hpp>
|
||||
#include <mapnik/memory_datasource.hpp>
|
||||
#include <mapnik/feature.hpp>
|
||||
#include <mapnik/raster.hpp>
|
||||
|
||||
// boost
|
||||
#include <boost/utility.hpp>
|
||||
|
|
|
@ -23,7 +23,10 @@
|
|||
#ifndef MAPNIK_OFFSET_CONVERTER_HPP
|
||||
#define MAPNIK_OFFSET_CONVERTER_HPP
|
||||
|
||||
#ifdef MAPNIK_LOG
|
||||
#include <mapnik/debug.hpp>
|
||||
#endif
|
||||
#include <mapnik/config.hpp>
|
||||
#include <mapnik/box2d.hpp>
|
||||
#include <mapnik/vertex.hpp>
|
||||
#include <mapnik/proj_transform.hpp>
|
||||
|
|
|
@ -62,7 +62,7 @@ struct rgb {
|
|||
byte g;
|
||||
byte b;
|
||||
|
||||
inline rgb(byte r_, byte g_, byte b_) : r(r_), g(g_), b(b_) {};
|
||||
inline rgb(byte r_, byte g_, byte b_) : r(r_), g(g_), b(b_) {}
|
||||
rgb(rgba const& c);
|
||||
|
||||
inline bool operator==(const rgb& y) const
|
||||
|
|
|
@ -75,9 +75,9 @@ class parameters : public param_map
|
|||
typedef boost::optional<T> return_type;
|
||||
static return_type extract(parameters const& params,
|
||||
std::string const& name,
|
||||
boost::optional<T> const& default_value)
|
||||
boost::optional<T> const& default_opt_value)
|
||||
{
|
||||
boost::optional<T> result(default_value);
|
||||
boost::optional<T> result(default_opt_value);
|
||||
parameters::const_iterator itr = params.find(name);
|
||||
if (itr != params.end())
|
||||
{
|
||||
|
@ -98,9 +98,9 @@ public:
|
|||
}
|
||||
|
||||
template <typename T>
|
||||
boost::optional<T> get(std::string const& key, T const& default_value) const
|
||||
boost::optional<T> get(std::string const& key, T const& default_opt_value) const
|
||||
{
|
||||
return converter<T>::extract(*this,key,boost::optional<T>(default_value));
|
||||
return converter<T>::extract(*this,key,boost::optional<T>(default_opt_value));
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
#include <mapnik/attribute.hpp>
|
||||
#include <mapnik/feature.hpp>
|
||||
#include <mapnik/value.hpp>
|
||||
#include <mapnik/path_expression.hpp>
|
||||
#include <mapnik/path_expression_grammar.hpp>
|
||||
|
||||
// boost
|
||||
|
@ -41,8 +42,6 @@
|
|||
|
||||
namespace mapnik {
|
||||
|
||||
typedef boost::shared_ptr<path_expression> path_expression_ptr;
|
||||
|
||||
MAPNIK_DECL path_expression_ptr parse_path(std::string const & str);
|
||||
MAPNIK_DECL path_expression_ptr parse_path(std::string const & str,
|
||||
path_expression_grammar<std::string::const_iterator> const& g);
|
||||
|
@ -140,7 +139,7 @@ struct path_processor
|
|||
}
|
||||
};
|
||||
|
||||
typedef mapnik::path_processor<Feature> path_processor_type;
|
||||
typedef mapnik::path_processor<feature_impl> path_processor_type;
|
||||
|
||||
}
|
||||
|
||||
|
|
45
include/mapnik/path_expression.hpp
Normal file
45
include/mapnik/path_expression.hpp
Normal file
|
@ -0,0 +1,45 @@
|
|||
/*****************************************************************************
|
||||
*
|
||||
* This file is part of Mapnik (c++ mapping toolkit)
|
||||
*
|
||||
* Copyright (C) 2011 Artem Pavlenko
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef MAPNIK_PATH_EXPRESSION_HPP
|
||||
#define MAPNIK_PATH_EXPRESSION_HPP
|
||||
|
||||
// boost
|
||||
#include <boost/variant.hpp>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
|
||||
// stl
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace mapnik
|
||||
{
|
||||
|
||||
struct attribute;
|
||||
|
||||
typedef boost::variant<std::string, attribute> path_component;
|
||||
typedef std::vector<path_component> path_expression;
|
||||
typedef boost::shared_ptr<path_expression> path_expression_ptr;
|
||||
|
||||
}
|
||||
|
||||
#endif // MAPNIK_PATH_EXPRESSION_HPP
|
|
@ -24,10 +24,7 @@
|
|||
#define MAPNIK_PATH_EXPRESSIONS_GRAMMAR_HPP
|
||||
|
||||
// mapnik
|
||||
#include <mapnik/attribute.hpp>
|
||||
|
||||
// boost
|
||||
#include <boost/variant.hpp>
|
||||
#include <mapnik/path_expression.hpp>
|
||||
|
||||
// spirit2
|
||||
#include <boost/spirit/include/qi.hpp>
|
||||
|
@ -47,9 +44,6 @@ namespace standard_wide = boost::spirit::standard_wide;
|
|||
|
||||
using standard_wide::space_type;
|
||||
|
||||
typedef boost::variant<std::string, attribute> path_component;
|
||||
typedef std::vector<path_component> path_expression;
|
||||
|
||||
template <typename Iterator>
|
||||
struct path_expression_grammar : qi::grammar<Iterator, std::vector<path_component>(), space_type>
|
||||
{
|
||||
|
|
|
@ -34,7 +34,7 @@ struct pixel_position
|
|||
{
|
||||
double x;
|
||||
double y;
|
||||
pixel_position(double x, double y) : x(x), y(y) { }
|
||||
pixel_position(double x_, double y_) : x(x_), y(y_) { }
|
||||
pixel_position() : x(0), y(0) { }
|
||||
pixel_position operator+ (pixel_position const& other) const
|
||||
{
|
||||
|
|
|
@ -23,6 +23,9 @@
|
|||
#ifndef MAPNIK_PTREE_HELPERS_HPP
|
||||
#define MAPNIK_PTREE_HELPERS_HPP
|
||||
|
||||
// stl
|
||||
#include <string>
|
||||
|
||||
// boost
|
||||
#include <boost/property_tree/ptree.hpp>
|
||||
|
||||
|
|
|
@ -25,14 +25,13 @@
|
|||
|
||||
//mapnik
|
||||
#include <mapnik/box2d.hpp>
|
||||
#include <mapnik/feature.hpp>
|
||||
|
||||
// boost
|
||||
#include <boost/tuple/tuple.hpp>
|
||||
|
||||
// stl
|
||||
#include <set>
|
||||
#include <limits>
|
||||
#include <string>
|
||||
|
||||
namespace mapnik {
|
||||
|
||||
|
|
|
@ -72,7 +72,7 @@ public:
|
|||
//!
|
||||
//! \param[in] value The stop value
|
||||
//! \param[in] mode The stop mode
|
||||
//! \param[in] color The stop color
|
||||
//! \param[in] _color The stop color
|
||||
colorizer_stop(float value = 0,
|
||||
colorizer_mode mode = COLORIZER_INHERIT,
|
||||
color const& _color = color(0,0,0,0),
|
||||
|
@ -87,39 +87,39 @@ public:
|
|||
|
||||
//! \brief Set the stop value
|
||||
//! \param[in] value The stop value
|
||||
inline void set_value(float value) { value_ = value; };
|
||||
inline void set_value(float value) { value_ = value; }
|
||||
|
||||
//! \brief Get the stop value
|
||||
//! \return The stop value
|
||||
inline float get_value() const {return value_; };
|
||||
inline float get_value() const { return value_; }
|
||||
|
||||
|
||||
//! \brief Set the stop mode
|
||||
//! \param[in] mode The stop mode
|
||||
inline void set_mode(colorizer_mode mode) { mode_ = mode; };
|
||||
inline void set_mode_enum(colorizer_mode_enum mode) { set_mode(mode); };
|
||||
inline void set_mode(colorizer_mode mode) { mode_ = mode; }
|
||||
inline void set_mode_enum(colorizer_mode_enum mode) { set_mode(mode); }
|
||||
|
||||
//! \brief Get the stop mode
|
||||
//! \return The stop mode
|
||||
inline colorizer_mode get_mode() const { return mode_; };
|
||||
inline colorizer_mode_enum get_mode_enum() const { return get_mode(); };
|
||||
inline colorizer_mode get_mode() const { return mode_; }
|
||||
inline colorizer_mode_enum get_mode_enum() const { return get_mode(); }
|
||||
|
||||
|
||||
//! \brief set the stop color
|
||||
//! \param[in] the stop color
|
||||
inline void set_color(color const& _color) { color_ = _color; };
|
||||
//! \param[in] _color The stop color
|
||||
inline void set_color(color const& _color) { color_ = _color; }
|
||||
|
||||
//! \brief get the stop color
|
||||
//! \return The stop color
|
||||
inline color const& get_color() const {return color_; };
|
||||
inline color const& get_color() const { return color_; }
|
||||
|
||||
//! \brief set the stop label
|
||||
//! \param[in] the stop label
|
||||
inline void set_label(std::string const& label) { label_ = label; };
|
||||
//! \param[in] label The stop label
|
||||
inline void set_label(std::string const& label) { label_ = label; }
|
||||
|
||||
//! \brief get the stop label
|
||||
//! \return The stop label
|
||||
inline std::string const& get_label() const {return label_; };
|
||||
inline std::string const& get_label() const { return label_; }
|
||||
|
||||
|
||||
//! \brief Equality operator
|
||||
|
@ -160,22 +160,22 @@ public:
|
|||
void set_default_mode(colorizer_mode mode)
|
||||
{
|
||||
default_mode_ = (mode == COLORIZER_INHERIT) ? COLORIZER_LINEAR:(colorizer_mode_enum)mode;
|
||||
};
|
||||
}
|
||||
|
||||
void set_default_mode_enum(colorizer_mode_enum mode) { set_default_mode(mode); };
|
||||
void set_default_mode_enum(colorizer_mode_enum mode) { set_default_mode(mode); }
|
||||
|
||||
//! \brief Get the default mode
|
||||
//! \return The default mode
|
||||
colorizer_mode get_default_mode() const {return default_mode_; };
|
||||
colorizer_mode_enum get_default_mode_enum() const {return get_default_mode(); };
|
||||
colorizer_mode get_default_mode() const { return default_mode_; }
|
||||
colorizer_mode_enum get_default_mode_enum() const { return get_default_mode(); }
|
||||
|
||||
//! \brief Set the default color
|
||||
//! \param[in] color The default color
|
||||
void set_default_color(color const& color) { default_color_ = color; };
|
||||
void set_default_color(color const& color) { default_color_ = color; }
|
||||
|
||||
//! \brief Get the default color
|
||||
//! \return The default color
|
||||
color const& get_default_color() const {return default_color_; };
|
||||
color const& get_default_color() const { return default_color_; }
|
||||
|
||||
|
||||
//! \brief Add a stop
|
||||
|
@ -186,17 +186,17 @@ public:
|
|||
|
||||
//! \brief Set the list of stops
|
||||
//! \param[in] stops The list of stops
|
||||
void set_stops(colorizer_stops const& stops) { stops_ = stops; };
|
||||
void set_stops(colorizer_stops const& stops) { stops_ = stops; }
|
||||
|
||||
//! \brief Get the list of stops
|
||||
//! \return The list of stops
|
||||
colorizer_stops const& get_stops() const {return stops_; };
|
||||
colorizer_stops const& get_stops() const { return stops_; }
|
||||
|
||||
|
||||
//! \brief Colorize a raster
|
||||
//!
|
||||
//! \param[in, out] raster A raster stored in float32 single channel format, which gets colorized in place.
|
||||
//! \param[in] feature used to find 'NODATA' information if available
|
||||
//! \param[in] f The feature used to find 'NODATA' information if available
|
||||
void colorize(raster_ptr const& raster, Feature const& f) const;
|
||||
|
||||
|
||||
|
@ -209,11 +209,11 @@ public:
|
|||
|
||||
//! \brief Set the epsilon value for exact mode
|
||||
//! \param[in] e The epsilon value
|
||||
inline void set_epsilon(const float e) { if(e > 0) epsilon_ = e; };
|
||||
inline void set_epsilon(const float e) { if(e > 0) epsilon_ = e; }
|
||||
|
||||
//! \brief Get the epsilon value for exact mode
|
||||
//! \return The epsilon value
|
||||
inline float get_epsilon() const { return epsilon_; };
|
||||
inline float get_epsilon() const { return epsilon_; }
|
||||
|
||||
private:
|
||||
colorizer_stops stops_; //!< The vector of stops
|
||||
|
|
|
@ -174,16 +174,7 @@ public:
|
|||
|
||||
private:
|
||||
|
||||
void swap(rule& rhs) throw()
|
||||
{
|
||||
name_=rhs.name_;
|
||||
min_scale_=rhs.min_scale_;
|
||||
max_scale_=rhs.max_scale_;
|
||||
syms_=rhs.syms_;
|
||||
filter_=rhs.filter_;
|
||||
else_filter_=rhs.else_filter_;
|
||||
also_filter_=rhs.also_filter_;
|
||||
}
|
||||
void swap(rule& rhs) throw();
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -1,9 +1,13 @@
|
|||
#ifndef MAPNIK_SIMPLIFY_HPP
|
||||
#define MAPNIK_SIMPLIFY_HPP
|
||||
|
||||
#include <mapnik/debug.hpp>
|
||||
// mapnik
|
||||
#include <mapnik/config.hpp>
|
||||
|
||||
// Boost
|
||||
// stl
|
||||
#include <string>
|
||||
|
||||
// boost
|
||||
#include <boost/optional.hpp>
|
||||
|
||||
namespace mapnik
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef MAPNIK_SIMPLIFY_CONVERTER_HPP
|
||||
#define MAPNIK_SIMPLIFY_CONVERTER_HPP
|
||||
|
||||
#include <mapnik/debug.hpp>
|
||||
#include <mapnik/config.hpp>
|
||||
#include <mapnik/box2d.hpp>
|
||||
#include <mapnik/vertex.hpp>
|
||||
#include <mapnik/simplify.hpp>
|
||||
|
|
|
@ -59,24 +59,24 @@ namespace mapnik { namespace svg {
|
|||
{}
|
||||
|
||||
void set_fill_color(color const& fill_color);
|
||||
void set_fill_opacity(const double fill_opacity);
|
||||
void set_fill_opacity(double fill_opacity);
|
||||
void set_stroke_color(color const& stroke_color);
|
||||
void set_stroke_opacity(const double stroke_opacity);
|
||||
void set_stroke_width(const double stroke_width);
|
||||
void set_stroke_linecap(const line_cap_e stroke_linecap);
|
||||
void set_stroke_linejoin(const line_join_e stroke_linejoin);
|
||||
void set_stroke_dasharray(const dash_array stroke_dasharray);
|
||||
void set_stroke_dashoffset(const double stroke_dashoffset);
|
||||
void set_stroke_opacity(double stroke_opacity);
|
||||
void set_stroke_width(double stroke_width);
|
||||
void set_stroke_linecap(line_cap_e stroke_linecap);
|
||||
void set_stroke_linejoin(line_join_e stroke_linejoin);
|
||||
void set_stroke_dasharray(dash_array const& stroke_dasharray);
|
||||
void set_stroke_dashoffset(double stroke_dashoffset);
|
||||
|
||||
const std::string fill_color() const;
|
||||
const double fill_opacity() const;
|
||||
const std::string stroke_color() const;
|
||||
const double stroke_opacity() const;
|
||||
const double stroke_width() const;
|
||||
const std::string stroke_linecap() const;
|
||||
const std::string stroke_linejoin() const;
|
||||
const dash_array stroke_dasharray() const;
|
||||
const double stroke_dashoffset() const;
|
||||
std::string const& fill_color() const;
|
||||
double fill_opacity() const;
|
||||
std::string const& stroke_color() const;
|
||||
double stroke_opacity() const;
|
||||
double stroke_width() const;
|
||||
std::string const& stroke_linecap() const;
|
||||
std::string const& stroke_linejoin() const;
|
||||
dash_array const& stroke_dasharray() const;
|
||||
double stroke_dashoffset() const;
|
||||
|
||||
/*!
|
||||
* @brief Set members back to their default values.
|
||||
|
@ -134,11 +134,11 @@ namespace mapnik { namespace svg {
|
|||
void set_height(const unsigned height);
|
||||
void set_fill_color(color const& fill_color);
|
||||
|
||||
const int x() const;
|
||||
const int y() const;
|
||||
const int width() const;
|
||||
const int height() const;
|
||||
const std::string fill_color() const;
|
||||
int x() const;
|
||||
int y() const;
|
||||
int width() const;
|
||||
int height() const;
|
||||
std::string const& fill_color() const;
|
||||
|
||||
/*!
|
||||
* @brief Set members back to their default values.
|
||||
|
@ -172,13 +172,13 @@ namespace mapnik { namespace svg {
|
|||
|
||||
void set_width(const unsigned width);
|
||||
void set_height(const unsigned height);
|
||||
void set_svg_version(const double svg_version);
|
||||
void set_svg_version(double svg_version);
|
||||
void set_svg_namespace_url(std::string const& svg_namespace_url);
|
||||
|
||||
const unsigned width() const;
|
||||
const unsigned height() const;
|
||||
const double svg_version() const;
|
||||
const std::string svg_namespace_url() const;
|
||||
unsigned width() const;
|
||||
unsigned height() const;
|
||||
double svg_version() const;
|
||||
std::string const& svg_namespace_url() const;
|
||||
|
||||
/*!
|
||||
* @brief Set members back to their default values.
|
||||
|
|
|
@ -24,7 +24,6 @@
|
|||
#define MAPNIK_SVG_RENDERER_AGG_HPP
|
||||
|
||||
// mapnik
|
||||
#include <mapnik/debug.hpp>
|
||||
#include <mapnik/svg/svg_path_attributes.hpp>
|
||||
#include <mapnik/gradient.hpp>
|
||||
#include <mapnik/box2d.hpp>
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
// mapnik
|
||||
#include <mapnik/config.hpp>
|
||||
#include <mapnik/parse_path.hpp>
|
||||
#include <mapnik/path_expression.hpp>
|
||||
#include <mapnik/image_compositing.hpp>
|
||||
#include <mapnik/transform_expression.hpp>
|
||||
#include <mapnik/simplify.hpp>
|
||||
|
@ -39,10 +39,11 @@ namespace mapnik
|
|||
|
||||
typedef transform_list_ptr transform_type;
|
||||
|
||||
MAPNIK_DECL void evaluate_transform(agg::trans_affine& tr, Feature const& feature,
|
||||
transform_type const& trans_expr);
|
||||
|
||||
class Map;
|
||||
class feature_impl;
|
||||
|
||||
MAPNIK_DECL void evaluate_transform(agg::trans_affine& tr, feature_impl const& feature,
|
||||
transform_type const& trans_expr);
|
||||
|
||||
class MAPNIK_DECL symbolizer_base
|
||||
{
|
||||
|
@ -79,7 +80,7 @@ public:
|
|||
void set_filename(path_expression_ptr const& filename);
|
||||
void set_opacity(float opacity);
|
||||
float get_opacity() const;
|
||||
void set_image_transform(transform_type const& tr);
|
||||
void set_image_transform(transform_type const& tr);
|
||||
transform_type const& get_image_transform() const;
|
||||
std::string get_image_transform_string() const;
|
||||
protected:
|
||||
|
|
|
@ -27,15 +27,11 @@
|
|||
#include <mapnik/expression.hpp>
|
||||
#include <mapnik/text/char_properties_ptr.hpp>
|
||||
|
||||
// stl
|
||||
#include <set>
|
||||
|
||||
// boost
|
||||
#include <boost/property_tree/ptree.hpp>
|
||||
#include <boost/property_tree/ptree_fwd.hpp>
|
||||
|
||||
namespace mapnik {
|
||||
|
||||
typedef std::set<expression_ptr> expression_set;
|
||||
class text_layout;
|
||||
class xml_node;
|
||||
|
||||
|
|
|
@ -26,6 +26,9 @@
|
|||
#include <mapnik/text/formatting/base.hpp>
|
||||
#include <mapnik/expression.hpp>
|
||||
|
||||
// boost
|
||||
#include <boost/property_tree/ptree_fwd.hpp>
|
||||
|
||||
namespace mapnik {
|
||||
namespace formatting {
|
||||
class expression_format: public node {
|
||||
|
|
|
@ -26,6 +26,9 @@
|
|||
#include <mapnik/text/formatting/base.hpp>
|
||||
#include <mapnik/text/text_properties.hpp>
|
||||
|
||||
// boost
|
||||
#include <boost/property_tree/ptree_fwd.hpp>
|
||||
|
||||
namespace mapnik {
|
||||
namespace formatting {
|
||||
class format_node: public node {
|
||||
|
|
|
@ -22,8 +22,12 @@
|
|||
#ifndef FORMATTING_LIST_HPP
|
||||
#define FORMATTING_LIST_HPP
|
||||
|
||||
// mapnik
|
||||
#include <mapnik/text/formatting/base.hpp>
|
||||
|
||||
// boost
|
||||
#include <boost/property_tree/ptree_fwd.hpp>
|
||||
|
||||
namespace mapnik {
|
||||
namespace formatting {
|
||||
class list_node: public node {
|
||||
|
|
|
@ -24,6 +24,9 @@
|
|||
|
||||
#include <mapnik/text/formatting/base.hpp>
|
||||
|
||||
// boost
|
||||
#include <boost/property_tree/ptree_fwd.hpp>
|
||||
|
||||
namespace mapnik {
|
||||
namespace formatting {
|
||||
class text_node: public node {
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
|
||||
// boost
|
||||
#include <boost/optional.hpp>
|
||||
#include <boost/property_tree/ptree.hpp>
|
||||
#include <boost/property_tree/ptree_fwd.hpp>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
|
||||
namespace mapnik
|
||||
|
|
|
@ -204,14 +204,12 @@ wkb_buffer_ptr to_polygon_wkb( GeometryType const& g, wkbByteOrder byte_order)
|
|||
|
||||
BOOST_FOREACH ( linear_ring const& ring, rings)
|
||||
{
|
||||
unsigned num_points = ring.size();
|
||||
write(ss,num_points,4,byte_order);
|
||||
unsigned num_ring_points = ring.size();
|
||||
write(ss,num_ring_points,4,byte_order);
|
||||
BOOST_FOREACH ( point_type const& pt, ring)
|
||||
{
|
||||
double x = pt.first;
|
||||
double y = pt.second;
|
||||
write(ss,x,8,byte_order);
|
||||
write(ss,y,8,byte_order);
|
||||
write(ss,pt.first,8,byte_order);
|
||||
write(ss,pt.second,8,byte_order);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -48,10 +48,10 @@ namespace mapnik {
|
|||
|
||||
inline void to_utf8(UnicodeString const& input, std::string & target)
|
||||
{
|
||||
if (input.length() == 0) return;
|
||||
if (input.isEmpty()) return;
|
||||
|
||||
const int BUF_SIZE = 256;
|
||||
char buf [BUF_SIZE];
|
||||
char buf [BUF_SIZE];
|
||||
int len;
|
||||
|
||||
UErrorCode err = U_ZERO_ERROR;
|
||||
|
@ -61,11 +61,11 @@ inline void to_utf8(UnicodeString const& input, std::string & target)
|
|||
boost::scoped_array<char> buf_ptr(new char [len+1]);
|
||||
err = U_ZERO_ERROR;
|
||||
u_strToUTF8(buf_ptr.get() , len + 1, &len, input.getBuffer(), input.length(), &err);
|
||||
target.assign(buf_ptr.get() , len);
|
||||
target.assign(buf_ptr.get() , static_cast<std::size_t>(len));
|
||||
}
|
||||
else
|
||||
{
|
||||
target.assign(buf, len);
|
||||
target.assign(buf, static_cast<std::size_t>(len));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -107,8 +107,6 @@ struct value_null
|
|||
}
|
||||
};
|
||||
|
||||
#define BIGINT
|
||||
|
||||
#ifdef BIGINT
|
||||
typedef long long value_integer;
|
||||
#else
|
||||
|
@ -497,6 +495,8 @@ struct mult : public boost::static_visitor<V>
|
|||
|
||||
value_type operator() (value_bool lhs, value_bool rhs) const
|
||||
{
|
||||
boost::ignore_unused_variable_warning(lhs);
|
||||
boost::ignore_unused_variable_warning(rhs);
|
||||
return value_integer(0);
|
||||
}
|
||||
};
|
||||
|
@ -787,12 +787,12 @@ struct to_int : public boost::static_visitor<value_integer>
|
|||
|
||||
value_integer operator() (value_double val) const
|
||||
{
|
||||
return rint(val);
|
||||
return static_cast<value_integer>(rint(val));
|
||||
}
|
||||
|
||||
value_integer operator() (value_bool val) const
|
||||
{
|
||||
return static_cast<int>(val);
|
||||
return static_cast<value_integer>(val);
|
||||
}
|
||||
|
||||
value_integer operator() (std::string const& val) const
|
||||
|
|
|
@ -39,7 +39,7 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
virtual ~value_error() throw() {};
|
||||
virtual ~value_error() throw() {}
|
||||
|
||||
virtual const char * what() const throw()
|
||||
{
|
||||
|
|
|
@ -56,8 +56,8 @@ struct vertex<T,2>
|
|||
explicit vertex(no_init_t)
|
||||
{}
|
||||
|
||||
vertex(coord_type x,coord_type y,unsigned cmd)
|
||||
: x(x),y(y),cmd(cmd) {}
|
||||
vertex(coord_type x_,coord_type y_,unsigned cmd_)
|
||||
: x(x_),y(y_),cmd(cmd_) {}
|
||||
|
||||
template <typename T2>
|
||||
vertex(const vertex<T2,2>& rhs)
|
||||
|
|
|
@ -27,11 +27,10 @@
|
|||
#include <boost/make_shared.hpp>
|
||||
#include <boost/tokenizer.hpp>
|
||||
#include <boost/algorithm/string.hpp>
|
||||
#include <boost/spirit/include/qi.hpp>
|
||||
#include <boost/spirit/include/phoenix_operator.hpp>
|
||||
|
||||
// mapnik
|
||||
#include <mapnik/debug.hpp>
|
||||
#include <mapnik/unicode.hpp>
|
||||
#include <mapnik/feature_layer_desc.hpp>
|
||||
#include <mapnik/feature_factory.hpp>
|
||||
#include <mapnik/geometry.hpp>
|
||||
|
@ -49,10 +48,10 @@
|
|||
#include <iostream>
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include <algorithm>
|
||||
|
||||
using mapnik::datasource;
|
||||
using mapnik::parameters;
|
||||
using namespace boost::spirit;
|
||||
|
||||
DATASOURCE_PLUGIN(csv_datasource)
|
||||
|
||||
|
@ -71,7 +70,6 @@ csv_datasource::csv_datasource(parameters const& params)
|
|||
headers_(),
|
||||
manual_headers_(mapnik::util::trim_copy(*params.get<std::string>("headers", ""))),
|
||||
strict_(*params.get<mapnik::boolean>("strict", false)),
|
||||
quiet_(*params.get<mapnik::boolean>("quiet", false)),
|
||||
filesize_max_(*params.get<float>("filesize_max", 20.0)), // MB
|
||||
ctx_(boost::make_shared<mapnik::context_type>())
|
||||
{
|
||||
|
@ -271,7 +269,8 @@ void csv_datasource::parse_csv(T & stream,
|
|||
for (; beg != tok.end(); ++beg)
|
||||
{
|
||||
std::string val = mapnik::util::trim_copy(*beg);
|
||||
std::string lower_val = boost::algorithm::to_lower_copy(val);
|
||||
std::string lower_val = val;
|
||||
std::transform(lower_val.begin(), lower_val.end(), lower_val.begin(), ::tolower);
|
||||
if (lower_val == "wkt"
|
||||
|| (lower_val.find("geom") != std::string::npos))
|
||||
{
|
||||
|
@ -349,7 +348,8 @@ void csv_datasource::parse_csv(T & stream,
|
|||
}
|
||||
else
|
||||
{
|
||||
std::string lower_val = boost::algorithm::to_lower_copy(val);
|
||||
std::string lower_val = val;
|
||||
std::transform(lower_val.begin(), lower_val.end(), lower_val.begin(), ::tolower);
|
||||
if (lower_val == "wkt"
|
||||
|| (lower_val.find("geom") != std::string::npos))
|
||||
{
|
||||
|
@ -686,10 +686,7 @@ void csv_datasource::parse_csv(T & stream,
|
|||
if (has_dot || has_e)
|
||||
{
|
||||
double float_val = 0.0;
|
||||
std::string::const_iterator str_beg = value.begin();
|
||||
std::string::const_iterator str_end = value.end();
|
||||
if (qi::phrase_parse(str_beg,str_end,qi::double_,ascii::space,float_val)
|
||||
&& (str_beg == str_end))
|
||||
if (mapnik::util::string2double(value,float_val))
|
||||
{
|
||||
matched = true;
|
||||
feature->put(fld_name,float_val);
|
||||
|
@ -704,10 +701,7 @@ void csv_datasource::parse_csv(T & stream,
|
|||
else
|
||||
{
|
||||
mapnik::value_integer int_val = 0;
|
||||
std::string::const_iterator str_beg = value.begin();
|
||||
std::string::const_iterator str_end = value.end();
|
||||
if (qi::phrase_parse(str_beg,str_end,qi::long_long,ascii::space,int_val)
|
||||
&& (str_beg == str_end))
|
||||
if (mapnik::util::string2longlong(value,int_val))
|
||||
{
|
||||
matched = true;
|
||||
feature->put(fld_name,int_val);
|
||||
|
@ -927,7 +921,6 @@ mapnik::featureset_ptr csv_datasource::features(mapnik::query const& q) const
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (! found_name)
|
||||
{
|
||||
std::ostringstream s;
|
||||
|
@ -937,7 +930,6 @@ mapnik::featureset_ptr csv_datasource::features(mapnik::query const& q) const
|
|||
}
|
||||
++pos;
|
||||
}
|
||||
|
||||
return boost::make_shared<mapnik::memory_featureset>(q.get_bbox(),features_);
|
||||
}
|
||||
|
||||
|
|
|
@ -72,7 +72,6 @@ private:
|
|||
std::vector<std::string> headers_;
|
||||
std::string manual_headers_;
|
||||
bool strict_;
|
||||
bool quiet_;
|
||||
double filesize_max_;
|
||||
mapnik::context_ptr ctx_;
|
||||
};
|
||||
|
|
|
@ -126,12 +126,12 @@ geojson_datasource::geojson_datasource(parameters const& params)
|
|||
{
|
||||
extent_ = box;
|
||||
first = false;
|
||||
mapnik::feature_kv_iterator itr = f->begin();
|
||||
mapnik::feature_kv_iterator end = f->end();
|
||||
for ( ;itr!=end; ++itr)
|
||||
mapnik::feature_kv_iterator f_itr = f->begin();
|
||||
mapnik::feature_kv_iterator f_end = f->end();
|
||||
for ( ;f_itr!=f_end; ++f_itr)
|
||||
{
|
||||
desc_.add_descriptor(mapnik::attribute_descriptor(boost::get<0>(*itr),
|
||||
boost::apply_visitor(attr_value_converter(),boost::get<1>(*itr).base())));
|
||||
desc_.add_descriptor(mapnik::attribute_descriptor(boost::get<0>(*f_itr),
|
||||
boost::apply_visitor(attr_value_converter(),boost::get<1>(*f_itr).base())));
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
|
@ -55,7 +55,7 @@ public:
|
|||
|
||||
SDOPointType();
|
||||
|
||||
SDOPointType(void *ctxOCCI_) : oracle::occi::PObject (ctxOCCI_) { };
|
||||
SDOPointType(void *ctxOCCI_) : oracle::occi::PObject (ctxOCCI_) { }
|
||||
|
||||
static void *readSQL(void *ctxOCCI_);
|
||||
|
||||
|
@ -130,7 +130,7 @@ public:
|
|||
|
||||
SDOGeometry();
|
||||
|
||||
SDOGeometry(void *ctxOCCI_) : oracle::occi::PObject (ctxOCCI_) { };
|
||||
SDOGeometry(void *ctxOCCI_) : oracle::occi::PObject (ctxOCCI_) { }
|
||||
|
||||
static void *readSQL(void *ctxOCCI_);
|
||||
|
||||
|
|
|
@ -372,7 +372,7 @@ boost::optional<mapnik::datasource::geometry_t> ogr_datasource::get_geometry_typ
|
|||
// TODO - csv and shapefile inspect first 4 features
|
||||
if (dataset_ && layer_.is_valid())
|
||||
{
|
||||
OGRLayer* layer = layer_.layer();
|
||||
layer = layer_.layer();
|
||||
// only new either reset of setNext
|
||||
//layer->ResetReading();
|
||||
layer->SetNextByIndex(0);
|
||||
|
@ -449,11 +449,11 @@ void validate_attribute_names(query const& q, std::vector<attribute_descriptor>
|
|||
{
|
||||
std::ostringstream s("OGR Plugin: no attribute '");
|
||||
s << *pos << "'. Valid attributes are: ";
|
||||
std::vector<attribute_descriptor>::const_iterator itr = names.begin();
|
||||
std::vector<attribute_descriptor>::const_iterator end = names.end();
|
||||
for ( ;itr!=end;++itr)
|
||||
std::vector<attribute_descriptor>::const_iterator e_itr = names.begin();
|
||||
std::vector<attribute_descriptor>::const_iterator e_end = names.end();
|
||||
for ( ;e_itr!=e_end;++e_itr)
|
||||
{
|
||||
s << itr->get_name() << std::endl;
|
||||
s << e_itr->get_name() << std::endl;
|
||||
}
|
||||
throw mapnik::datasource_exception(s.str());
|
||||
}
|
||||
|
|
|
@ -34,12 +34,12 @@ struct bounds
|
|||
{
|
||||
double w, s, e, n;
|
||||
bounds() { w = -180; s = -90; e = 180; n = 90; }
|
||||
bounds(double w, double s, double e, double n)
|
||||
bounds(double w_, double s_, double e_, double n_)
|
||||
{
|
||||
this->w = w;
|
||||
this->s = s;
|
||||
this->e = e;
|
||||
this->n = n;
|
||||
this->w = w_;
|
||||
this->s = s_;
|
||||
this->e = e_;
|
||||
this->n = n_;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -115,9 +115,6 @@ feature_ptr osm_featureset<filterT>::next()
|
|||
if (i != end_keyvals)
|
||||
{
|
||||
feature->put_new(i->first, tr_->transcode(i->second.c_str()));
|
||||
} else
|
||||
{
|
||||
feature->put_new(*itr, "");
|
||||
}
|
||||
}
|
||||
return feature;
|
||||
|
|
|
@ -64,8 +64,6 @@ void osmparser::startElement(xmlTextReaderPtr reader, const xmlChar *name)
|
|||
assert(xid);
|
||||
way->id = atol((char*)xid);
|
||||
cur_item = way;
|
||||
// Prevent ways with no name being assigned a name of "true"
|
||||
cur_item->keyvals["name"] = "";
|
||||
xmlFree(xid);
|
||||
}
|
||||
else if (xmlStrEqual(name,BAD_CAST "nd"))
|
||||
|
|
|
@ -23,17 +23,18 @@
|
|||
#include <mapnik/global.hpp>
|
||||
#include <mapnik/utils.hpp>
|
||||
#include <mapnik/unicode.hpp>
|
||||
#include <mapnik/util/trim.hpp>
|
||||
|
||||
#include "dbfile.hpp"
|
||||
|
||||
// boost
|
||||
#include <boost/algorithm/string.hpp>
|
||||
#include <boost/spirit/include/qi.hpp>
|
||||
#include <boost/cstdint.hpp> // for int16_t and int32_t
|
||||
#include <mapnik/mapped_memory_cache.hpp>
|
||||
|
||||
// stl
|
||||
#include <string>
|
||||
|
||||
|
||||
using mapnik::mapped_memory_cache;
|
||||
|
||||
dbf_file::dbf_file()
|
||||
|
@ -138,7 +139,7 @@ void dbf_file::add_attribute(int col, mapnik::transcoder const& tr, Feature & f)
|
|||
{
|
||||
// FIXME - avoid constructing std::string on stack
|
||||
std::string str(record_+fields_[col].offset_,fields_[col].length_);
|
||||
boost::trim(str);
|
||||
mapnik::util::trim(str);
|
||||
f.put(name,tr.transcode(str.c_str()));
|
||||
break;
|
||||
}
|
||||
|
@ -206,7 +207,9 @@ void dbf_file::read_header()
|
|||
field_descriptor desc;
|
||||
desc.index_=i;
|
||||
file_.read(name,10);
|
||||
desc.name_=boost::trim_left_copy(std::string(name));
|
||||
desc.name_=name;
|
||||
// TODO - when is this trim needed?
|
||||
mapnik::util::trim(desc.name_);
|
||||
skip(1);
|
||||
desc.type_=file_.get();
|
||||
skip(4);
|
||||
|
|
|
@ -72,9 +72,9 @@ struct shape_record
|
|||
size_t size;
|
||||
mutable size_t pos;
|
||||
|
||||
explicit shape_record(size_t size)
|
||||
: data(Tag::alloc(size)),
|
||||
size(size),
|
||||
explicit shape_record(size_t size_)
|
||||
: data(Tag::alloc(size_)),
|
||||
size(size_),
|
||||
pos(0)
|
||||
{}
|
||||
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
#include <mapnik/util/geometry_to_ds_type.hpp>
|
||||
#include <mapnik/timer.hpp>
|
||||
#include <mapnik/wkb.hpp>
|
||||
#include <mapnik/util/trim.hpp>
|
||||
|
||||
// boost
|
||||
#include <boost/algorithm/string.hpp>
|
||||
|
@ -429,8 +430,8 @@ void sqlite_datasource::parse_attachdb(std::string const& attachdb) const
|
|||
}
|
||||
|
||||
// Break out the dbname and the filename
|
||||
std::string dbname = boost::trim_copy(spec.substr(0, atpos));
|
||||
std::string filename = boost::trim_copy(spec.substr(atpos + 1));
|
||||
std::string dbname = mapnik::util::trim_copy(spec.substr(0, atpos));
|
||||
std::string filename = mapnik::util::trim_copy(spec.substr(atpos + 1));
|
||||
|
||||
// Normalize the filename and make it relative to dataset_name_
|
||||
if (filename.compare(":memory:") != 0)
|
||||
|
|
|
@ -117,8 +117,8 @@ feature_ptr sqlite_featureset::next()
|
|||
case SQLITE_TEXT:
|
||||
{
|
||||
int text_col_size;
|
||||
const char * data = rs_->column_text(i, text_col_size);
|
||||
UnicodeString ustr = tr_->transcode(data, text_col_size);
|
||||
const char * text_data = rs_->column_text(i, text_col_size);
|
||||
UnicodeString ustr = tr_->transcode(text_data, text_col_size);
|
||||
feature->put(fld_name_str, ustr);
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
// stl
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <algorithm>
|
||||
|
||||
// mapnik
|
||||
#include <mapnik/datasource.hpp>
|
||||
|
@ -492,7 +493,23 @@ public:
|
|||
std::string const& table
|
||||
)
|
||||
{
|
||||
if (has_spatial_index)
|
||||
if (! metadata.empty())
|
||||
{
|
||||
std::ostringstream s;
|
||||
s << "SELECT xmin, ymin, xmax, ymax FROM " << metadata;
|
||||
s << " WHERE LOWER(f_table_name) = LOWER('" << geometry_table << "')";
|
||||
boost::shared_ptr<sqlite_resultset> rs(ds->execute_query(s.str()));
|
||||
if (rs->is_valid() && rs->step_next())
|
||||
{
|
||||
double xmin = rs->column_double(0);
|
||||
double ymin = rs->column_double(1);
|
||||
double xmax = rs->column_double(2);
|
||||
double ymax = rs->column_double(3);
|
||||
extent.init (xmin, ymin, xmax, ymax);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if (has_spatial_index)
|
||||
{
|
||||
std::ostringstream s;
|
||||
s << "SELECT MIN(xmin), MIN(ymin), MAX(xmax), MAX(ymax) FROM "
|
||||
|
@ -512,22 +529,7 @@ public:
|
|||
}
|
||||
}
|
||||
}
|
||||
else if (! metadata.empty())
|
||||
{
|
||||
std::ostringstream s;
|
||||
s << "SELECT xmin, ymin, xmax, ymax FROM " << metadata;
|
||||
s << " WHERE LOWER(f_table_name) = LOWER('" << geometry_table << "')";
|
||||
boost::shared_ptr<sqlite_resultset> rs(ds->execute_query(s.str()));
|
||||
if (rs->is_valid() && rs->step_next())
|
||||
{
|
||||
double xmin = rs->column_double(0);
|
||||
double ymin = rs->column_double(1);
|
||||
double xmax = rs->column_double(2);
|
||||
double ymax = rs->column_double(3);
|
||||
extent.init (xmin, ymin, xmax, ymax);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
else if (! key_field.empty())
|
||||
{
|
||||
std::ostringstream s;
|
||||
|
@ -641,7 +643,7 @@ public:
|
|||
const char* fld_name = rs->column_text(1);
|
||||
std::string fld_type(rs->column_text(2));
|
||||
sqlite_int64 fld_pk = rs->column_integer64(5);
|
||||
boost::algorithm::to_lower(fld_type);
|
||||
std::transform(fld_type.begin(), fld_type.end(), fld_type.begin(), ::tolower);
|
||||
|
||||
// TODO - how to handle primary keys on multiple columns ?
|
||||
if (key_field.empty() && ! found_pk && fld_pk != 0)
|
||||
|
|
|
@ -26,8 +26,10 @@
|
|||
#include <mapnik/agg_helpers.hpp>
|
||||
#include <mapnik/graphics.hpp>
|
||||
|
||||
#include <mapnik/rule.hpp>
|
||||
#include <mapnik/debug.hpp>
|
||||
#include <mapnik/layer.hpp>
|
||||
#include <mapnik/label_collision_detector.hpp>
|
||||
#include <mapnik/feature_type_style.hpp>
|
||||
#include <mapnik/marker.hpp>
|
||||
#include <mapnik/marker_cache.hpp>
|
||||
|
|
|
@ -22,10 +22,13 @@
|
|||
|
||||
// mapnik
|
||||
#include <mapnik/graphics.hpp>
|
||||
#include <mapnik/feature.hpp>
|
||||
#include <mapnik/agg_renderer.hpp>
|
||||
#include <mapnik/agg_rasterizer.hpp>
|
||||
#include <mapnik/segment.hpp>
|
||||
#include <mapnik/expression_evaluator.hpp>
|
||||
#include <mapnik/building_symbolizer.hpp>
|
||||
#include <mapnik/expression.hpp>
|
||||
|
||||
// boost
|
||||
#include <boost/scoped_ptr.hpp>
|
||||
|
@ -73,7 +76,7 @@ void agg_renderer<T>::process(building_symbolizer const& sym,
|
|||
expression_ptr height_expr = sym.height();
|
||||
if (height_expr)
|
||||
{
|
||||
value_type result = boost::apply_visitor(evaluate<Feature,value_type>(feature), *height_expr);
|
||||
value_type result = boost::apply_visitor(evaluate<feature_impl,value_type>(feature), *height_expr);
|
||||
height = result.to_double() * scale_factor_;
|
||||
}
|
||||
|
||||
|
@ -148,7 +151,7 @@ void agg_renderer<T>::process(building_symbolizer const& sym,
|
|||
agg::conv_stroke<path_type> stroke(path);
|
||||
stroke.width(scale_factor_);
|
||||
ras_ptr->add_path(stroke);
|
||||
ren.color(agg::rgba8(int(r*0.8), int(g*0.8), int(b*0.8), int(255 * sym.get_opacity())));
|
||||
ren.color(agg::rgba8(int(r*0.8), int(g*0.8), int(b*0.8), int(a * sym.get_opacity())));
|
||||
agg::render_scanlines(*ras_ptr, sl, ren);
|
||||
ras_ptr->reset();
|
||||
|
||||
|
|
|
@ -21,8 +21,10 @@
|
|||
*****************************************************************************/
|
||||
|
||||
// mapnik
|
||||
#include <mapnik/feature.hpp>
|
||||
#include <mapnik/agg_renderer.hpp>
|
||||
#include <mapnik/graphics.hpp>
|
||||
#include <mapnik/label_collision_detector.hpp>
|
||||
|
||||
namespace mapnik {
|
||||
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
*****************************************************************************/
|
||||
|
||||
// mapnik
|
||||
#include <mapnik/feature.hpp>
|
||||
#include <mapnik/debug.hpp>
|
||||
#include <mapnik/graphics.hpp>
|
||||
#include <mapnik/agg_renderer.hpp>
|
||||
|
@ -32,6 +33,7 @@
|
|||
#include <mapnik/line_pattern_symbolizer.hpp>
|
||||
#include <mapnik/vertex_converters.hpp>
|
||||
#include <mapnik/noncopyable.hpp>
|
||||
#include <mapnik/parse_path.hpp>
|
||||
|
||||
// agg
|
||||
#include "agg_basics.h"
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
*****************************************************************************/
|
||||
|
||||
// mapnik
|
||||
#include <mapnik/feature.hpp>
|
||||
#include <mapnik/graphics.hpp>
|
||||
#include <mapnik/agg_renderer.hpp>
|
||||
#include <mapnik/agg_helpers.hpp>
|
||||
|
|
|
@ -38,6 +38,7 @@
|
|||
#include <mapnik/svg/svg_path_adapter.hpp>
|
||||
#include <mapnik/svg/svg_path_attributes.hpp>
|
||||
#include <mapnik/markers_symbolizer.hpp>
|
||||
#include <mapnik/parse_path.hpp>
|
||||
|
||||
// agg
|
||||
#include "agg_basics.h"
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
*****************************************************************************/
|
||||
|
||||
// mapnik
|
||||
#include <mapnik/feature.hpp>
|
||||
#include <mapnik/agg_renderer.hpp>
|
||||
#include <mapnik/agg_rasterizer.hpp>
|
||||
#include <mapnik/image_util.hpp>
|
||||
|
@ -30,6 +31,8 @@
|
|||
#include <mapnik/expression_evaluator.hpp>
|
||||
#include <mapnik/marker.hpp>
|
||||
#include <mapnik/marker_cache.hpp>
|
||||
#include <mapnik/label_collision_detector.hpp>
|
||||
#include <mapnik/parse_path.hpp>
|
||||
|
||||
// agg
|
||||
#include "agg_trans_affine.h"
|
||||
|
|
|
@ -22,7 +22,9 @@
|
|||
|
||||
// boost
|
||||
#include <boost/foreach.hpp>
|
||||
|
||||
// mapnik
|
||||
#include <mapnik/feature.hpp>
|
||||
#include <mapnik/debug.hpp>
|
||||
#include <mapnik/graphics.hpp>
|
||||
#include <mapnik/agg_renderer.hpp>
|
||||
|
@ -32,6 +34,9 @@
|
|||
#include <mapnik/marker_cache.hpp>
|
||||
#include <mapnik/expression_evaluator.hpp>
|
||||
#include <mapnik/vertex_converters.hpp>
|
||||
#include <mapnik/parse_path.hpp>
|
||||
#include <mapnik/polygon_pattern_symbolizer.hpp>
|
||||
|
||||
// agg
|
||||
#include "agg_basics.h"
|
||||
#include "agg_rendering_buffer.h"
|
||||
|
|
|
@ -22,7 +22,9 @@
|
|||
|
||||
// boost
|
||||
#include <boost/foreach.hpp>
|
||||
|
||||
// mapnik
|
||||
#include <mapnik/feature.hpp>
|
||||
#include <mapnik/agg_renderer.hpp>
|
||||
#include <mapnik/graphics.hpp>
|
||||
#include <mapnik/agg_helpers.hpp>
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
*****************************************************************************/
|
||||
|
||||
// mapnik
|
||||
#include <mapnik/feature.hpp>
|
||||
#include <mapnik/agg_renderer.hpp>
|
||||
#include <mapnik/image_scaling.hpp>
|
||||
#include <mapnik/image_compositing.hpp>
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
*****************************************************************************/
|
||||
|
||||
// mapnik
|
||||
#include <mapnik/feature.hpp>
|
||||
#include <mapnik/agg_renderer.hpp>
|
||||
#include <mapnik/text/symbolizer_helpers.hpp>
|
||||
#include <mapnik/text/renderer.hpp>
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
*****************************************************************************/
|
||||
|
||||
// mapnik
|
||||
#include <mapnik/feature.hpp>
|
||||
#include <mapnik/agg_renderer.hpp>
|
||||
#include <mapnik/text/symbolizer_helpers.hpp>
|
||||
#include <mapnik/text/renderer.hpp>
|
||||
|
|
|
@ -41,9 +41,9 @@ box2d<T>::box2d()
|
|||
:minx_(0),miny_(0),maxx_(-1),maxy_(-1) {}
|
||||
|
||||
template <typename T>
|
||||
box2d<T>::box2d(T minx_,T miny_,T maxx_,T maxy_)
|
||||
box2d<T>::box2d(T minx,T miny,T maxx,T maxy)
|
||||
{
|
||||
init(minx_,miny_,maxx_,maxy_);
|
||||
init(minx,miny,maxx,maxy);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
|
|
|
@ -150,15 +150,15 @@ class cairo_gradient : private mapnik::noncopyable
|
|||
public:
|
||||
cairo_gradient(const mapnik::gradient &grad, double opacity=1.0)
|
||||
{
|
||||
double x1,x2,y1,y2,r;
|
||||
grad.get_control_points(x1,y1,x2,y2,r);
|
||||
double x1,x2,y1,y2,rad;
|
||||
grad.get_control_points(x1,y1,x2,y2,rad);
|
||||
if (grad.get_gradient_type() == LINEAR)
|
||||
{
|
||||
pattern_ = Cairo::LinearGradient::create(x1, y1, x2, y2);
|
||||
}
|
||||
else if (grad.get_gradient_type() == RADIAL)
|
||||
{
|
||||
pattern_ = Cairo::RadialGradient::create(x1, y1, 0, x2, y2, r);
|
||||
pattern_ = Cairo::RadialGradient::create(x1, y1, 0, x2, y2, rad);
|
||||
}
|
||||
|
||||
units_ = grad.get_units();
|
||||
|
@ -284,12 +284,12 @@ public:
|
|||
|
||||
void set_color(color const &color, double opacity = 1.0)
|
||||
{
|
||||
set_color(color.red(), color.green(), color.blue(), color.alpha() * opacity / 255.0);
|
||||
set_color(color.red()/255.0, color.green()/255.0, color.blue()/255.0, color.alpha() * opacity / 255.0);
|
||||
}
|
||||
|
||||
void set_color(int r, int g, int b, double opacity = 1.0)
|
||||
void set_color(double r, double g, double b, double opacity = 1.0)
|
||||
{
|
||||
context_->set_source_rgba(r / 255.0, g / 255.0, b / 255.0, opacity);
|
||||
context_->set_source_rgba(r, g, b, opacity);
|
||||
}
|
||||
|
||||
void set_operator(composite_mode_e comp_op)
|
||||
|
@ -970,8 +970,8 @@ void cairo_renderer_base::process(building_symbolizer const& sym,
|
|||
faces->line_to(itr->get<0>(), itr->get<1>() + height);
|
||||
|
||||
path_type faces_path(t_, *faces, prj_trans);
|
||||
context.set_color(int(fill.red() * 0.8), int(fill.green() * 0.8),
|
||||
int(fill.blue() * 0.8), fill.alpha() * sym.get_opacity() / 255.0);
|
||||
context.set_color(fill.red() * 0.8 / 255.0, fill.green() * 0.8 / 255.0,
|
||||
fill.blue() * 0.8 / 255.0, fill.alpha() * sym.get_opacity() / 255.0);
|
||||
context.add_path(faces_path);
|
||||
context.fill();
|
||||
|
||||
|
@ -996,13 +996,14 @@ void cairo_renderer_base::process(building_symbolizer const& sym,
|
|||
}
|
||||
|
||||
path_type path(t_, *frame, prj_trans);
|
||||
context.set_color(fill.red()*0.8, fill.green()*0.8, fill.blue()*0.8,sym.get_opacity());
|
||||
context.set_color(fill.red() * 0.8 / 255.0, fill.green() * 0.8/255.0,
|
||||
fill.blue() * 0.8 / 255.0, fill.alpha() * sym.get_opacity() / 255.0);
|
||||
context.set_line_width(scale_factor_);
|
||||
context.add_path(path);
|
||||
context.stroke();
|
||||
|
||||
path_type roof_path(t_, *roof, prj_trans);
|
||||
context.set_color(fill, fill.alpha() * sym.get_opacity() / 255.0 );
|
||||
context.set_color(fill, sym.get_opacity());
|
||||
context.add_path(roof_path);
|
||||
context.fill();
|
||||
}
|
||||
|
@ -1142,7 +1143,8 @@ void render_vector_marker(cairo_context & context, pixel_position const& pos, ma
|
|||
else if(attr.fill_flag)
|
||||
{
|
||||
double fill_opacity = attr.fill_opacity * opacity * attr.fill_color.opacity();
|
||||
context.set_color(attr.fill_color.r,attr.fill_color.g,attr.fill_color.b, fill_opacity);
|
||||
context.set_color(attr.fill_color.r/255.0,attr.fill_color.g/255.0,
|
||||
attr.fill_color.b/255.0, fill_opacity);
|
||||
context.fill();
|
||||
}
|
||||
}
|
||||
|
@ -1163,7 +1165,8 @@ void render_vector_marker(cairo_context & context, pixel_position const& pos, ma
|
|||
else if (attr.stroke_flag)
|
||||
{
|
||||
double stroke_opacity = attr.stroke_opacity * opacity * attr.stroke_color.opacity();
|
||||
context.set_color(attr.stroke_color.r,attr.stroke_color.g,attr.stroke_color.b, stroke_opacity);
|
||||
context.set_color(attr.stroke_color.r/255.0,attr.stroke_color.g/255.0,
|
||||
attr.stroke_color.b/255.0, stroke_opacity);
|
||||
context.set_line_width(attr.stroke_width);
|
||||
context.set_line_cap(line_cap_enum(attr.line_cap));
|
||||
context.set_line_join(line_join_enum(attr.line_join));
|
||||
|
@ -1744,10 +1747,10 @@ void cairo_renderer_base::process(markers_symbolizer const& sym,
|
|||
bool result = push_explicit_style( (*stock_vector_marker)->attributes(), attributes, sym);
|
||||
agg::trans_affine marker_tr = agg::trans_affine_scaling(scale_factor_);
|
||||
evaluate_transform(marker_tr, feature, sym.get_image_transform());
|
||||
box2d<double> bbox = marker_ellipse.bounding_box();
|
||||
box2d<double> new_bbox = marker_ellipse.bounding_box();
|
||||
|
||||
dispatch_type dispatch(context, marker_ellipse, result?attributes:(*stock_vector_marker)->attributes(),
|
||||
*detector_, sym, bbox, marker_tr, scale_factor_);
|
||||
*detector_, sym, new_bbox, marker_tr, scale_factor_);
|
||||
vertex_converter<box2d<double>, dispatch_type, markers_symbolizer,
|
||||
CoordTransform, proj_transform, agg::trans_affine, conv_types>
|
||||
converter(query_extent_, dispatch, sym, t_, prj_trans, marker_tr, scale_factor_);
|
||||
|
|
|
@ -47,17 +47,17 @@ std::string color::to_string() const
|
|||
if (alpha_ == 255)
|
||||
{
|
||||
ss << "rgb("
|
||||
<< red() << ","
|
||||
<< green() << ","
|
||||
<< blue() << ")";
|
||||
<< static_cast<unsigned>(red()) << ","
|
||||
<< static_cast<unsigned>(green()) << ","
|
||||
<< static_cast<unsigned>(blue()) << ")";
|
||||
}
|
||||
else
|
||||
{
|
||||
ss << "rgba("
|
||||
<< red() << ","
|
||||
<< green() << ","
|
||||
<< blue() << ","
|
||||
<< alpha()/255.0 << ")";
|
||||
<< static_cast<unsigned>(red()) << ","
|
||||
<< static_cast<unsigned>(green()) << ","
|
||||
<< static_cast<unsigned>(blue()) << ","
|
||||
<< alpha() / 255.0 << ")";
|
||||
}
|
||||
return ss.str();
|
||||
}
|
||||
|
@ -67,17 +67,17 @@ std::string color::to_hex_string() const
|
|||
if (alpha_ == 255 )
|
||||
{
|
||||
return (boost::format("#%1$02x%2$02x%3$02x")
|
||||
% red()
|
||||
% green()
|
||||
% blue() ).str();
|
||||
% static_cast<unsigned>(red())
|
||||
% static_cast<unsigned>(green())
|
||||
% static_cast<unsigned>(blue())).str();
|
||||
}
|
||||
else
|
||||
{
|
||||
return (boost::format("#%1$02x%2$02x%3$02x%4$02x")
|
||||
% red()
|
||||
% green()
|
||||
% blue()
|
||||
% alpha()).str();
|
||||
% static_cast<unsigned>(red())
|
||||
% static_cast<unsigned>(green())
|
||||
% static_cast<unsigned>(blue())
|
||||
% static_cast<unsigned>(alpha())).str();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -101,4 +101,3 @@ void color::demultiply()
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -187,4 +187,4 @@ template struct mapnik::css_color_grammar<std::string::const_iterator>;
|
|||
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -48,4 +48,4 @@ regex_replace_node::regex_replace_node (expr_node const& a, std::string const& s
|
|||
format(f) {}
|
||||
#endif
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,6 +29,9 @@
|
|||
#include <boost/filesystem.hpp>
|
||||
#include <boost/make_shared.hpp>
|
||||
|
||||
// stl
|
||||
#include <algorithm>
|
||||
|
||||
namespace mapnik
|
||||
{
|
||||
freetype_engine::freetype_engine()
|
||||
|
@ -48,7 +51,8 @@ freetype_engine::~freetype_engine()
|
|||
bool freetype_engine::is_font_file(std::string const& file_name)
|
||||
{
|
||||
/** only accept files that will be matched by freetype2's `figurefiletype()` */
|
||||
std::string const& fn = boost::algorithm::to_lower_copy(file_name);
|
||||
std::string fn = file_name;
|
||||
std::transform(fn.begin(), fn.end(), fn.begin(), ::tolower);
|
||||
return boost::algorithm::ends_with(fn,std::string(".ttf")) ||
|
||||
boost::algorithm::ends_with(fn,std::string(".otf")) ||
|
||||
boost::algorithm::ends_with(fn,std::string(".ttc")) ||
|
||||
|
|
|
@ -22,6 +22,12 @@
|
|||
|
||||
// mapnik
|
||||
#include <mapnik/grid/grid.hpp>
|
||||
#include <mapnik/debug.hpp>
|
||||
#include <mapnik/feature.hpp>
|
||||
#include <mapnik/value.hpp>
|
||||
|
||||
// boost
|
||||
#include <boost/make_shared.hpp>
|
||||
|
||||
namespace mapnik
|
||||
{
|
||||
|
|
|
@ -26,8 +26,12 @@
|
|||
#include <mapnik/grid/grid_renderer_base.hpp>
|
||||
#include <mapnik/grid/grid.hpp>
|
||||
|
||||
|
||||
#include <mapnik/image_scaling.hpp>
|
||||
#include <mapnik/rule.hpp>
|
||||
#include <mapnik/debug.hpp>
|
||||
#include <mapnik/layer.hpp>
|
||||
#include <mapnik/label_collision_detector.hpp>
|
||||
#include <mapnik/feature_type_style.hpp>
|
||||
#include <mapnik/marker.hpp>
|
||||
#include <mapnik/marker_cache.hpp>
|
||||
|
|
|
@ -21,12 +21,15 @@
|
|||
*****************************************************************************/
|
||||
|
||||
// mapnik
|
||||
#include <mapnik/feature.hpp>
|
||||
#include <mapnik/grid/grid_rasterizer.hpp>
|
||||
#include <mapnik/grid/grid_renderer.hpp>
|
||||
#include <mapnik/grid/grid_renderer_base.hpp>
|
||||
#include <mapnik/grid/grid.hpp>
|
||||
#include <mapnik/segment.hpp>
|
||||
#include <mapnik/expression_evaluator.hpp>
|
||||
#include <mapnik/building_symbolizer.hpp>
|
||||
#include <mapnik/expression.hpp>
|
||||
|
||||
// boost
|
||||
#include <boost/scoped_ptr.hpp>
|
||||
|
@ -66,7 +69,7 @@ void grid_renderer<T>::process(building_symbolizer const& sym,
|
|||
expression_ptr height_expr = sym.height();
|
||||
if (height_expr)
|
||||
{
|
||||
value_type result = boost::apply_visitor(evaluate<Feature,value_type>(feature), *height_expr);
|
||||
value_type result = boost::apply_visitor(evaluate<feature_impl,value_type>(feature), *height_expr);
|
||||
height = result.to_double() * scale_factor_;
|
||||
}
|
||||
|
||||
|
@ -123,7 +126,7 @@ void grid_renderer<T>::process(building_symbolizer const& sym,
|
|||
for (unsigned j=0;j<geom.size();++j)
|
||||
{
|
||||
double x,y;
|
||||
unsigned cm = geom.vertex(&x,&y);
|
||||
cm = geom.vertex(&x,&y);
|
||||
if (cm == SEG_MOVETO)
|
||||
{
|
||||
frame->move_to(x,y+height);
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
*****************************************************************************/
|
||||
|
||||
// mapnik
|
||||
#include <mapnik/feature.hpp>
|
||||
#include <mapnik/grid/grid_rasterizer.hpp>
|
||||
#include <mapnik/grid/grid_renderer.hpp>
|
||||
#include <mapnik/grid/grid_renderer_base.hpp>
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
*****************************************************************************/
|
||||
|
||||
// mapnik
|
||||
#include <mapnik/feature.hpp>
|
||||
#include <mapnik/grid/grid_rasterizer.hpp>
|
||||
#include <mapnik/grid/grid_renderer.hpp>
|
||||
#include <mapnik/grid/grid_renderer_base.hpp>
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue