Merge branch 'master' into harfbuzz

This commit is contained in:
Hermann Kraus 2013-03-23 14:39:04 +01:00
commit 9834fb73ed
27 changed files with 193 additions and 112 deletions

View file

@ -128,7 +128,7 @@ Released Aug 23, 2012
- Improved logging/debugging system with release logs and file redirection (https://github.com/mapnik/mapnik/wiki/Runtime-Logging) (#937 and partially #986, #467)
- GDAL: allow setting nodata value on the fly (will override value if nodata is set in data) (#1161)
- GDAL: respect nodata for paletted/colormapped images (#1160)
- PostGIS: Added a new option called `autodetect_key_field` (by default false) that if true will
@ -184,7 +184,7 @@ Released Aug 3, 2012
- Fixed possible breakage registering plugins via python if a custom PREFIX or DESTDIR was used (e.g. macports/homebrew) (#1171)
- Fixed memory leak in the case of proj >= 4.8 and a projection initialization error (#1173)
- Fixed memory leak in the case of proj >= 4.8 and a projection initialization error (#1173)
## Mapnik 2.0.1

View file

@ -22,11 +22,15 @@
// boost
#include <boost/python.hpp>
#include <boost/foreach.hpp>
// mapnik
#include <mapnik/query.hpp>
#include <mapnik/box2d.hpp>
#include <string>
#include <set>
using mapnik::query;
using mapnik::box2d;
@ -46,11 +50,30 @@ struct resolution_to_tuple
}
};
struct names_to_list
{
static PyObject* convert(std::set<std::string> const& names)
{
boost::python::list l;
BOOST_FOREACH( std::string const& name, names )
{
l.append(name);
}
return python::incref(l.ptr());
}
static PyTypeObject const* get_pytype()
{
return &PyList_Type;
}
};
void export_query()
{
using namespace boost::python;
to_python_converter<query::resolution_type, resolution_to_tuple> ();
to_python_converter<std::set<std::string>, names_to_list> ();
class_<query>("Query", "a spatial query data object",
init<box2d<double>,query::resolution_type const&,double>() )

View file

@ -85,7 +85,11 @@ namespace agg
{
if(x < m_start) return 0.0;
if(x > m_end) return 1.0;
return (x - m_start) / (m_end - m_start);
double delta = m_end - m_start;
// avoid nan from potential zero division
// https://github.com/mapnik/mapnik/issues/761
if (delta <= 0.0) return 0.0;
return (x - m_start) / delta;
}
private:

View file

@ -155,6 +155,8 @@ private:
boost::shared_ptr<label_collision_detector4> detector_;
boost::scoped_ptr<rasterizer> ras_ptr;
box2d<double> query_extent_;
gamma_method_e gamma_method_;
double gamma_;
void setup(Map const& m);
};
}

View file

@ -118,9 +118,9 @@ public:
private:
inline bool checkBounds(unsigned x, unsigned y) const
inline bool checkBounds(int x, int y) const
{
return (x < width_ && y < height_);
return (x >= 0 && x < width_ && y >= 0 && y < height_);
}
public:

View file

@ -531,12 +531,12 @@ struct mod: public boost::static_visitor<V>
value_type operator() (value_double lhs, value_integer rhs) const
{
return std::fmod(lhs, rhs);
return std::fmod(lhs, static_cast<value_double>(rhs));
}
value_type operator() (value_integer lhs, value_double rhs) const
{
return std::fmod(lhs, rhs);
return std::fmod(static_cast<value_double>(lhs), rhs);
}
value_type operator() (value_double lhs, value_double rhs) const

View file

@ -79,7 +79,10 @@ agg_renderer<T>::agg_renderer(Map const& m, T & pixmap, double scale_factor, uns
font_engine_(),
font_manager_(font_engine_),
detector_(boost::make_shared<label_collision_detector4>(box2d<double>(-m.buffer_size(), -m.buffer_size(), m.width() + m.buffer_size() ,m.height() + m.buffer_size()))),
ras_ptr(new rasterizer)
ras_ptr(new rasterizer),
query_extent_(),
gamma_method_(GAMMA_POWER),
gamma_(1.0)
{
setup(m);
}
@ -98,7 +101,10 @@ agg_renderer<T>::agg_renderer(Map const& m, request const& req, T & pixmap, doub
font_engine_(),
font_manager_(font_engine_),
detector_(boost::make_shared<label_collision_detector4>(box2d<double>(-req.buffer_size(), -req.buffer_size(), req.width() + req.buffer_size() ,req.height() + req.buffer_size()))),
ras_ptr(new rasterizer)
ras_ptr(new rasterizer),
query_extent_(),
gamma_method_(GAMMA_POWER),
gamma_(1.0)
{
setup(m);
}
@ -118,7 +124,10 @@ agg_renderer<T>::agg_renderer(Map const& m, T & pixmap, boost::shared_ptr<label_
font_engine_(),
font_manager_(font_engine_),
detector_(detector),
ras_ptr(new rasterizer)
ras_ptr(new rasterizer),
query_extent_(),
gamma_method_(GAMMA_POWER),
gamma_(1.0)
{
setup(m);
}
@ -297,7 +306,12 @@ void agg_renderer<T>::render_marker(pixel_position const& pos,
typedef agg::pod_bvector<mapnik::svg::path_attributes> svg_attribute_type;
ras_ptr->reset();
ras_ptr->gamma(agg::gamma_power());
if (gamma_method_ != GAMMA_POWER || gamma_ != 1.0)
{
ras_ptr->gamma(agg::gamma_power());
gamma_method_ = GAMMA_POWER;
gamma_ = 1.0;
}
agg::scanline_u8 sl;
agg::rendering_buffer buf(current_buffer_->raw_data(), width_, height_, width_ * 4);
pixfmt_comp_type pixf(buf);

View file

@ -70,7 +70,12 @@ void agg_renderer<T>::process(building_symbolizer const& sym,
agg::scanline_u8 sl;
ras_ptr->reset();
ras_ptr->gamma(agg::gamma_power());
if (gamma_method_ != GAMMA_POWER || gamma_ != 1.0)
{
ras_ptr->gamma(agg::gamma_power());
gamma_method_ = GAMMA_POWER;
gamma_ = 1.0;
}
double height = 0.0;
expression_ptr height_expr = sym.height();

View file

@ -30,17 +30,17 @@ namespace mapnik {
void draw_rect(image_32 &pixmap, box2d<double> const& box)
{
double x0 = box.minx();
double x1 = box.maxx();
double y0 = box.miny();
double y1 = box.maxy();
int x0 = static_cast<int>(box.minx());
int x1 = static_cast<int>(box.maxx());
int y0 = static_cast<int>(box.miny());
int y1 = static_cast<int>(box.maxy());
unsigned color1 = 0xff0000ff;
for (double x=x0; x<x1; x++)
for (int x=x0; x<x1; x++)
{
pixmap.setPixel(x, y0, color1);
pixmap.setPixel(x, y1, color1);
}
for (double y=y0; y<y1; y++)
for (int y=y0; y<y1; y++)
{
pixmap.setPixel(x0, y, color1);
pixmap.setPixel(x1, y, color1);

View file

@ -66,7 +66,12 @@ void agg_renderer<T>::process(line_symbolizer const& sym,
unsigned a=col.alpha();
ras_ptr->reset();
set_gamma_method(stroke_, ras_ptr);
if (stroke_.get_gamma() != gamma_ || stroke_.get_gamma_method() != gamma_method_)
{
set_gamma_method(stroke_, ras_ptr);
gamma_method_ = stroke_.get_gamma_method();
gamma_ = stroke_.get_gamma();
}
agg::rendering_buffer buf(current_buffer_->raw_data(),width_,height_, width_ * 4);

View file

@ -83,7 +83,12 @@ void agg_renderer<T>::process(markers_symbolizer const& sym,
if (mark && *mark)
{
ras_ptr->reset();
ras_ptr->gamma(agg::gamma_power());
if (gamma_method_ != GAMMA_POWER || gamma_ != 1.0)
{
ras_ptr->gamma(agg::gamma_power());
gamma_method_ = GAMMA_POWER;
gamma_ = 1.0;
}
agg::trans_affine geom_tr;
evaluate_transform(geom_tr, feature, sym.get_transform());
agg::trans_affine tr = agg::trans_affine_scaling(scale_factor_);

View file

@ -61,8 +61,12 @@ void agg_renderer<T>::process(polygon_pattern_symbolizer const& sym,
agg::rendering_buffer buf(current_buffer_->raw_data(), width_, height_, width_ * 4);
ras_ptr->reset();
set_gamma_method(sym,ras_ptr);
if (sym.get_gamma() != gamma_ || sym.get_gamma_method() != gamma_method_)
{
set_gamma_method(sym, ras_ptr);
gamma_method_ = sym.get_gamma_method();
gamma_ = sym.get_gamma();
}
std::string filename = path_processor_type::evaluate( *sym.get_filename(), feature);
boost::optional<mapnik::marker_ptr> marker;
if ( !filename.empty() )

View file

@ -48,8 +48,12 @@ void agg_renderer<T>::process(polygon_symbolizer const& sym,
{
ras_ptr->reset();
set_gamma_method(sym,ras_ptr);
if (sym.get_gamma() != gamma_ || sym.get_gamma_method() != gamma_method_)
{
set_gamma_method(sym, ras_ptr);
gamma_method_ = sym.get_gamma_method();
gamma_ = sym.get_gamma();
}
agg::trans_affine tr;
evaluate_transform(tr, feature, sym.get_transform());

View file

@ -37,9 +37,9 @@ color blend(color const& source, color const& dest, unsigned cover=255)
buffer[2] = dest_pre.b;
buffer[3] = dest_pre.a;
// http://www.antigrain.com/doc/basic_renderers/basic_renderers.agdoc.html
agg::rendering_buffer rbuf(buffer,
size,
size,
agg::rendering_buffer rbuf(buffer,
size,
size,
size * stride);
color::value_type* psource = (color::value_type*)rbuf.row_ptr(0,0,1);
blender::blend_pix(psource,source_pre.r,source_pre.g,source_pre.b,source_pre.a,cover);
@ -78,7 +78,7 @@ color normal_blend(color const& source, color const& dest, unsigned cover=255)
dest_buffer[3] = dest_pre.a;
agg::rendering_buffer dest_rbuffer(dest_buffer,size,size,size * 4);
agg::pixfmt_rgba32_pre pixf_dest(dest_rbuffer);
// renderer: blends source into destination
renderer_type ren(pixf_dest);
ren.blend_from(pixf_source,0,0,0,cover);
@ -110,8 +110,8 @@ template<class ColorT, class Order> struct comp_op_rgba_src_over2
// Dca' = Sca + Dca.(1 - Sa)
// Da' = Sa + Da - Sa.Da
static void blend_pix(value_type* p,
unsigned sr, unsigned sg, unsigned sb,
unsigned sa, unsigned cover)
unsigned sr, unsigned sg, unsigned sb,
unsigned sa, unsigned cover)
{
if(cover < 255)
{
@ -134,14 +134,14 @@ int main( int, char*[] )
{
typedef agg::comp_op_rgba_src_over2<color, agg::order_rgba> source_over_old_agg;
typedef agg::comp_op_rgba_src_over<color, agg::order_rgba> source_over;
color white(255,255,255,255);
color black(0,0,0,255);
BOOST_TEST_EQ( to_string(blend<source_over>(white,white)), to_string(white) );
BOOST_TEST_EQ( to_string(blend<source_over>(white,black)), to_string(white) );
BOOST_TEST_EQ( to_string(blend<source_over>(black,white)), to_string(black) );
// https://github.com/mapnik/mapnik/issues/1452#issuecomment-8154646
color near_white(254,254,254,254); // Source
color near_trans(1,1,1,1); // Dest
@ -153,26 +153,26 @@ int main( int, char*[] )
// using normal_blend as expected, compare a variety of other colors
{
color source(128,128,128,255);
color dest(128,128,128,255);
unsigned cover = 128;
std::string expected_str = to_string(normal_blend(source,dest,cover));
BOOST_TEST_EQ( to_string(blend<source_over>(source,dest,cover)), expected_str );
BOOST_TEST_EQ( to_string(blend<source_over_old_agg>(source,dest,cover)), expected_str );
color source(128,128,128,255);
color dest(128,128,128,255);
unsigned cover = 128;
std::string expected_str = to_string(normal_blend(source,dest,cover));
BOOST_TEST_EQ( to_string(blend<source_over>(source,dest,cover)), expected_str );
BOOST_TEST_EQ( to_string(blend<source_over_old_agg>(source,dest,cover)), expected_str );
}
{
color source(128,128,128,255);
color dest(128,128,128,255);
unsigned cover = 245;
std::string expected_str = to_string(normal_blend(source,dest,cover));
BOOST_TEST_EQ( to_string(blend<source_over>(source,dest,cover)), expected_str );
BOOST_TEST_EQ( to_string(blend<source_over_old_agg>(source,dest,cover)), expected_str );
color source(128,128,128,255);
color dest(128,128,128,255);
unsigned cover = 245;
std::string expected_str = to_string(normal_blend(source,dest,cover));
BOOST_TEST_EQ( to_string(blend<source_over>(source,dest,cover)), expected_str );
BOOST_TEST_EQ( to_string(blend<source_over_old_agg>(source,dest,cover)), expected_str );
}
// commenting until I study these failures more (dane)
/*
{
{
// fails, why?
color source(127,127,127,127);
color dest(127,127,127,127);
@ -180,9 +180,9 @@ int main( int, char*[] )
std::string expected_str = to_string(normal_blend(source,dest,cover));
BOOST_TEST_EQ( to_string(blend<source_over>(source,dest,cover)), expected_str );
BOOST_TEST_EQ( to_string(blend<source_over_old_agg>(source,dest,cover)), expected_str );
}
}
{
{
// fails, why?
color source(128,128,128,128);
color dest(128,128,128,128);
@ -190,9 +190,9 @@ int main( int, char*[] )
std::string expected_str = to_string(normal_blend(source,dest,cover));
BOOST_TEST_EQ( to_string(blend<source_over>(source,dest,cover)), expected_str );
BOOST_TEST_EQ( to_string(blend<source_over_old_agg>(source,dest,cover)), expected_str );
}
}
*/
if (!::boost::detail::test_errors()) {
std::clog << "C++ AGG blending: \x1b[1;32m✓ \x1b[0m\n";
#if BOOST_VERSION >= 104600

View file

@ -83,7 +83,7 @@ int main( int, char*[] )
std::ifstream stream(filename.c_str(),std::ios_base::in | std::ios_base::binary);
if (!stream.is_open())
throw std::runtime_error("could not open: '" + filename + "'");
std::string csv_line;
while(std::getline(stream,csv_line,'\n'))
{

View file

@ -11,60 +11,60 @@ int main( int, char*[] )
try
{
std::string out;
// Test double
to_string(out, double(0));
BOOST_TEST_EQ( out, "0" );
out.clear();
to_string(out, double(1));
BOOST_TEST_EQ( out, "1" );
out.clear();
to_string(out, double(-1));
BOOST_TEST_EQ( out, "-1" );
out.clear();
to_string(out, double(0.1));
BOOST_TEST_EQ( out, "0.1" );
out.clear();
to_string(out, double(-0.1));
BOOST_TEST_EQ( out, "-0.1" );
out.clear();
to_string(out, double(0.123));
BOOST_TEST_EQ( out, "0.123" );
out.clear();
to_string(out, double(-0.123));
BOOST_TEST_EQ( out, "-0.123" );
out.clear();
to_string(out, double(1e-06));
BOOST_TEST_EQ( out, "1e-06" );
out.clear();
to_string(out, double(-1e-06));
BOOST_TEST_EQ( out, "-1e-06" );
out.clear();
to_string(out, double(1e-05));
BOOST_TEST_EQ( out, "1e-05" );
out.clear();
to_string(out, double(-1e-05));
BOOST_TEST_EQ( out, "-1e-05" );
out.clear();
to_string(out, double(0.0001));
BOOST_TEST_EQ( out, "0.0001" );
out.clear();
to_string(out, double(-0.0001));
BOOST_TEST_EQ( out, "-0.0001" );
out.clear();
to_string(out, double(0.0001));
BOOST_TEST_EQ( out, "0.0001" );
out.clear();
@ -177,15 +177,15 @@ int main( int, char*[] )
to_string(out, double(-1000000000000000));
BOOST_TEST_EQ( out, "-1e+15" );
out.clear();
to_string(out, double(100000000000000.1));
BOOST_TEST_EQ( out, "1e+14" );
out.clear();
to_string(out, double(1.00001));
BOOST_TEST_EQ( out, "1.00001" );
out.clear();
to_string(out, double(1234000000000000));
BOOST_TEST_EQ( out, "1.234e+15" );
out.clear();
@ -193,7 +193,7 @@ int main( int, char*[] )
to_string(out, double(1e+16));
BOOST_TEST_EQ( out, "1e+16" );
out.clear();
to_string(out, double(1.234e+16));
BOOST_TEST_EQ( out, "1.234e+16" );
out.clear();

View file

@ -4,4 +4,4 @@
50,50,150,150;0 0 1,200 200 2;50 50 1,150 150 2
50,50,150,150;50 50 1,150 50 2,150 150 2,50 150 2,50 50 2;50 50 1,150 50 2,150 150 2,50 150 2,50 50 2
# TODO - should the close path be kept after clipping?
50,50,150,150;50 50 1,150 50 2,150 150 2,50 150 2,50 50 2,0 0 79;50 50 1,150 50 2,150 150 2,50 150 2,50 50 2
# 50,50,150,150;50 50 1,150 50 2,150 150 2,50 150 2,50 50 2,0 0 79;50 50 1,150 50 2,150 150 2,50 150 2,50 50 2

View file

@ -86,19 +86,19 @@ int main( int, char*[] )
/*
// not working, oddly segfaults valgrind
try {
sqlite3_initialize();
// http://stackoverflow.com/questions/11107703/sqlite3-sigsegvs-with-valgrind
sqlite3_config(SQLITE_CONFIG_HEAP, malloc (1024*1024), 1024*1024, 64);
mapnik::datasource_cache::instance().register_datasource("./plugins/input/sqlite.input");
mapnik::parameters p;
p["type"]="sqlite";
p["file"]="tests/data/sqlite/world.sqlite";
p["table"]="world_merc";
mapnik::datasource_cache::instance().create(p);
sqlite3_shutdown();
BOOST_TEST(true);
sqlite3_initialize();
// http://stackoverflow.com/questions/11107703/sqlite3-sigsegvs-with-valgrind
sqlite3_config(SQLITE_CONFIG_HEAP, malloc (1024*1024), 1024*1024, 64);
mapnik::datasource_cache::instance().register_datasource("./plugins/input/sqlite.input");
mapnik::parameters p;
p["type"]="sqlite";
p["file"]="tests/data/sqlite/world.sqlite";
p["table"]="world_merc";
mapnik::datasource_cache::instance().create(p);
sqlite3_shutdown();
BOOST_TEST(true);
} catch (...) {
BOOST_TEST(false);
BOOST_TEST(false);
}
*/

View file

@ -52,7 +52,7 @@ int main( int, char*[] )
the_style.add_rule(the_rule);
m.insert_style("style",the_style );
m.zoom_to_box(mapnik::box2d<double>(-256,-256,
256,256));
256,256));
mapnik::image_32 buf(m.width(),m.height());
mapnik::agg_renderer<mapnik::image_32> ren(m,buf);
try {

View file

@ -57,7 +57,7 @@ boost::optional<std::string> linestring_bbox_clipping(mapnik::box2d<double> bbox
typedef boost::mpl::vector<clip_line_tag> conv_types;
vertex_converter<box2d<double>, output_geometry_backend, line_symbolizer,
CoordTransform, proj_transform, agg::trans_affine, conv_types>
CoordTransform, proj_transform, agg::trans_affine, conv_types>
converter(bbox, backend, sym, t, prj_trans, tr, 1.0);
converter.set<clip_line_tag>();
@ -97,7 +97,7 @@ boost::optional<std::string> polygon_bbox_clipping(mapnik::box2d<double> bbox,
typedef boost::mpl::vector<clip_poly_tag> conv_types;
vertex_converter<box2d<double>, output_geometry_backend, polygon_symbolizer,
CoordTransform, proj_transform, agg::trans_affine, conv_types>
CoordTransform, proj_transform, agg::trans_affine, conv_types>
converter(bbox, backend, sym, t, prj_trans, tr, 1.0);
converter.set<clip_poly_tag>();
@ -154,14 +154,13 @@ int main( int, char*[] )
BOOST_TEST(result);
BOOST_TEST_EQ(*result, std::string("GeometryCollection EMPTY"));
}
#endif
{
std::string wkt_in("Polygon((0 0,100 200,200 0,0 0 ))");
boost::optional<std::string> result = polygon_bbox_clipping(mapnik::box2d<double>(50,50,150,150),wkt_in);
BOOST_TEST(result);
BOOST_TEST_EQ(*result,std::string("Polygon((50 50,50 100,75 150,125 150,150 100,150 50,50 50))"));
}
#endif
if (!::boost::detail::test_errors())
{
std::clog << "C++ geometry conversions: \x1b[1;32m✓ \x1b[0m\n";

View file

@ -16,7 +16,7 @@ int main( int, char*[] )
BOOST_TEST( mapnik::label::centroid(pt, x, y) );
BOOST_TEST( x == 10 );
BOOST_TEST( y == 10 );
// two points
pt.move_to(20,20);
BOOST_TEST( mapnik::label::centroid(pt, x, y) );
@ -30,7 +30,7 @@ int main( int, char*[] )
BOOST_TEST( mapnik::label::centroid(line, x, y) );
BOOST_TEST( x == 25 );
BOOST_TEST( y == 25 );
// TODO - centroid and interior should be equal but they appear not to be (check largest)
// MULTIPOLYGON(((-52 40,-60 32,-68 40,-60 48,-52 40)),((-60 50,-80 30,-100 49.9999999999999,-80.0000000000001 70,-60 50)),((-52 60,-60 52,-68 60,-60 68,-52 60)))

View file

@ -50,7 +50,7 @@ bool compare_images(std::string const& src_fn,std::string const& dest_fn)
const unsigned int* row_to = dest.getRow(y);
for (unsigned int x = 0; x < width; ++x)
{
if (row_from[x] != row_to[x]) return false;
if (row_from[x] != row_to[x]) return false;
}
}
return true;
@ -76,7 +76,7 @@ int main( int, char*[] )
//mapnik::save_to_file(im,expected);
mapnik::save_to_file(im,actual1);
BOOST_TEST(compare_images(actual1,expected));
// reset image
im.clear();
@ -93,7 +93,7 @@ int main( int, char*[] )
// reset image
im.clear();
// render with apply_to_layer api and mapnik::request params passed to apply_to_layer
mapnik::agg_renderer<mapnik::image_32> renderer3(m,req,im,scale_factor);
renderer3.start_map_processing(m);
@ -106,15 +106,15 @@ int main( int, char*[] )
{
std::set<std::string> names;
renderer3.apply_to_layer(lyr,
renderer3,
map_proj,
req.scale(),
scale_denom,
req.width(),
req.height(),
req.extent(),
req.buffer_size(),
names);
renderer3,
map_proj,
req.scale(),
scale_denom,
req.width(),
req.height(),
req.extent(),
req.buffer_size(),
names);
}
}

View file

@ -46,8 +46,7 @@ def test_mapnik_config_valid_opts():
'--includes',
'--dep-includes',
'--cxxflags',
'--cflags',
'--all-flags'
'--cflags'
]
for item in valid_args:
cmd = 'mapnik-config ' + item

View file

@ -17,6 +17,10 @@ def test_query_init():
r = query.resolution
assert_almost_equal(r[0], 1.0, places=7)
assert_almost_equal(r[1], 1.0, places=7)
# https://github.com/mapnik/mapnik/issues/1762
eq_(query.property_names,[])
query.add_property_name('migurski')
eq_(query.property_names,['migurski'])
# Converting *from* tuples *to* resolutions is not yet supported
@raises(TypeError)

View file

@ -17,15 +17,16 @@ config_variables = '''#!/bin/sh
## variables
CONFIG_PREFIX="$( cd "$( dirname $( dirname "$0" ))" && pwd )"
CONFIG_MAPNIK_VERSION='%(version)s'
CONFIG_GIT_REVISION='%(git_revision)s'
CONFIG_GIT_DESCRIBE='%(git_describe)s'
CONFIG_FONTS='%(fonts)s'
CONFIG_INPUT_PLUGINS='%(input_plugins)s'
CONFIG_FONTS="%(fonts)s"
CONFIG_INPUT_PLUGINS="%(input_plugins)s"
CONFIG_MAPNIK_DEFINES='%(defines)s'
CONFIG_PREFIX="$( cd "$( dirname $( dirname "$0" ))" && pwd )"
CONFIG_MAPNIK_LIBNAME='%(mapnik_libname)s'
CONFIG_MAPNIK_LIB="${CONFIG_PREFIX}/%(libdir_schema)s"
CONFIG_MAPNIK_LIBPATH="%(mapnik_libpath)s"
CONFIG_DEP_LIBS='%(dep_libs)s'
CONFIG_MAPNIK_LDFLAGS='%(ldflags)s'
CONFIG_MAPNIK_INCLUDE="${CONFIG_PREFIX}/include -I${CONFIG_PREFIX}/include/mapnik/agg"
@ -82,17 +83,29 @@ else:
if not stderr:
git_describe = stdin.strip()
# for fonts and input plugins we should try
# to store the relative path, if feasible
fontspath = config_env['MAPNIK_FONTS']
lib_root = os.path.join(config_env['INSTALL_PREFIX'], config_env['LIBDIR_SCHEMA'])
if lib_root in fontspath:
fontspath = "${CONFIG_PREFIX}/" + os.path.relpath(fontspath,config_env['INSTALL_PREFIX'])
inputpluginspath = config_env['MAPNIK_INPUT_PLUGINS']
if lib_root in inputpluginspath:
inputpluginspath = "${CONFIG_PREFIX}/" + os.path.relpath(inputpluginspath,config_env['INSTALL_PREFIX'])
lib_path = "${CONFIG_PREFIX}/" + config_env['LIBDIR_SCHEMA']
configuration = {
"git_revision": git_revision,
"git_describe": git_describe,
"version": config_env['MAPNIK_VERSION_STRING'],
"mapnik_libname": 'mapnik',
"libdir_schema": config_env['LIBDIR_SCHEMA'],
"mapnik_libpath": lib_path,
"ldflags": ldflags,
"dep_libs": dep_libs,
"dep_includes": dep_includes,
"fonts": config_env['MAPNIK_FONTS'],
"input_plugins": config_env['MAPNIK_INPUT_PLUGINS'],
"fonts": fontspath,
"input_plugins": inputpluginspath,
"defines":defines,
"cxxflags":cxxflags
}

View file

@ -86,7 +86,7 @@ while test $# -gt 0; do
;;
--libs)
echo -L${CONFIG_MAPNIK_LIB} -l${CONFIG_MAPNIK_LIBNAME}
echo -L${CONFIG_MAPNIK_LIBPATH} -l${CONFIG_MAPNIK_LIBNAME}
;;
--dep-libs)

View file

@ -174,7 +174,7 @@ int main (int argc,char** argv)
agg::pod_bvector<mapnik::svg::path_attributes>,
renderer_solid,
agg::pixfmt_rgba32_pre > svg_renderer_this(svg_path,
(*marker.get_vector_data())->attributes());
(*marker.get_vector_data())->attributes());
svg_renderer_this.render(ras_ptr, sl, renb, mtx, opacity, bbox);