~ubuntu-branches/ubuntu/trusty/mapnik/trusty-proposed

« back to all changes in this revision

Viewing changes to bindings/python/mapnik_query.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Christophe Sauthier
  • Date: 2009-08-27 00:28:37 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20090827002837-ztqzfg2rmclfh4i9
Tags: 0.6.1-0ubuntu1
* New upstream release.
* Change usr/lib to usr/lib* to enable build on 64 bits systems due to new
  configuration in SConstruct in :
  - debian/libmapnik-dev.install
  - debian/libmapnik0.6.install
  - debian/mapnik-plugin-base

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
#include <boost/python.hpp>
25
25
#include <mapnik/query.hpp>
26
26
#include <mapnik/envelope.hpp>
 
27
using mapnik::query;
 
28
using mapnik::Envelope;
 
29
 
 
30
struct query_pickle_suite : boost::python::pickle_suite
 
31
{
 
32
   static boost::python::tuple
 
33
   getinitargs(const query& q)
 
34
   {
 
35
      return boost::python::make_tuple(q.get_bbox(),q.resolution());  
 
36
   }
 
37
};
27
38
 
28
39
void export_query()
29
40
{
30
41
    using namespace boost::python;
31
42
 
32
 
    using mapnik::query;
33
 
    using mapnik::Envelope;
34
 
 
35
43
    class_<query>("Query", "a spatial query data object", 
36
44
                  init<Envelope<double>,double>() )
 
45
        .def_pickle(query_pickle_suite())
37
46
        .add_property("resolution", &query::resolution)
38
47
        .add_property("bbox", make_function(&query::get_bbox,
39
48
                                            return_value_policy<copy_const_reference>()) )