2006-03-31 12:32:02 +02:00
|
|
|
/*****************************************************************************
|
2011-11-14 04:54:32 +01:00
|
|
|
*
|
2006-03-31 12:32:02 +02:00
|
|
|
* This file is part of Mapnik (c++ mapping toolkit)
|
2006-02-01 00:09:52 +01:00
|
|
|
*
|
2014-11-20 15:25:50 +01:00
|
|
|
* Copyright (C) 2014 Artem Pavlenko, Jean-Francois Doyon
|
2006-02-01 00:09:52 +01:00
|
|
|
*
|
2006-03-31 12:32:02 +02:00
|
|
|
* 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,
|
2006-02-01 00:09:52 +01:00
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
2006-03-31 12:32:02 +02:00
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
2006-02-01 00:09:52 +01:00
|
|
|
*
|
2006-03-31 12:32:02 +02:00
|
|
|
* 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
|
|
|
|
*
|
|
|
|
*****************************************************************************/
|
2006-02-01 00:09:52 +01:00
|
|
|
|
2014-08-12 14:40:45 +02:00
|
|
|
#include <mapnik/config.hpp>
|
2014-08-12 19:44:11 +02:00
|
|
|
|
2014-10-22 01:37:27 +02:00
|
|
|
// boost
|
2013-10-24 00:42:01 +02:00
|
|
|
#include "boost_std_shared_shim.hpp"
|
2014-10-22 01:37:27 +02:00
|
|
|
#pragma GCC diagnostic push
|
|
|
|
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
|
|
|
#pragma GCC diagnostic ignored "-Wunused-local-typedef"
|
|
|
|
#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
|
2014-05-11 22:08:24 +02:00
|
|
|
#include "python_to_value.hpp"
|
2013-11-06 00:11:23 +01:00
|
|
|
#include <boost/python/args.hpp> // for keywords, arg, etc
|
|
|
|
#include <boost/python/converter/from_python.hpp>
|
|
|
|
#include <boost/python/def.hpp> // for def
|
|
|
|
#include <boost/python/detail/defaults_gen.hpp>
|
|
|
|
#include <boost/python/detail/none.hpp> // for none
|
|
|
|
#include <boost/python/dict.hpp> // for dict
|
2007-09-25 20:47:12 +02:00
|
|
|
#include <boost/python/exception_translator.hpp>
|
2013-11-06 00:11:23 +01:00
|
|
|
#include <boost/python/list.hpp> // for list
|
|
|
|
#include <boost/python/module.hpp> // for BOOST_PYTHON_MODULE
|
|
|
|
#include <boost/python/object_core.hpp> // for get_managed_object
|
|
|
|
#include <boost/python/register_ptr_to_python.hpp>
|
|
|
|
#include <boost/python/to_python_converter.hpp>
|
2014-10-22 01:37:27 +02:00
|
|
|
#pragma GCC diagnostic pop
|
2006-02-01 00:09:52 +01:00
|
|
|
|
2013-06-03 05:19:33 +02:00
|
|
|
// stl
|
|
|
|
#include <stdexcept>
|
2014-08-22 01:15:35 +02:00
|
|
|
#include <fstream>
|
2013-06-03 05:19:33 +02:00
|
|
|
|
2006-02-01 00:09:52 +01:00
|
|
|
void export_color();
|
2006-10-16 15:44:52 +02:00
|
|
|
void export_coord();
|
2006-02-01 00:09:52 +01:00
|
|
|
void export_layer();
|
|
|
|
void export_parameters();
|
|
|
|
void export_envelope();
|
2006-09-11 11:48:27 +02:00
|
|
|
void export_query();
|
2009-01-13 01:56:09 +01:00
|
|
|
void export_geometry();
|
2011-08-31 04:28:38 +02:00
|
|
|
void export_palette();
|
2006-02-01 00:09:52 +01:00
|
|
|
void export_image();
|
1. hit_test implementation for geometry objects:
bool hit_test(double x, double y, double tol);
2. added image_view(unsigned x, unsigned y, unsigned width, unsigned height)
allowing to select region from image data e.g (in Python):
im = Image(2048,2048)
view = im.view(0,0,256,256)
save_to_file(filename,type, view)
3. changed envelope method to return vy value in datasource classes
4. features_at_point impl for shape and postgis plug-ins
2006-11-25 12:02:59 +01:00
|
|
|
void export_image_view();
|
2012-01-19 18:45:24 +01:00
|
|
|
void export_gamma_method();
|
2012-07-07 01:45:58 +02:00
|
|
|
void export_scaling_method();
|
2013-07-24 01:37:25 +02:00
|
|
|
#if defined(GRID_RENDERER)
|
2011-06-04 02:28:00 +02:00
|
|
|
void export_grid();
|
|
|
|
void export_grid_view();
|
2013-07-24 01:37:25 +02:00
|
|
|
#endif
|
2006-02-01 00:09:52 +01:00
|
|
|
void export_map();
|
|
|
|
void export_python();
|
2009-12-16 21:02:06 +01:00
|
|
|
void export_expression();
|
2006-02-01 00:09:52 +01:00
|
|
|
void export_rule();
|
|
|
|
void export_style();
|
2006-12-06 21:26:59 +01:00
|
|
|
void export_feature();
|
|
|
|
void export_featureset();
|
2011-12-20 21:34:27 +01:00
|
|
|
void export_fontset();
|
2006-10-16 15:44:52 +02:00
|
|
|
void export_datasource();
|
2006-02-01 00:09:52 +01:00
|
|
|
void export_datasource_cache();
|
2009-10-19 16:22:11 +02:00
|
|
|
void export_symbolizer();
|
2010-06-06 14:10:28 +02:00
|
|
|
void export_markers_symbolizer();
|
2006-02-25 12:03:30 +01:00
|
|
|
void export_point_symbolizer();
|
|
|
|
void export_line_symbolizer();
|
|
|
|
void export_line_pattern_symbolizer();
|
|
|
|
void export_polygon_symbolizer();
|
2012-08-21 03:17:00 +02:00
|
|
|
void export_building_symbolizer();
|
2006-02-25 12:03:30 +01:00
|
|
|
void export_polygon_pattern_symbolizer();
|
|
|
|
void export_raster_symbolizer();
|
2012-01-30 03:32:25 +01:00
|
|
|
void export_text_placement();
|
2007-07-02 15:39:08 +02:00
|
|
|
void export_shield_symbolizer();
|
2013-05-22 04:21:35 +02:00
|
|
|
void export_debug_symbolizer();
|
2014-01-14 21:15:09 +01:00
|
|
|
void export_group_symbolizer();
|
2006-03-19 22:55:59 +01:00
|
|
|
void export_font_engine();
|
2006-10-16 15:44:52 +02:00
|
|
|
void export_projection();
|
2009-01-13 16:49:26 +01:00
|
|
|
void export_proj_transform();
|
2009-03-29 12:26:44 +02:00
|
|
|
void export_view_transform();
|
2010-03-12 14:34:13 +01:00
|
|
|
void export_raster_colorizer();
|
2011-10-12 02:05:35 +02:00
|
|
|
void export_label_collision_detector();
|
2012-04-09 03:00:51 +02:00
|
|
|
void export_logger();
|
2006-02-01 00:09:52 +01:00
|
|
|
|
2009-02-12 17:44:04 +01:00
|
|
|
#include <mapnik/version.hpp>
|
2006-10-04 13:22:18 +02:00
|
|
|
#include <mapnik/map.hpp>
|
2014-07-23 08:58:27 +02:00
|
|
|
#include <mapnik/datasource.hpp>
|
2014-07-23 08:11:12 +02:00
|
|
|
#include <mapnik/layer.hpp>
|
2006-10-04 13:22:18 +02:00
|
|
|
#include <mapnik/agg_renderer.hpp>
|
|
|
|
#include <mapnik/graphics.hpp>
|
2013-01-04 03:06:07 +01:00
|
|
|
#include <mapnik/rule.hpp>
|
2007-12-06 13:14:29 +01:00
|
|
|
#include <mapnik/image_util.hpp>
|
2015-01-20 17:48:33 +01:00
|
|
|
#include <mapnik/image_data_any.hpp>
|
2006-10-04 13:22:18 +02:00
|
|
|
#include <mapnik/load_map.hpp>
|
2010-11-15 04:30:23 +01:00
|
|
|
#include <mapnik/value_error.hpp>
|
2006-10-04 13:22:18 +02:00
|
|
|
#include <mapnik/save_map.hpp>
|
2012-01-20 22:43:05 +01:00
|
|
|
#include <mapnik/scale_denominator.hpp>
|
2013-07-24 01:37:25 +02:00
|
|
|
#if defined(GRID_RENDERER)
|
2011-06-04 02:28:00 +02:00
|
|
|
#include "python_grid_utils.hpp"
|
2013-07-24 01:37:25 +02:00
|
|
|
#endif
|
2011-12-02 22:37:26 +01:00
|
|
|
#include "mapnik_value_converter.hpp"
|
2013-12-05 17:31:30 +01:00
|
|
|
#include "mapnik_enumeration_wrapper_converter.hpp"
|
2012-02-08 00:40:02 +01:00
|
|
|
#include "mapnik_threads.hpp"
|
2012-01-17 07:09:46 +01:00
|
|
|
#include "python_optional.hpp"
|
2012-07-10 18:36:08 +02:00
|
|
|
#include <mapnik/marker_cache.hpp>
|
2013-10-14 23:47:51 +02:00
|
|
|
#if defined(SHAPE_MEMORY_MAPPED_FILE)
|
2012-07-10 18:36:08 +02:00
|
|
|
#include <mapnik/mapped_memory_cache.hpp>
|
2013-10-14 23:47:51 +02:00
|
|
|
#endif
|
2012-07-10 18:36:08 +02:00
|
|
|
|
2014-08-22 01:15:35 +02:00
|
|
|
#if defined(SVG_RENDERER)
|
|
|
|
#include <mapnik/svg/output/svg_renderer.hpp>
|
|
|
|
#endif
|
|
|
|
|
2013-11-06 00:11:23 +01:00
|
|
|
namespace mapnik {
|
|
|
|
class font_set;
|
|
|
|
class layer;
|
|
|
|
class color;
|
|
|
|
class label_collision_detector4;
|
|
|
|
}
|
2012-07-10 18:36:08 +02:00
|
|
|
void clear_cache()
|
|
|
|
{
|
2012-09-07 17:23:03 +02:00
|
|
|
mapnik::marker_cache::instance().clear();
|
2013-10-14 02:22:22 +02:00
|
|
|
#if defined(SHAPE_MEMORY_MAPPED_FILE)
|
2012-09-07 17:23:03 +02:00
|
|
|
mapnik::mapped_memory_cache::instance().clear();
|
2013-10-14 02:22:22 +02:00
|
|
|
#endif
|
2012-07-10 18:36:08 +02:00
|
|
|
}
|
2006-09-11 11:48:27 +02:00
|
|
|
|
2008-07-30 09:37:48 +02:00
|
|
|
#if defined(HAVE_CAIRO) && defined(HAVE_PYCAIRO)
|
2015-01-09 22:49:31 +01:00
|
|
|
#include <mapnik/cairo_io.hpp>
|
2014-06-06 14:38:00 +02:00
|
|
|
#include <mapnik/cairo/cairo_renderer.hpp>
|
2013-11-06 00:11:23 +01:00
|
|
|
#include <boost/python/type_id.hpp>
|
|
|
|
#include <boost/python/converter/registry.hpp>
|
2008-03-12 01:37:53 +01:00
|
|
|
#include <pycairo.h>
|
2013-10-28 20:46:44 +01:00
|
|
|
#include <cairo.h>
|
2009-07-28 08:27:10 +02:00
|
|
|
static Pycairo_CAPI_t *Pycairo_CAPI;
|
2013-11-06 00:11:23 +01:00
|
|
|
static void *extract_surface(PyObject* op)
|
|
|
|
{
|
|
|
|
if (PyObject_TypeCheck(op, const_cast<PyTypeObject*>(Pycairo_CAPI->Surface_Type)))
|
|
|
|
{
|
|
|
|
return op;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void *extract_context(PyObject* op)
|
|
|
|
{
|
|
|
|
if (PyObject_TypeCheck(op, const_cast<PyTypeObject*>(Pycairo_CAPI->Context_Type)))
|
|
|
|
{
|
|
|
|
return op;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void register_cairo()
|
|
|
|
{
|
|
|
|
#if PY_MAJOR_VERSION >= 3
|
|
|
|
Pycairo_CAPI = (Pycairo_CAPI_t*) PyCapsule_Import(const_cast<char *>("cairo.CAPI"), 0);
|
|
|
|
#else
|
|
|
|
Pycairo_CAPI = (Pycairo_CAPI_t*) PyCObject_Import(const_cast<char *>("cairo"), const_cast<char *>("CAPI"));
|
|
|
|
#endif
|
2013-11-27 16:52:47 +01:00
|
|
|
if (Pycairo_CAPI == nullptr) return;
|
2013-11-06 00:11:23 +01:00
|
|
|
|
|
|
|
boost::python::converter::registry::insert(&extract_surface, boost::python::type_id<PycairoSurface>());
|
|
|
|
boost::python::converter::registry::insert(&extract_context, boost::python::type_id<PycairoContext>());
|
|
|
|
}
|
2008-03-12 20:14:51 +01:00
|
|
|
#endif
|
2006-12-04 21:12:58 +01:00
|
|
|
|
2012-02-08 00:40:02 +01:00
|
|
|
using mapnik::python_thread;
|
2012-02-09 00:28:10 +01:00
|
|
|
using mapnik::python_unblock_auto_block;
|
2012-02-19 17:12:08 +01:00
|
|
|
#ifdef MAPNIK_DEBUG
|
2012-02-08 00:40:02 +01:00
|
|
|
bool python_thread::thread_support = true;
|
2012-02-19 17:12:08 +01:00
|
|
|
#endif
|
2012-02-08 00:40:02 +01:00
|
|
|
boost::thread_specific_ptr<PyThreadState> python_thread::state;
|
|
|
|
|
2015-01-21 01:30:10 +01:00
|
|
|
struct agg_renderer_visitor_1
|
|
|
|
{
|
|
|
|
agg_renderer_visitor_1(mapnik::Map const& m, double scale_factor, unsigned offset_x, unsigned offset_y)
|
|
|
|
: m_(m), scale_factor_(scale_factor), offset_x_(offset_x), offset_y_(offset_y) {}
|
|
|
|
|
|
|
|
template <typename T>
|
|
|
|
void operator() (T & pixmap)
|
|
|
|
{
|
|
|
|
throw std::runtime_error("This image type is not currently supported for rendering.");
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
mapnik::Map const& m_;
|
|
|
|
double scale_factor_;
|
|
|
|
unsigned offset_x_;
|
|
|
|
unsigned offset_y_;
|
|
|
|
};
|
|
|
|
|
|
|
|
template <>
|
|
|
|
void agg_renderer_visitor_1::operator()<mapnik::image_data_rgba8> (mapnik::image_data_rgba8 & pixmap)
|
|
|
|
{
|
|
|
|
mapnik::agg_renderer<mapnik::image_data_rgba8> ren(m_,pixmap,scale_factor_,offset_x_, offset_y_);
|
|
|
|
ren.apply();
|
|
|
|
}
|
|
|
|
|
|
|
|
struct agg_renderer_visitor_2
|
|
|
|
{
|
|
|
|
agg_renderer_visitor_2(mapnik::Map const &m, std::shared_ptr<mapnik::label_collision_detector4> detector,
|
|
|
|
double scale_factor, unsigned offset_x, unsigned offset_y)
|
|
|
|
: m_(m), detector_(detector), scale_factor_(scale_factor), offset_x_(offset_x), offset_y_(offset_y) {}
|
|
|
|
|
|
|
|
template <typename T>
|
|
|
|
void operator() (T & pixmap)
|
|
|
|
{
|
|
|
|
throw std::runtime_error("This image type is not currently supported for rendering.");
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
mapnik::Map const& m_;
|
|
|
|
std::shared_ptr<mapnik::label_collision_detector4> detector_;
|
|
|
|
double scale_factor_;
|
|
|
|
unsigned offset_x_;
|
|
|
|
unsigned offset_y_;
|
|
|
|
};
|
|
|
|
|
|
|
|
template <>
|
|
|
|
void agg_renderer_visitor_2::operator()<mapnik::image_data_rgba8> (mapnik::image_data_rgba8 & pixmap)
|
|
|
|
{
|
|
|
|
mapnik::agg_renderer<mapnik::image_data_rgba8> ren(m_,pixmap,detector_, scale_factor_,offset_x_, offset_y_);
|
|
|
|
ren.apply();
|
|
|
|
}
|
|
|
|
|
|
|
|
struct agg_renderer_visitor_3
|
|
|
|
{
|
|
|
|
agg_renderer_visitor_3(mapnik::Map const& m, mapnik::request const& req, mapnik::attributes const& vars,
|
|
|
|
double scale_factor, unsigned offset_x, unsigned offset_y)
|
|
|
|
: m_(m), req_(req), vars_(vars), scale_factor_(scale_factor), offset_x_(offset_x), offset_y_(offset_y) {}
|
|
|
|
|
|
|
|
template <typename T>
|
|
|
|
void operator() (T & pixmap)
|
|
|
|
{
|
|
|
|
throw std::runtime_error("This image type is not currently supported for rendering.");
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
mapnik::Map const& m_;
|
|
|
|
mapnik::request const& req_;
|
|
|
|
mapnik::attributes const& vars_;
|
|
|
|
double scale_factor_;
|
|
|
|
unsigned offset_x_;
|
|
|
|
unsigned offset_y_;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
template <>
|
|
|
|
void agg_renderer_visitor_3::operator()<mapnik::image_data_rgba8> (mapnik::image_data_rgba8 & pixmap)
|
|
|
|
{
|
|
|
|
mapnik::agg_renderer<mapnik::image_data_rgba8> ren(m_,req_, vars_, pixmap, scale_factor_, offset_x_, offset_y_);
|
|
|
|
ren.apply();
|
|
|
|
}
|
|
|
|
|
|
|
|
struct agg_renderer_visitor_4
|
|
|
|
{
|
|
|
|
agg_renderer_visitor_4(mapnik::Map const& m, double scale_factor, unsigned offset_x, unsigned offset_y,
|
|
|
|
mapnik::layer const& layer, std::set<std::string>& names)
|
|
|
|
: m_(m), scale_factor_(scale_factor), offset_x_(offset_x), offset_y_(offset_y),
|
|
|
|
layer_(layer), names_(names) {}
|
|
|
|
|
|
|
|
template <typename T>
|
|
|
|
void operator() (T & pixmap)
|
|
|
|
{
|
|
|
|
throw std::runtime_error("This image type is not currently supported for rendering.");
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
mapnik::Map const& m_;
|
|
|
|
double scale_factor_;
|
|
|
|
unsigned offset_x_;
|
|
|
|
unsigned offset_y_;
|
|
|
|
mapnik::layer const& layer_;
|
|
|
|
std::set<std::string> & names_;
|
|
|
|
};
|
|
|
|
|
|
|
|
template <>
|
|
|
|
void agg_renderer_visitor_4::operator()<mapnik::image_data_rgba8> (mapnik::image_data_rgba8 & pixmap)
|
|
|
|
{
|
|
|
|
mapnik::agg_renderer<mapnik::image_data_rgba8> ren(m_,pixmap,scale_factor_,offset_x_, offset_y_);
|
|
|
|
ren.apply(layer_, names_);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-11-06 00:11:23 +01:00
|
|
|
void render(mapnik::Map const& map,
|
2015-01-20 17:48:33 +01:00
|
|
|
mapnik::image_data_any& image,
|
2011-11-14 04:54:32 +01:00
|
|
|
double scale_factor = 1.0,
|
|
|
|
unsigned offset_x = 0u,
|
|
|
|
unsigned offset_y = 0u)
|
2006-12-04 21:12:58 +01:00
|
|
|
{
|
2012-02-09 00:28:10 +01:00
|
|
|
python_unblock_auto_block b;
|
2015-01-21 01:30:10 +01:00
|
|
|
mapnik::util::apply_visitor(agg_renderer_visitor_1(map, scale_factor, offset_x, offset_y), image);
|
2014-05-11 22:08:24 +02:00
|
|
|
}
|
2012-02-09 00:28:10 +01:00
|
|
|
|
2014-05-11 22:08:24 +02:00
|
|
|
void render_with_vars(mapnik::Map const& map,
|
2015-01-20 17:48:33 +01:00
|
|
|
mapnik::image_data_any& image,
|
2014-10-25 02:51:45 +02:00
|
|
|
boost::python::dict const& d,
|
|
|
|
double scale_factor = 1.0,
|
|
|
|
unsigned offset_x = 0u,
|
|
|
|
unsigned offset_y = 0u)
|
2014-05-11 22:08:24 +02:00
|
|
|
{
|
|
|
|
mapnik::attributes vars = mapnik::dict2attr(d);
|
2014-05-14 03:24:17 +02:00
|
|
|
mapnik::request req(map.width(),map.height(),map.get_current_extent());
|
|
|
|
req.set_buffer_size(map.buffer_size());
|
2014-05-11 22:08:24 +02:00
|
|
|
python_unblock_auto_block b;
|
2015-01-21 01:30:10 +01:00
|
|
|
mapnik::util::apply_visitor(agg_renderer_visitor_3(map, req, vars, scale_factor, offset_x, offset_y), image);
|
2012-02-05 01:27:50 +01:00
|
|
|
}
|
2006-12-05 16:43:52 +01:00
|
|
|
|
2011-10-12 02:05:35 +02:00
|
|
|
void render_with_detector(
|
2013-11-06 00:11:23 +01:00
|
|
|
mapnik::Map const& map,
|
2015-01-20 17:48:33 +01:00
|
|
|
mapnik::image_data_any &image,
|
2013-09-20 15:00:11 +02:00
|
|
|
std::shared_ptr<mapnik::label_collision_detector4> detector,
|
2011-11-14 04:54:32 +01:00
|
|
|
double scale_factor = 1.0,
|
|
|
|
unsigned offset_x = 0u,
|
|
|
|
unsigned offset_y = 0u)
|
2011-10-12 02:05:35 +02:00
|
|
|
{
|
2012-02-09 00:28:10 +01:00
|
|
|
python_unblock_auto_block b;
|
2015-01-21 01:30:10 +01:00
|
|
|
mapnik::util::apply_visitor(agg_renderer_visitor_2(map, detector, scale_factor, offset_x, offset_y), image);
|
2012-02-08 00:44:00 +01:00
|
|
|
}
|
2011-10-12 02:05:35 +02:00
|
|
|
|
2013-11-06 00:11:23 +01:00
|
|
|
void render_layer2(mapnik::Map const& map,
|
2015-01-20 17:48:33 +01:00
|
|
|
mapnik::image_data_any& image,
|
2014-09-13 00:50:00 +02:00
|
|
|
unsigned layer_idx,
|
|
|
|
double scale_factor,
|
|
|
|
unsigned offset_x,
|
|
|
|
unsigned offset_y)
|
2011-06-04 02:28:00 +02:00
|
|
|
{
|
|
|
|
std::vector<mapnik::layer> const& layers = map.layers();
|
|
|
|
std::size_t layer_num = layers.size();
|
|
|
|
if (layer_idx >= layer_num) {
|
|
|
|
std::ostringstream s;
|
|
|
|
s << "Zero-based layer index '" << layer_idx << "' not valid, only '"
|
|
|
|
<< layer_num << "' layers are in map\n";
|
|
|
|
throw std::runtime_error(s.str());
|
|
|
|
}
|
|
|
|
|
2012-02-09 00:28:10 +01:00
|
|
|
python_unblock_auto_block b;
|
|
|
|
mapnik::layer const& layer = layers[layer_idx];
|
|
|
|
std::set<std::string> names;
|
2015-01-21 01:30:10 +01:00
|
|
|
mapnik::util::apply_visitor(agg_renderer_visitor_4(map, scale_factor, offset_x, offset_y, layer, names), image);
|
2012-02-08 00:44:00 +01:00
|
|
|
}
|
2011-06-04 02:28:00 +02:00
|
|
|
|
2008-07-30 09:37:48 +02:00
|
|
|
#if defined(HAVE_CAIRO) && defined(HAVE_PYCAIRO)
|
2008-03-12 20:14:51 +01:00
|
|
|
|
2013-11-06 00:11:23 +01:00
|
|
|
void render3(mapnik::Map const& map,
|
2013-01-09 18:00:30 +01:00
|
|
|
PycairoSurface* py_surface,
|
2012-07-05 23:54:58 +02:00
|
|
|
double scale_factor = 1.0,
|
2011-11-14 04:54:32 +01:00
|
|
|
unsigned offset_x = 0,
|
|
|
|
unsigned offset_y = 0)
|
2008-03-12 01:37:53 +01:00
|
|
|
{
|
2012-02-09 00:28:10 +01:00
|
|
|
python_unblock_auto_block b;
|
2013-01-09 18:00:30 +01:00
|
|
|
mapnik::cairo_surface_ptr surface(cairo_surface_reference(py_surface->surface), mapnik::cairo_surface_closer());
|
2014-08-10 22:03:07 +02:00
|
|
|
mapnik::cairo_renderer<mapnik::cairo_ptr> ren(map,mapnik::create_context(surface),scale_factor,offset_x,offset_y);
|
2012-02-09 00:28:10 +01:00
|
|
|
ren.apply();
|
2012-02-08 00:44:00 +01:00
|
|
|
}
|
2008-03-12 01:37:53 +01:00
|
|
|
|
2013-11-06 00:11:23 +01:00
|
|
|
void render4(mapnik::Map const& map, PycairoSurface* py_surface)
|
2009-02-06 01:46:29 +01:00
|
|
|
{
|
2012-02-09 00:28:10 +01:00
|
|
|
python_unblock_auto_block b;
|
2013-01-09 18:00:30 +01:00
|
|
|
mapnik::cairo_surface_ptr surface(cairo_surface_reference(py_surface->surface), mapnik::cairo_surface_closer());
|
2014-08-10 22:03:07 +02:00
|
|
|
mapnik::cairo_renderer<mapnik::cairo_ptr> ren(map,mapnik::create_context(surface));
|
2012-02-09 00:28:10 +01:00
|
|
|
ren.apply();
|
2012-02-08 00:44:00 +01:00
|
|
|
}
|
2009-02-05 19:09:14 +01:00
|
|
|
|
2013-11-06 00:11:23 +01:00
|
|
|
void render5(mapnik::Map const& map,
|
2013-01-09 18:00:30 +01:00
|
|
|
PycairoContext* py_context,
|
2012-07-05 23:54:58 +02:00
|
|
|
double scale_factor = 1.0,
|
2011-11-14 04:54:32 +01:00
|
|
|
unsigned offset_x = 0,
|
|
|
|
unsigned offset_y = 0)
|
2008-03-12 01:37:53 +01:00
|
|
|
{
|
2012-02-09 00:28:10 +01:00
|
|
|
python_unblock_auto_block b;
|
2013-10-28 20:46:44 +01:00
|
|
|
mapnik::cairo_ptr context(cairo_reference(py_context->ctx), mapnik::cairo_closer());
|
2013-01-09 18:00:30 +01:00
|
|
|
mapnik::cairo_renderer<mapnik::cairo_ptr> ren(map,context,scale_factor,offset_x, offset_y);
|
2012-02-09 00:28:10 +01:00
|
|
|
ren.apply();
|
2012-02-08 00:44:00 +01:00
|
|
|
}
|
2008-03-12 01:37:53 +01:00
|
|
|
|
2013-11-06 00:11:23 +01:00
|
|
|
void render6(mapnik::Map const& map, PycairoContext* py_context)
|
2009-02-06 01:46:29 +01:00
|
|
|
{
|
2012-02-09 00:28:10 +01:00
|
|
|
python_unblock_auto_block b;
|
2013-10-28 20:46:44 +01:00
|
|
|
mapnik::cairo_ptr context(cairo_reference(py_context->ctx), mapnik::cairo_closer());
|
2013-01-09 18:00:30 +01:00
|
|
|
mapnik::cairo_renderer<mapnik::cairo_ptr> ren(map,context);
|
2012-02-09 00:28:10 +01:00
|
|
|
ren.apply();
|
2012-02-08 00:44:00 +01:00
|
|
|
}
|
2012-08-25 11:43:31 +02:00
|
|
|
void render_with_detector2(
|
2013-11-06 00:11:23 +01:00
|
|
|
mapnik::Map const& map,
|
2013-01-09 18:00:30 +01:00
|
|
|
PycairoContext* py_context,
|
2013-09-20 15:00:11 +02:00
|
|
|
std::shared_ptr<mapnik::label_collision_detector4> detector)
|
2012-08-25 11:43:31 +02:00
|
|
|
{
|
|
|
|
python_unblock_auto_block b;
|
2013-10-28 20:46:44 +01:00
|
|
|
mapnik::cairo_ptr context(cairo_reference(py_context->ctx), mapnik::cairo_closer());
|
2013-01-09 18:00:30 +01:00
|
|
|
mapnik::cairo_renderer<mapnik::cairo_ptr> ren(map,context,detector);
|
2012-08-25 11:43:31 +02:00
|
|
|
ren.apply();
|
|
|
|
}
|
|
|
|
|
|
|
|
void render_with_detector3(
|
2013-11-06 00:11:23 +01:00
|
|
|
mapnik::Map const& map,
|
2013-01-09 18:00:30 +01:00
|
|
|
PycairoContext* py_context,
|
2013-09-20 15:00:11 +02:00
|
|
|
std::shared_ptr<mapnik::label_collision_detector4> detector,
|
2012-08-25 11:43:31 +02:00
|
|
|
double scale_factor = 1.0,
|
|
|
|
unsigned offset_x = 0u,
|
|
|
|
unsigned offset_y = 0u)
|
|
|
|
{
|
|
|
|
python_unblock_auto_block b;
|
2013-10-28 20:46:44 +01:00
|
|
|
mapnik::cairo_ptr context(cairo_reference(py_context->ctx), mapnik::cairo_closer());
|
2013-01-09 18:00:30 +01:00
|
|
|
mapnik::cairo_renderer<mapnik::cairo_ptr> ren(map,context,detector,scale_factor,offset_x,offset_y);
|
2012-08-25 11:43:31 +02:00
|
|
|
ren.apply();
|
|
|
|
}
|
|
|
|
|
|
|
|
void render_with_detector4(
|
2013-11-06 00:11:23 +01:00
|
|
|
mapnik::Map const& map,
|
2013-01-09 18:00:30 +01:00
|
|
|
PycairoSurface* py_surface,
|
2013-09-20 15:00:11 +02:00
|
|
|
std::shared_ptr<mapnik::label_collision_detector4> detector)
|
2012-08-25 11:43:31 +02:00
|
|
|
{
|
|
|
|
python_unblock_auto_block b;
|
2013-01-09 18:00:30 +01:00
|
|
|
mapnik::cairo_surface_ptr surface(cairo_surface_reference(py_surface->surface), mapnik::cairo_surface_closer());
|
2014-08-10 22:03:07 +02:00
|
|
|
mapnik::cairo_renderer<mapnik::cairo_ptr> ren(map, mapnik::create_context(surface), detector);
|
2012-08-25 11:43:31 +02:00
|
|
|
ren.apply();
|
|
|
|
}
|
|
|
|
|
|
|
|
void render_with_detector5(
|
2013-11-06 00:11:23 +01:00
|
|
|
mapnik::Map const& map,
|
2013-01-09 18:00:30 +01:00
|
|
|
PycairoSurface* py_surface,
|
2013-09-20 15:00:11 +02:00
|
|
|
std::shared_ptr<mapnik::label_collision_detector4> detector,
|
2012-08-25 11:43:31 +02:00
|
|
|
double scale_factor = 1.0,
|
|
|
|
unsigned offset_x = 0u,
|
|
|
|
unsigned offset_y = 0u)
|
|
|
|
{
|
|
|
|
python_unblock_auto_block b;
|
2013-01-09 18:00:30 +01:00
|
|
|
mapnik::cairo_surface_ptr surface(cairo_surface_reference(py_surface->surface), mapnik::cairo_surface_closer());
|
2014-08-10 22:03:07 +02:00
|
|
|
mapnik::cairo_renderer<mapnik::cairo_ptr> ren(map, mapnik::create_context(surface), detector, scale_factor, offset_x, offset_y);
|
2012-08-25 11:43:31 +02:00
|
|
|
ren.apply();
|
|
|
|
}
|
|
|
|
|
2008-03-12 20:14:51 +01:00
|
|
|
#endif
|
|
|
|
|
2011-05-27 06:16:56 +02:00
|
|
|
|
2013-11-06 00:11:23 +01:00
|
|
|
void render_tile_to_file(mapnik::Map const& map,
|
2007-12-06 13:14:29 +01:00
|
|
|
unsigned offset_x, unsigned offset_y,
|
|
|
|
unsigned width, unsigned height,
|
2012-09-03 19:27:48 +02:00
|
|
|
std::string const& file,
|
|
|
|
std::string const& format)
|
2006-02-01 00:09:52 +01:00
|
|
|
{
|
2015-01-20 17:48:33 +01:00
|
|
|
mapnik::image_data_any image(width,height);
|
2010-06-10 16:12:35 +02:00
|
|
|
render(map,image,1.0,offset_x, offset_y);
|
2015-01-20 17:48:33 +01:00
|
|
|
mapnik::save_to_file(image,file,format);
|
2006-02-01 00:09:52 +01:00
|
|
|
}
|
|
|
|
|
2013-11-06 00:11:23 +01:00
|
|
|
void render_to_file1(mapnik::Map const& map,
|
2012-09-03 19:27:48 +02:00
|
|
|
std::string const& filename,
|
|
|
|
std::string const& format)
|
2006-02-01 00:09:52 +01:00
|
|
|
{
|
2014-08-22 01:15:35 +02:00
|
|
|
if (format == "svg-ng")
|
|
|
|
{
|
|
|
|
#if defined(SVG_RENDERER)
|
|
|
|
std::ofstream file (filename.c_str(), std::ios::out|std::ios::trunc|std::ios::binary);
|
|
|
|
if (!file)
|
|
|
|
{
|
|
|
|
throw mapnik::ImageWriterException("could not open file for writing: " + filename);
|
|
|
|
}
|
|
|
|
using iter_type = std::ostream_iterator<char>;
|
|
|
|
iter_type output_stream_iterator(file);
|
|
|
|
mapnik::svg_renderer<iter_type> ren(map,output_stream_iterator);
|
|
|
|
ren.apply();
|
|
|
|
#else
|
|
|
|
throw mapnik::ImageWriterException("SVG backend not available, cannot write to format: " + format);
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
else if (format == "pdf" || format == "svg" || format =="ps" || format == "ARGB32" || format == "RGB24")
|
2010-01-11 19:55:30 +01:00
|
|
|
{
|
|
|
|
#if defined(HAVE_CAIRO)
|
2012-07-05 23:54:58 +02:00
|
|
|
mapnik::save_to_cairo_file(map,filename,format,1.0);
|
2010-01-11 19:55:30 +01:00
|
|
|
#else
|
|
|
|
throw mapnik::ImageWriterException("Cairo backend not available, cannot write to format: " + format);
|
|
|
|
#endif
|
|
|
|
}
|
2011-11-14 04:54:32 +01:00
|
|
|
else
|
2010-01-11 19:55:30 +01:00
|
|
|
{
|
2015-01-20 17:48:33 +01:00
|
|
|
mapnik::image_data_any image(map.width(),map.height());
|
2010-06-19 16:26:04 +02:00
|
|
|
render(map,image,1.0,0,0);
|
2015-01-20 17:48:33 +01:00
|
|
|
mapnik::save_to_file(image,filename,format);
|
2010-06-02 13:03:30 +02:00
|
|
|
}
|
2006-02-01 00:09:52 +01:00
|
|
|
}
|
|
|
|
|
2013-11-06 00:11:23 +01:00
|
|
|
void render_to_file2(mapnik::Map const& map,std::string const& filename)
|
2007-12-06 13:14:29 +01:00
|
|
|
{
|
2010-01-11 19:55:30 +01:00
|
|
|
std::string format = mapnik::guess_type(filename);
|
|
|
|
if (format == "pdf" || format == "svg" || format =="ps")
|
|
|
|
{
|
|
|
|
#if defined(HAVE_CAIRO)
|
2012-07-05 23:54:58 +02:00
|
|
|
mapnik::save_to_cairo_file(map,filename,format,1.0);
|
2010-01-11 19:55:30 +01:00
|
|
|
#else
|
|
|
|
throw mapnik::ImageWriterException("Cairo backend not available, cannot write to format: " + format);
|
|
|
|
#endif
|
|
|
|
}
|
2011-11-14 04:54:32 +01:00
|
|
|
else
|
2010-01-11 19:55:30 +01:00
|
|
|
{
|
2015-01-20 17:48:33 +01:00
|
|
|
mapnik::image_data_any image(map.width(),map.height());
|
2010-06-19 16:26:04 +02:00
|
|
|
render(map,image,1.0,0,0);
|
2015-01-20 17:48:33 +01:00
|
|
|
mapnik::save_to_file(image,filename);
|
2010-06-02 13:03:30 +02:00
|
|
|
}
|
2007-12-06 13:14:29 +01:00
|
|
|
}
|
2009-07-26 03:15:44 +02:00
|
|
|
|
2013-11-06 00:11:23 +01:00
|
|
|
void render_to_file3(mapnik::Map const& map,
|
2012-09-03 19:27:48 +02:00
|
|
|
std::string const& filename,
|
|
|
|
std::string const& format,
|
2010-06-29 23:35:49 +02:00
|
|
|
double scale_factor = 1.0
|
2011-11-14 04:54:32 +01:00
|
|
|
)
|
2010-06-29 23:35:49 +02:00
|
|
|
{
|
2014-08-22 01:15:35 +02:00
|
|
|
if (format == "svg-ng")
|
|
|
|
{
|
|
|
|
#if defined(SVG_RENDERER)
|
|
|
|
std::ofstream file (filename.c_str(), std::ios::out|std::ios::trunc|std::ios::binary);
|
|
|
|
if (!file)
|
|
|
|
{
|
|
|
|
throw mapnik::ImageWriterException("could not open file for writing: " + filename);
|
|
|
|
}
|
|
|
|
using iter_type = std::ostream_iterator<char>;
|
|
|
|
iter_type output_stream_iterator(file);
|
|
|
|
mapnik::svg_renderer<iter_type> ren(map,output_stream_iterator,scale_factor);
|
|
|
|
ren.apply();
|
|
|
|
#else
|
|
|
|
throw mapnik::ImageWriterException("SVG backend not available, cannot write to format: " + format);
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
else if (format == "pdf" || format == "svg" || format =="ps" || format == "ARGB32" || format == "RGB24")
|
2010-06-29 23:35:49 +02:00
|
|
|
{
|
|
|
|
#if defined(HAVE_CAIRO)
|
2012-07-05 23:54:58 +02:00
|
|
|
mapnik::save_to_cairo_file(map,filename,format,scale_factor);
|
2010-06-29 23:35:49 +02:00
|
|
|
#else
|
|
|
|
throw mapnik::ImageWriterException("Cairo backend not available, cannot write to format: " + format);
|
|
|
|
#endif
|
|
|
|
}
|
2011-11-14 04:54:32 +01:00
|
|
|
else
|
2010-06-29 23:35:49 +02:00
|
|
|
{
|
2015-01-20 17:48:33 +01:00
|
|
|
mapnik::image_data_any image(map.width(),map.height());
|
2010-06-29 23:35:49 +02:00
|
|
|
render(map,image,scale_factor,0,0);
|
2015-01-20 17:48:33 +01:00
|
|
|
mapnik::save_to_file(image,filename,format);
|
2010-06-29 23:35:49 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-11-06 00:11:23 +01:00
|
|
|
double scale_denominator(mapnik::Map const& map, bool geographic)
|
2006-12-07 16:20:33 +01:00
|
|
|
{
|
2013-02-21 03:02:28 +01:00
|
|
|
return mapnik::scale_denominator(map.scale(), geographic);
|
2006-12-07 16:20:33 +01:00
|
|
|
}
|
|
|
|
|
2010-09-26 14:15:16 +02:00
|
|
|
// http://docs.python.org/c-api/exceptions.html#standard-exceptions
|
2012-08-08 13:11:30 +02:00
|
|
|
void value_error_translator(mapnik::value_error const & ex)
|
|
|
|
{
|
2010-11-15 04:30:23 +01:00
|
|
|
PyErr_SetString(PyExc_ValueError, ex.what());
|
|
|
|
}
|
|
|
|
|
2012-08-08 13:11:30 +02:00
|
|
|
void runtime_error_translator(std::runtime_error const & ex)
|
|
|
|
{
|
|
|
|
PyErr_SetString(PyExc_RuntimeError, ex.what());
|
|
|
|
}
|
|
|
|
|
2013-04-18 00:28:48 +02:00
|
|
|
void out_of_range_error_translator(std::out_of_range const & ex)
|
|
|
|
{
|
|
|
|
PyErr_SetString(PyExc_IndexError, ex.what());
|
|
|
|
}
|
|
|
|
|
2013-04-17 22:40:08 +02:00
|
|
|
void standard_error_translator(std::exception const & ex)
|
|
|
|
{
|
|
|
|
PyErr_SetString(PyExc_RuntimeError, ex.what());
|
|
|
|
}
|
|
|
|
|
2009-02-12 17:44:04 +01:00
|
|
|
unsigned mapnik_version()
|
|
|
|
{
|
2009-03-30 06:32:23 +02:00
|
|
|
return MAPNIK_VERSION;
|
2009-02-12 17:44:04 +01:00
|
|
|
}
|
|
|
|
|
2012-03-15 01:26:50 +01:00
|
|
|
std::string mapnik_version_string()
|
|
|
|
{
|
|
|
|
return MAPNIK_VERSION_STRING;
|
|
|
|
}
|
|
|
|
|
2013-07-24 01:37:25 +02:00
|
|
|
bool has_proj4()
|
|
|
|
{
|
|
|
|
#if defined(MAPNIK_USE_PROJ4)
|
|
|
|
return true;
|
|
|
|
#else
|
|
|
|
return false;
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
bool has_svg_renderer()
|
|
|
|
{
|
|
|
|
#if defined(SVG_RENDERER)
|
|
|
|
return true;
|
|
|
|
#else
|
|
|
|
return false;
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
bool has_grid_renderer()
|
|
|
|
{
|
|
|
|
#if defined(GRID_RENDERER)
|
|
|
|
return true;
|
|
|
|
#else
|
|
|
|
return false;
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2010-06-03 21:50:27 +02:00
|
|
|
bool has_jpeg()
|
|
|
|
{
|
|
|
|
#if defined(HAVE_JPEG)
|
2011-11-14 04:54:32 +01:00
|
|
|
return true;
|
2010-06-03 21:50:27 +02:00
|
|
|
#else
|
2011-11-14 04:54:32 +01:00
|
|
|
return false;
|
2010-06-03 21:50:27 +02:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2013-07-24 01:37:25 +02:00
|
|
|
bool has_png()
|
|
|
|
{
|
|
|
|
#if defined(HAVE_PNG)
|
|
|
|
return true;
|
|
|
|
#else
|
|
|
|
return false;
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
bool has_tiff()
|
|
|
|
{
|
|
|
|
#if defined(HAVE_TIFF)
|
|
|
|
return true;
|
|
|
|
#else
|
|
|
|
return false;
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
bool has_webp()
|
|
|
|
{
|
|
|
|
#if defined(HAVE_WEBP)
|
|
|
|
return true;
|
|
|
|
#else
|
|
|
|
return false;
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2009-07-28 08:27:10 +02:00
|
|
|
// indicator for cairo rendering support inside libmapnik
|
2009-05-24 06:25:51 +02:00
|
|
|
bool has_cairo()
|
|
|
|
{
|
2009-07-28 08:27:10 +02:00
|
|
|
#if defined(HAVE_CAIRO)
|
2010-06-02 13:03:30 +02:00
|
|
|
return true;
|
2009-05-24 06:25:51 +02:00
|
|
|
#else
|
2010-06-02 13:03:30 +02:00
|
|
|
return false;
|
2009-05-24 06:25:51 +02:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2009-07-28 08:27:10 +02:00
|
|
|
// indicator for pycairo support in the python bindings
|
|
|
|
bool has_pycairo()
|
|
|
|
{
|
|
|
|
#if defined(HAVE_CAIRO) && defined(HAVE_PYCAIRO)
|
2013-01-11 08:04:14 +01:00
|
|
|
#if PY_MAJOR_VERSION >= 3
|
|
|
|
Pycairo_CAPI = (Pycairo_CAPI_t*) PyCapsule_Import(const_cast<char *>("cairo.CAPI"), 0);
|
|
|
|
#else
|
2011-04-04 06:40:18 +02:00
|
|
|
Pycairo_CAPI = (Pycairo_CAPI_t*) PyCObject_Import(const_cast<char *>("cairo"), const_cast<char *>("CAPI"));
|
2013-01-11 08:04:14 +01:00
|
|
|
#endif
|
2013-11-27 16:52:47 +01:00
|
|
|
if (Pycairo_CAPI == nullptr){
|
2011-04-04 06:40:18 +02:00
|
|
|
/*
|
|
|
|
Case where pycairo support has been compiled into
|
2011-11-14 04:54:32 +01:00
|
|
|
mapnik but at runtime the cairo python module
|
|
|
|
is unable to be imported and therefore Pycairo surfaces
|
|
|
|
and contexts cannot be passed to mapnik.render()
|
|
|
|
*/
|
2011-04-04 06:40:18 +02:00
|
|
|
return false;
|
|
|
|
}
|
2010-06-02 13:03:30 +02:00
|
|
|
return true;
|
2009-07-28 08:27:10 +02:00
|
|
|
#else
|
2010-06-02 13:03:30 +02:00
|
|
|
return false;
|
2009-07-28 08:27:10 +02:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-10-27 18:30:28 +01:00
|
|
|
#pragma GCC diagnostic push
|
|
|
|
#pragma GCC diagnostic ignored "-Wunused-local-typedef"
|
2013-06-03 01:24:21 +02:00
|
|
|
BOOST_PYTHON_FUNCTION_OVERLOADS(load_map_overloads, load_map, 2, 4)
|
2011-04-01 08:24:57 +02:00
|
|
|
BOOST_PYTHON_FUNCTION_OVERLOADS(load_map_string_overloads, load_map_string, 2, 4)
|
|
|
|
BOOST_PYTHON_FUNCTION_OVERLOADS(save_map_overloads, save_map, 2, 3)
|
|
|
|
BOOST_PYTHON_FUNCTION_OVERLOADS(save_map_to_string_overloads, save_map_to_string, 1, 2)
|
|
|
|
BOOST_PYTHON_FUNCTION_OVERLOADS(render_overloads, render, 2, 5)
|
2011-10-12 02:05:35 +02:00
|
|
|
BOOST_PYTHON_FUNCTION_OVERLOADS(render_with_detector_overloads, render_with_detector, 3, 6)
|
2014-10-27 18:30:28 +01:00
|
|
|
#pragma GCC diagnostic pop
|
2006-10-03 10:44:04 +02:00
|
|
|
|
2011-11-23 12:33:58 +01:00
|
|
|
BOOST_PYTHON_MODULE(_mapnik)
|
2006-02-01 00:09:52 +01:00
|
|
|
{
|
2011-11-14 04:54:32 +01:00
|
|
|
|
2007-09-25 20:47:12 +02:00
|
|
|
using namespace boost::python;
|
|
|
|
|
2006-10-03 12:02:14 +02:00
|
|
|
using mapnik::load_map;
|
2009-01-16 00:51:07 +01:00
|
|
|
using mapnik::load_map_string;
|
2006-10-03 12:02:14 +02:00
|
|
|
using mapnik::save_map;
|
2009-12-06 23:33:47 +01:00
|
|
|
using mapnik::save_map_to_string;
|
2011-11-14 04:54:32 +01:00
|
|
|
|
2013-04-18 00:28:48 +02:00
|
|
|
register_exception_translator<std::exception>(&standard_error_translator);
|
|
|
|
register_exception_translator<std::out_of_range>(&out_of_range_error_translator);
|
2010-11-15 04:30:23 +01:00
|
|
|
register_exception_translator<mapnik::value_error>(&value_error_translator);
|
2012-08-08 13:11:30 +02:00
|
|
|
register_exception_translator<std::runtime_error>(&runtime_error_translator);
|
2013-11-06 00:11:23 +01:00
|
|
|
#if defined(HAVE_CAIRO) && defined(HAVE_PYCAIRO)
|
2008-03-12 01:37:53 +01:00
|
|
|
register_cairo();
|
2013-11-06 00:11:23 +01:00
|
|
|
#endif
|
2009-01-13 01:56:09 +01:00
|
|
|
export_query();
|
|
|
|
export_geometry();
|
2006-12-06 21:26:59 +01:00
|
|
|
export_feature();
|
|
|
|
export_featureset();
|
2011-12-20 21:34:27 +01:00
|
|
|
export_fontset();
|
2006-10-16 15:44:52 +02:00
|
|
|
export_datasource();
|
2006-02-01 00:09:52 +01:00
|
|
|
export_parameters();
|
2011-11-14 04:54:32 +01:00
|
|
|
export_color();
|
|
|
|
export_envelope();
|
2011-08-31 04:28:38 +02:00
|
|
|
export_palette();
|
2006-02-01 00:09:52 +01:00
|
|
|
export_image();
|
1. hit_test implementation for geometry objects:
bool hit_test(double x, double y, double tol);
2. added image_view(unsigned x, unsigned y, unsigned width, unsigned height)
allowing to select region from image data e.g (in Python):
im = Image(2048,2048)
view = im.view(0,0,256,256)
save_to_file(filename,type, view)
3. changed envelope method to return vy value in datasource classes
4. features_at_point impl for shape and postgis plug-ins
2006-11-25 12:02:59 +01:00
|
|
|
export_image_view();
|
2012-01-19 18:45:24 +01:00
|
|
|
export_gamma_method();
|
2012-07-07 01:45:58 +02:00
|
|
|
export_scaling_method();
|
2013-07-24 01:37:25 +02:00
|
|
|
#if defined(GRID_RENDERER)
|
2011-06-04 02:28:00 +02:00
|
|
|
export_grid();
|
|
|
|
export_grid_view();
|
2013-07-24 01:37:25 +02:00
|
|
|
#endif
|
2009-12-16 21:02:06 +01:00
|
|
|
export_expression();
|
2006-02-01 00:09:52 +01:00
|
|
|
export_rule();
|
2011-11-14 04:54:32 +01:00
|
|
|
export_style();
|
2006-02-01 00:09:52 +01:00
|
|
|
export_layer();
|
|
|
|
export_datasource_cache();
|
2009-10-19 16:22:11 +02:00
|
|
|
export_symbolizer();
|
2010-06-06 14:10:28 +02:00
|
|
|
export_markers_symbolizer();
|
2006-02-25 12:03:30 +01:00
|
|
|
export_point_symbolizer();
|
|
|
|
export_line_symbolizer();
|
|
|
|
export_line_pattern_symbolizer();
|
|
|
|
export_polygon_symbolizer();
|
2012-08-21 03:17:00 +02:00
|
|
|
export_building_symbolizer();
|
2006-02-25 12:03:30 +01:00
|
|
|
export_polygon_pattern_symbolizer();
|
|
|
|
export_raster_symbolizer();
|
2012-01-30 03:32:25 +01:00
|
|
|
export_text_placement();
|
2007-07-02 15:39:08 +02:00
|
|
|
export_shield_symbolizer();
|
2013-05-22 04:21:35 +02:00
|
|
|
export_debug_symbolizer();
|
2014-01-14 21:15:09 +01:00
|
|
|
export_group_symbolizer();
|
2006-03-19 22:55:59 +01:00
|
|
|
export_font_engine();
|
2006-10-16 15:44:52 +02:00
|
|
|
export_projection();
|
2009-01-13 16:49:26 +01:00
|
|
|
export_proj_transform();
|
2009-03-29 12:26:44 +02:00
|
|
|
export_view_transform();
|
2006-10-16 15:44:52 +02:00
|
|
|
export_coord();
|
2006-02-01 00:09:52 +01:00
|
|
|
export_map();
|
2010-03-12 14:34:13 +01:00
|
|
|
export_raster_colorizer();
|
2011-10-12 02:05:35 +02:00
|
|
|
export_label_collision_detector();
|
2012-04-09 03:00:51 +02:00
|
|
|
export_logger();
|
2008-03-12 01:37:53 +01:00
|
|
|
|
2012-07-10 18:36:08 +02:00
|
|
|
def("clear_cache", &clear_cache,
|
|
|
|
"\n"
|
|
|
|
"Clear all global caches of markers and mapped memory regions.\n"
|
|
|
|
"\n"
|
|
|
|
"Usage:\n"
|
|
|
|
">>> from mapnik import clear_cache\n"
|
|
|
|
">>> clear_cache()\n"
|
|
|
|
);
|
|
|
|
|
2009-03-30 06:32:23 +02:00
|
|
|
def("render_to_file",&render_to_file1,
|
|
|
|
"\n"
|
2009-04-12 23:36:45 +02:00
|
|
|
"Render Map to file using explicit image type.\n"
|
2009-03-30 06:32:23 +02:00
|
|
|
"\n"
|
|
|
|
"Usage:\n"
|
|
|
|
">>> from mapnik import Map, render_to_file, load_map\n"
|
|
|
|
">>> m = Map(256,256)\n"
|
|
|
|
">>> load_map(m,'mapfile.xml')\n"
|
|
|
|
">>> render_to_file(m,'image32bit.png','png')\n"
|
|
|
|
"\n"
|
2009-04-08 02:27:36 +02:00
|
|
|
"8 bit (paletted) PNG can be requested with 'png256':\n"
|
2009-04-12 23:36:45 +02:00
|
|
|
">>> render_to_file(m,'8bit_image.png','png256')\n"
|
|
|
|
"\n"
|
2009-04-08 02:27:36 +02:00
|
|
|
"JPEG quality can be controlled by adding a suffix to\n"
|
|
|
|
"'jpeg' between 0 and 100 (default is 85):\n"
|
|
|
|
">>> render_to_file(m,'top_quality.jpeg','jpeg100')\n"
|
|
|
|
">>> render_to_file(m,'medium_quality.jpeg','jpeg50')\n"
|
2009-03-30 06:32:23 +02:00
|
|
|
);
|
|
|
|
|
|
|
|
def("render_to_file",&render_to_file2,
|
|
|
|
"\n"
|
|
|
|
"Render Map to file (type taken from file extension)\n"
|
|
|
|
"\n"
|
|
|
|
"Usage:\n"
|
|
|
|
">>> from mapnik import Map, render_to_file, load_map\n"
|
|
|
|
">>> m = Map(256,256)\n"
|
|
|
|
">>> render_to_file(m,'image.jpeg')\n"
|
|
|
|
"\n"
|
|
|
|
);
|
|
|
|
|
2010-06-29 23:35:49 +02:00
|
|
|
def("render_to_file",&render_to_file3,
|
|
|
|
"\n"
|
|
|
|
"Render Map to file using explicit image type and scale factor.\n"
|
|
|
|
"\n"
|
|
|
|
"Usage:\n"
|
|
|
|
">>> from mapnik import Map, render_to_file, load_map\n"
|
|
|
|
">>> m = Map(256,256)\n"
|
|
|
|
">>> scale_factor = 4\n"
|
|
|
|
">>> render_to_file(m,'image.jpeg',scale_factor)\n"
|
|
|
|
"\n"
|
|
|
|
);
|
2011-11-14 04:54:32 +01:00
|
|
|
|
2009-03-30 06:32:23 +02:00
|
|
|
def("render_tile_to_file",&render_tile_to_file,
|
|
|
|
"\n"
|
|
|
|
"TODO\n"
|
|
|
|
"\n"
|
2011-11-14 04:54:32 +01:00
|
|
|
);
|
|
|
|
|
2014-10-25 02:51:45 +02:00
|
|
|
def("render_with_vars",&render_with_vars,
|
|
|
|
(arg("map"),
|
|
|
|
arg("image"),
|
|
|
|
arg("vars"),
|
|
|
|
arg("scale_factor")=1.0,
|
|
|
|
arg("offset_x")=0,
|
|
|
|
arg("offset_y")=0
|
|
|
|
)
|
|
|
|
);
|
2009-03-30 06:32:23 +02:00
|
|
|
|
2010-06-10 16:12:35 +02:00
|
|
|
def("render", &render, render_overloads(
|
2011-11-14 04:54:32 +01:00
|
|
|
"\n"
|
2015-01-20 17:48:33 +01:00
|
|
|
"Render Map to an AGG image_data_any using offsets\n"
|
2010-06-10 16:12:35 +02:00
|
|
|
"\n"
|
|
|
|
"Usage:\n"
|
|
|
|
">>> from mapnik import Map, Image, render, load_map\n"
|
|
|
|
">>> m = Map(256,256)\n"
|
|
|
|
">>> load_map(m,'mapfile.xml')\n"
|
|
|
|
">>> im = Image(m.width,m.height)\n"
|
|
|
|
">>> scale_factor=2.0\n"
|
|
|
|
">>> offset = [100,50]\n"
|
|
|
|
">>> render(m,im)\n"
|
|
|
|
">>> render(m,im,scale_factor)\n"
|
|
|
|
">>> render(m,im,scale_factor,offset[0],offset[1])\n"
|
|
|
|
"\n"
|
2011-11-14 04:54:32 +01:00
|
|
|
));
|
2011-06-04 02:28:00 +02:00
|
|
|
|
2011-10-12 02:05:35 +02:00
|
|
|
def("render_with_detector", &render_with_detector, render_with_detector_overloads(
|
2011-11-14 04:54:32 +01:00
|
|
|
"\n"
|
2015-01-20 17:48:33 +01:00
|
|
|
"Render Map to an AGG image_data_any using a pre-constructed detector.\n"
|
2011-11-14 04:54:32 +01:00
|
|
|
"\n"
|
|
|
|
"Usage:\n"
|
|
|
|
">>> from mapnik import Map, Image, LabelCollisionDetector, render_with_detector, load_map\n"
|
|
|
|
">>> m = Map(256,256)\n"
|
|
|
|
">>> load_map(m,'mapfile.xml')\n"
|
|
|
|
">>> im = Image(m.width,m.height)\n"
|
|
|
|
">>> detector = LabelCollisionDetector(m)\n"
|
|
|
|
">>> render_with_detector(m, im, detector)\n"
|
|
|
|
));
|
2011-10-12 02:05:35 +02:00
|
|
|
|
2011-06-04 02:28:00 +02:00
|
|
|
def("render_layer", &render_layer2,
|
2014-09-13 00:50:00 +02:00
|
|
|
(arg("map"),
|
|
|
|
arg("image"),
|
|
|
|
arg("layer"),
|
|
|
|
arg("scale_factor")=1.0,
|
|
|
|
arg("offset_x")=0,
|
|
|
|
arg("offset_y")=0
|
|
|
|
)
|
2011-11-14 04:54:32 +01:00
|
|
|
);
|
2011-06-04 02:28:00 +02:00
|
|
|
|
2013-07-24 01:37:25 +02:00
|
|
|
#if defined(GRID_RENDERER)
|
2011-06-04 02:28:00 +02:00
|
|
|
def("render_layer", &mapnik::render_layer_for_grid,
|
2014-09-13 00:50:00 +02:00
|
|
|
(arg("map"),
|
|
|
|
arg("grid"),
|
|
|
|
arg("layer"),
|
|
|
|
arg("fields")=boost::python::list(),
|
|
|
|
arg("scale_factor")=1.0,
|
|
|
|
arg("offset_x")=0,
|
|
|
|
arg("offset_y")=0
|
|
|
|
)
|
2011-11-14 04:54:32 +01:00
|
|
|
);
|
2013-07-24 01:37:25 +02:00
|
|
|
#endif
|
2011-11-14 04:54:32 +01:00
|
|
|
|
2008-07-30 09:37:48 +02:00
|
|
|
#if defined(HAVE_CAIRO) && defined(HAVE_PYCAIRO)
|
2009-03-30 06:32:23 +02:00
|
|
|
def("render",&render3,
|
|
|
|
"\n"
|
|
|
|
"Render Map to Cairo Surface using offsets\n"
|
|
|
|
"\n"
|
|
|
|
"Usage:\n"
|
|
|
|
">>> from mapnik import Map, render, load_map\n"
|
|
|
|
">>> from cairo import SVGSurface\n"
|
|
|
|
">>> m = Map(256,256)\n"
|
|
|
|
">>> load_map(m,'mapfile.xml')\n"
|
|
|
|
">>> surface = SVGSurface('image.svg', m.width, m.height)\n"
|
|
|
|
">>> render(m,surface,1,1)\n"
|
|
|
|
"\n"
|
|
|
|
);
|
|
|
|
|
|
|
|
def("render",&render4,
|
|
|
|
"\n"
|
|
|
|
"Render Map to Cairo Surface\n"
|
|
|
|
"\n"
|
|
|
|
"Usage:\n"
|
|
|
|
">>> from mapnik import Map, render, load_map\n"
|
|
|
|
">>> from cairo import SVGSurface\n"
|
|
|
|
">>> m = Map(256,256)\n"
|
|
|
|
">>> load_map(m,'mapfile.xml')\n"
|
|
|
|
">>> surface = SVGSurface('image.svg', m.width, m.height)\n"
|
|
|
|
">>> render(m,surface)\n"
|
|
|
|
"\n"
|
|
|
|
);
|
|
|
|
|
|
|
|
def("render",&render5,
|
|
|
|
"\n"
|
|
|
|
"Render Map to Cairo Context using offsets\n"
|
|
|
|
"\n"
|
|
|
|
"Usage:\n"
|
|
|
|
">>> from mapnik import Map, render, load_map\n"
|
|
|
|
">>> from cairo import SVGSurface, Context\n"
|
|
|
|
">>> surface = SVGSurface('image.svg', m.width, m.height)\n"
|
|
|
|
">>> ctx = Context(surface)\n"
|
2011-11-14 04:54:32 +01:00
|
|
|
">>> load_map(m,'mapfile.xml')\n"
|
2009-03-30 06:32:23 +02:00
|
|
|
">>> render(m,context,1,1)\n"
|
|
|
|
"\n"
|
|
|
|
);
|
|
|
|
|
|
|
|
def("render",&render6,
|
|
|
|
"\n"
|
|
|
|
"Render Map to Cairo Context\n"
|
|
|
|
"\n"
|
|
|
|
"Usage:\n"
|
|
|
|
">>> from mapnik import Map, render, load_map\n"
|
|
|
|
">>> from cairo import SVGSurface, Context\n"
|
|
|
|
">>> surface = SVGSurface('image.svg', m.width, m.height)\n"
|
|
|
|
">>> ctx = Context(surface)\n"
|
|
|
|
">>> load_map(m,'mapfile.xml')\n"
|
|
|
|
">>> render(m,context)\n"
|
|
|
|
"\n"
|
|
|
|
);
|
2012-08-25 11:43:31 +02:00
|
|
|
|
|
|
|
def("render_with_detector", &render_with_detector2,
|
|
|
|
"\n"
|
|
|
|
"Render Map to Cairo Context using a pre-constructed detector.\n"
|
|
|
|
"\n"
|
|
|
|
"Usage:\n"
|
|
|
|
">>> from mapnik import Map, LabelCollisionDetector, render_with_detector, load_map\n"
|
|
|
|
">>> from cairo import SVGSurface, Context\n"
|
|
|
|
">>> surface = SVGSurface('image.svg', m.width, m.height)\n"
|
|
|
|
">>> ctx = Context(surface)\n"
|
|
|
|
">>> m = Map(256,256)\n"
|
|
|
|
">>> load_map(m,'mapfile.xml')\n"
|
|
|
|
">>> detector = LabelCollisionDetector(m)\n"
|
|
|
|
">>> render_with_detector(m, ctx, detector)\n"
|
|
|
|
);
|
|
|
|
|
|
|
|
def("render_with_detector", &render_with_detector3,
|
|
|
|
"\n"
|
|
|
|
"Render Map to Cairo Context using a pre-constructed detector, scale and offsets.\n"
|
|
|
|
"\n"
|
|
|
|
"Usage:\n"
|
|
|
|
">>> from mapnik import Map, LabelCollisionDetector, render_with_detector, load_map\n"
|
|
|
|
">>> from cairo import SVGSurface, Context\n"
|
|
|
|
">>> surface = SVGSurface('image.svg', m.width, m.height)\n"
|
|
|
|
">>> ctx = Context(surface)\n"
|
|
|
|
">>> m = Map(256,256)\n"
|
|
|
|
">>> load_map(m,'mapfile.xml')\n"
|
|
|
|
">>> detector = LabelCollisionDetector(m)\n"
|
|
|
|
">>> render_with_detector(m, ctx, detector, 1, 1, 1)\n"
|
|
|
|
);
|
|
|
|
|
|
|
|
def("render_with_detector", &render_with_detector4,
|
|
|
|
"\n"
|
|
|
|
"Render Map to Cairo Surface using a pre-constructed detector.\n"
|
|
|
|
"\n"
|
|
|
|
"Usage:\n"
|
|
|
|
">>> from mapnik import Map, LabelCollisionDetector, render_with_detector, load_map\n"
|
|
|
|
">>> from cairo import SVGSurface, Context\n"
|
|
|
|
">>> surface = SVGSurface('image.svg', m.width, m.height)\n"
|
|
|
|
">>> m = Map(256,256)\n"
|
|
|
|
">>> load_map(m,'mapfile.xml')\n"
|
|
|
|
">>> detector = LabelCollisionDetector(m)\n"
|
|
|
|
">>> render_with_detector(m, surface, detector)\n"
|
|
|
|
);
|
|
|
|
|
|
|
|
def("render_with_detector", &render_with_detector5,
|
|
|
|
"\n"
|
|
|
|
"Render Map to Cairo Surface using a pre-constructed detector, scale and offsets.\n"
|
|
|
|
"\n"
|
|
|
|
"Usage:\n"
|
|
|
|
">>> from mapnik import Map, LabelCollisionDetector, render_with_detector, load_map\n"
|
|
|
|
">>> from cairo import SVGSurface, Context\n"
|
|
|
|
">>> surface = SVGSurface('image.svg', m.width, m.height)\n"
|
|
|
|
">>> m = Map(256,256)\n"
|
|
|
|
">>> load_map(m,'mapfile.xml')\n"
|
|
|
|
">>> detector = LabelCollisionDetector(m)\n"
|
|
|
|
">>> render_with_detector(m, surface, detector, 1, 1, 1)\n"
|
|
|
|
);
|
|
|
|
|
2008-03-12 20:14:51 +01:00
|
|
|
#endif
|
2009-03-30 06:32:23 +02:00
|
|
|
|
|
|
|
def("scale_denominator", &scale_denominator,
|
2013-02-21 03:02:28 +01:00
|
|
|
(arg("map"),arg("is_geographic")),
|
2009-03-30 06:32:23 +02:00
|
|
|
"\n"
|
|
|
|
"Return the Map Scale Denominator.\n"
|
|
|
|
"Also available as Map.scale_denominator()\n"
|
|
|
|
"\n"
|
|
|
|
"Usage:\n"
|
|
|
|
"\n"
|
|
|
|
">>> from mapnik import Map, Projection, scale_denominator, load_map\n"
|
|
|
|
">>> m = Map(256,256)\n"
|
|
|
|
">>> load_map(m,'mapfile.xml')\n"
|
|
|
|
">>> scale_denominator(m,Projection(m.srs).geographic)\n"
|
|
|
|
"\n"
|
|
|
|
);
|
2011-11-14 04:54:32 +01:00
|
|
|
|
2010-11-15 04:30:23 +01:00
|
|
|
def("load_map", &load_map, load_map_overloads());
|
2009-03-30 06:32:23 +02:00
|
|
|
|
2010-11-15 04:30:23 +01:00
|
|
|
def("load_map_from_string", &load_map_string, load_map_string_overloads());
|
2009-03-30 06:32:23 +02:00
|
|
|
|
2010-11-15 04:30:23 +01:00
|
|
|
def("save_map", &save_map, save_map_overloads());
|
2009-04-28 23:44:34 +02:00
|
|
|
/*
|
2010-06-02 13:03:30 +02:00
|
|
|
"\n"
|
|
|
|
"Save Map object to XML file\n"
|
|
|
|
"\n"
|
|
|
|
"Usage:\n"
|
|
|
|
">>> from mapnik import Map, load_map, save_map\n"
|
|
|
|
">>> m = Map(256,256)\n"
|
|
|
|
">>> load_map(m,'mapfile_wgs84.xml')\n"
|
|
|
|
">>> m.srs\n"
|
2010-08-10 20:18:31 +02:00
|
|
|
"'+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs'\n"
|
2010-06-02 13:03:30 +02:00
|
|
|
">>> m.srs = '+init=espg:3395'\n"
|
|
|
|
">>> save_map(m,'mapfile_mercator.xml')\n"
|
|
|
|
"\n"
|
|
|
|
);
|
2009-04-28 23:44:34 +02:00
|
|
|
*/
|
2011-11-14 04:54:32 +01:00
|
|
|
|
2010-11-15 04:30:23 +01:00
|
|
|
def("save_map_to_string", &save_map_to_string, save_map_to_string_overloads());
|
2009-03-30 06:32:23 +02:00
|
|
|
def("mapnik_version", &mapnik_version,"Get the Mapnik version number");
|
2012-03-15 01:26:50 +01:00
|
|
|
def("mapnik_version_string", &mapnik_version_string,"Get the Mapnik version string");
|
2013-07-24 01:37:25 +02:00
|
|
|
def("has_proj4", &has_proj4, "Get proj4 status");
|
2010-06-03 21:50:27 +02:00
|
|
|
def("has_jpeg", &has_jpeg, "Get jpeg read/write support status");
|
2013-07-24 01:37:25 +02:00
|
|
|
def("has_png", &has_png, "Get png read/write support status");
|
2013-08-24 00:18:00 +02:00
|
|
|
def("has_tiff", &has_tiff, "Get tiff read/write support status");
|
|
|
|
def("has_webp", &has_webp, "Get webp read/write support status");
|
2014-08-22 01:15:35 +02:00
|
|
|
def("has_svg_renderer", &has_svg_renderer, "Get svg_renderer status");
|
2013-07-24 01:37:25 +02:00
|
|
|
def("has_grid_renderer", &has_grid_renderer, "Get grid_renderer status");
|
2009-05-24 06:25:51 +02:00
|
|
|
def("has_cairo", &has_cairo, "Get cairo library status");
|
2009-07-28 08:27:10 +02:00
|
|
|
def("has_pycairo", &has_pycairo, "Get pycairo module status");
|
2009-10-19 16:22:11 +02:00
|
|
|
|
2012-09-14 23:17:45 +02:00
|
|
|
python_optional<mapnik::font_set>();
|
2012-02-08 20:39:09 +01:00
|
|
|
python_optional<mapnik::color>();
|
|
|
|
python_optional<mapnik::box2d<double> >();
|
2012-08-21 02:17:37 +02:00
|
|
|
python_optional<mapnik::composite_mode_e>();
|
2012-02-08 20:39:09 +01:00
|
|
|
python_optional<mapnik::datasource::geometry_t>();
|
|
|
|
python_optional<std::string>();
|
|
|
|
python_optional<unsigned>();
|
|
|
|
python_optional<double>();
|
2012-07-31 03:31:21 +02:00
|
|
|
python_optional<float>();
|
2012-02-08 20:39:09 +01:00
|
|
|
python_optional<bool>();
|
2012-10-29 10:50:37 +01:00
|
|
|
python_optional<int>();
|
2012-02-08 20:39:09 +01:00
|
|
|
python_optional<mapnik::text_transform_e>();
|
2009-12-16 21:02:06 +01:00
|
|
|
register_ptr_to_python<mapnik::expression_ptr>();
|
|
|
|
register_ptr_to_python<mapnik::path_expression_ptr>();
|
2011-12-02 22:37:26 +01:00
|
|
|
to_python_converter<mapnik::value_holder,mapnik_param_to_python>();
|
2011-07-27 04:36:59 +02:00
|
|
|
to_python_converter<mapnik::value,mapnik_value_to_python>();
|
2013-12-05 17:31:30 +01:00
|
|
|
to_python_converter<mapnik::enumeration_wrapper,mapnik_enumeration_wrapper_to_python>();
|
2006-02-01 00:09:52 +01:00
|
|
|
}
|