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

« back to all changes in this revision

Viewing changes to bindings/python/mapnik_coord.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Christophe Sauthier
  • Date: 2010-03-18 01:07:40 UTC
  • mfrom: (1.1.4 upstream) (3.1.5 sid)
  • Revision ID: james.westby@ubuntu.com-20100318010740-u01iy3n0ux9xzzir
Tags: 0.7.0-2ubuntu1
* Merge from debian testing (LP: #526070), remaining changes:
  - Bump boost build-dep and libmapnik-dev depends to boost1.40

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
 *****************************************************************************/
22
22
//$Id$
23
23
 
 
24
// boost
24
25
#include <boost/python.hpp>
 
26
 
 
27
// mapnik
25
28
#include <mapnik/coord.hpp>
26
29
 
27
30
using mapnik::coord;
39
42
void export_coord()
40
43
{
41
44
    using namespace boost::python;
42
 
    class_<coord<double,2> >("Coord",init<double,double>())
 
45
    class_<coord<double,2> >("Coord",init<double, double>( 
 
46
              // class docstring is in mapnik/__init__.py, class _Coord
 
47
              (arg("x"), arg("y")),
 
48
              "Constructs a new point with the given coordinates.\n")
 
49
        )
43
50
        .def_pickle(coord_pickle_suite())
44
 
        .def_readwrite("x", &coord<double,2>::x)
45
 
        .def_readwrite("y", &coord<double,2>::y)
 
51
        .def_readwrite("x", &coord<double,2>::x,
 
52
                       "Gets or sets the x/lon coordinate of the point.\n")
 
53
        .def_readwrite("y", &coord<double,2>::y,
 
54
                       "Gets or sets the y/lat coordinate of the point.\n")
46
55
        .def(self == self) // __eq__
47
56
        .def(self + self) // __add__
48
57
        .def(self + float())
53
62
        .def(float() * self) 
54
63
        .def(self / float()) // __div__
55
64
        ;
56
 
    
57
65
}