diff --git a/bindings/python/mapnik_color.cpp b/bindings/python/mapnik_color.cpp index c628a5e12..ff3a89148 100644 --- a/bindings/python/mapnik_color.cpp +++ b/bindings/python/mapnik_color.cpp @@ -23,7 +23,6 @@ // boost #include -#include //mapnik #include @@ -45,24 +44,18 @@ void export_color () { using namespace boost::python; class_("Color", init( -#if BOOST_VERSION >= 103500 - ( arg("self"), arg("r"), arg("g"), arg("b"), arg("a") ), -#endif + ( arg("r"), arg("g"), arg("b"), arg("a") ), "Creates a new color from its RGB components\n" "and an alpha value.\n" "All values between 0 and 255.\n") ) .def(init( -#if BOOST_VERSION >= 103500 - ( arg("self"), arg("r"), arg("g"), arg("b") ), -#endif + ( arg("r"), arg("g"), arg("b") ), "Creates a new color from its RGB components.\n" "All values between 0 and 255.\n") ) .def(init( -#if BOOST_VERSION >= 103500 - ( arg("self"), arg("color_string") ), -#endif + ( arg("color_string") ), "Creates a new color from its CSS string representation.\n" "The string may be a CSS color name (e.g. 'blue')\n" "or a hex color string (e.g. '#0000ff').\n") @@ -91,9 +84,6 @@ void export_color () .def_pickle(color_pickle_suite()) .def("__str__",&color::to_string) .def("to_hex_string",&color::to_hex_string, -#if BOOST_VERSION >= 103500 - ( arg("self") ), -#endif "Returns the hexadecimal representation of this color.\n" "\n" "Example:\n" @@ -102,4 +92,3 @@ void export_color () "'#0000ff'\n") ; } - diff --git a/bindings/python/mapnik_coord.cpp b/bindings/python/mapnik_coord.cpp index bc078b2fc..0891134af 100644 --- a/bindings/python/mapnik_coord.cpp +++ b/bindings/python/mapnik_coord.cpp @@ -22,7 +22,6 @@ //$Id$ // boost -#include #include // mapnik @@ -43,19 +42,16 @@ struct coord_pickle_suite : boost::python::pickle_suite void export_coord() { using namespace boost::python; - class_ > - ("Coord", - // class docstring is in mapnik/__init__.py, class _Coord - init( -#if BOOST_VERSION >= 103500 - (arg("self"), arg("x"), arg("y")), -#endif - "Constructs a new point with the given coordinates.")) + class_ >("Coord",init( + // class docstring is in mapnik/__init__.py, class _Coord + (arg("x"), arg("y")), + "Constructs a new point with the given coordinates.\n") + ) .def_pickle(coord_pickle_suite()) .def_readwrite("x", &coord::x, - "Gets or sets the x/lon coordinate of the point.") + "Gets or sets the x/lon coordinate of the point.\n") .def_readwrite("y", &coord::y, - "Gets or sets the y/lat coordinate of the point.") + "Gets or sets the y/lat coordinate of the point.\n") .def(self == self) // __eq__ .def(self + self) // __add__ .def(self + float()) diff --git a/bindings/python/mapnik_envelope.cpp b/bindings/python/mapnik_envelope.cpp index dbf0ff5b0..46c6d0512 100644 --- a/bindings/python/mapnik_envelope.cpp +++ b/bindings/python/mapnik_envelope.cpp @@ -22,7 +22,6 @@ //$Id: mapnik_envelope.cc 27 2005-03-30 21:45:40Z pavlenko $ // boost -#include #include // mapnik @@ -69,25 +68,14 @@ void export_envelope() using namespace boost::python; class_ >("Envelope", // class docstring is in mapnik/__init__.py, class _Coord - init - ( -#if BOOST_VERSION >= 103500 - (arg("self"), arg("minx"), arg("miny"), arg("maxx"), arg("maxy")), -#endif + init( + (arg("minx"),arg("miny"),arg("maxx"),arg("maxy")), "Constructs a new envelope from the coordinates\n" - "of its lower left and upper right corner points.")) - .def(init<> - ( -#if BOOST_VERSION >= 103500 - (arg("self")), -#endif - "Equivalent to Envelope(0, 0, -1, -1).")) - .def(init&, const coord&> - ( -#if BOOST_VERSION >= 103500 - (arg("self"), arg("ll"), arg("ur")), -#endif - "Equivalent to Envelope(ll.x, ll.y, ur.x, ur.y).")) + "of its lower left and upper right corner points.\n")) + .def(init<>("Equivalent to Envelope(0, 0, -1, -1).\n")) + .def(init&, const coord&>( + (arg("ll"),arg("ur")), + "Equivalent to Envelope(ll.x, ll.y, ur.x, ur.y).\n")) .add_property("minx", &Envelope::minx, "X coordinate for the lower left corner") .add_property("miny", &Envelope::miny, @@ -97,19 +85,14 @@ void export_envelope() .add_property("maxy", &Envelope::maxy, "Y coordinate for the upper right corner") .def("center", &Envelope::center, -#if BOOST_VERSION >= 103500 - (arg("self")), -#endif "Returns the coordinates of the center of the bounding box.\n" "\n" "Example:\n" ">>> e = Envelope(0, 0, 100, 100)\n" ">>> e.center()\n" - "Coord(50, 50)") + "Coord(50, 50)\n") .def("center", &Envelope::re_center, -#if BOOST_VERSION >= 103500 - (arg("self"), arg("x"), arg("y")), -#endif + (arg("x"), arg("y")), "Moves the envelope so that the given coordinates become its new center.\n" "The width and the height are preserved.\n" "\n " @@ -121,12 +104,10 @@ void export_envelope() ">>> (e.width(), e.height())\n" "(100.0, 100.0)\n" ">>> e\n" - "Envelope(10.0, 10.0, 110.0, 110.0)" + "Envelope(10.0, 10.0, 110.0, 110.0)\n" ) .def("width", width_p1, -#if BOOST_VERSION >= 103500 - (arg("self"), arg("new_width")), -#endif + (arg("new_width")), "Sets the width to new_width of the envelope preserving its center.\n" "\n " "Example:\n" @@ -135,18 +116,13 @@ void export_envelope() ">>> e.center()\n" "Coord(50.0,50.0)\n" ">>> e\n" - "Envelope(-10.0, 0.0, 110.0, 100.0)" + "Envelope(-10.0, 0.0, 110.0, 100.0)\n" ) .def("width", width_p2, -#if BOOST_VERSION >= 103500 - (arg("self")), -#endif - "Returns the width of this envelope." + "Returns the width of this envelope.\n" ) .def("height", height_p1, -#if BOOST_VERSION >= 103500 - (arg("self"), arg("new_height")), -#endif + (arg("new_height")), "Sets the height to new_height of the envelope preserving its center.\n" "\n " "Example:\n" @@ -155,80 +131,59 @@ void export_envelope() ">>> e.center()\n" "Coord(50.0,50.0)\n" ">>> e\n" - "Envelope(0.0, -10.0, 100.0, 110.0)" + "Envelope(0.0, -10.0, 100.0, 110.0)\n" ) .def("height", height_p2, -#if BOOST_VERSION >= 103500 - (arg("self")), -#endif - "Returns the height of this envelope." + "Returns the height of this envelope.\n" ) .def("expand_to_include",expand_to_include_p1, -#if BOOST_VERSION >= 103500 - (arg("self"), arg("x"), arg("y")), -#endif + (arg("x"),arg("y")), "Expands this envelope to include the point given by x and y.\n" "\n" "Example:\n", ">>> e = Envelope(0, 0, 100, 100)\n" ">>> e.expand_to_include(110, 110)\n" ">>> e\n" - "Envelope(0.0, 00.0, 110.0, 110.0)" + "Envelope(0.0, 00.0, 110.0, 110.0)\n" ) .def("expand_to_include",expand_to_include_p2, -#if BOOST_VERSION >= 103500 - (arg("self"), arg("p")), -#endif - "Equivalent to expand_to_include(p.x, p.y)" + (arg("p")), + "Equivalent to expand_to_include(p.x, p.y)\n" ) .def("expand_to_include",expand_to_include_p3, -#if BOOST_VERSION >= 103500 - (arg("self"), arg("other")), -#endif + (arg("other")), "Equivalent to:\n" " expand_to_include(other.minx, other.miny)\n" - " expand_to_include(other.maxx, other.maxy)" + " expand_to_include(other.maxx, other.maxy)\n" ) .def("contains",contains_p1, -#if BOOST_VERSION >= 103500 - (arg("self"), arg("x"), arg("y")), -#endif + (arg("x"),arg("y")), "Returns True iff this envelope contains the point\n" - "given by x and y." + "given by x and y.\n" ) .def("contains",contains_p2, -#if BOOST_VERSION >= 103500 - (arg("self"), arg("p")), -#endif - "Equivalent to contains(p.x, p.y)" + (arg("p")), + "Equivalent to contains(p.x, p.y)\n" ) .def("contains",contains_p3, -#if BOOST_VERSION >= 103500 - (arg("self"), arg("other")), -#endif + (arg("other")), "Equivalent to:\n" - " contains(other.minx, other.miny) and contains(other.maxx, other.maxy)" + " contains(other.minx, other.miny) and contains(other.maxx, other.maxy)\n" ) .def("intersects",intersects_p1, -#if BOOST_VERSION >= 103500 - (arg("self"), arg("x"), arg("y")), -#endif + (arg("x"),arg("y")), "Returns True iff this envelope intersects the point\n" "given by x and y.\n" "\n" "Note: For points, intersection is equivalent\n" "to containment, i.e. the following holds:\n" - " e.contains(x, y) == e.intersects(x, y)" + " e.contains(x, y) == e.intersects(x, y)\n" ) .def("intersects",intersects_p2, -#if BOOST_VERSION >= 103500 - (arg("self"), arg("p")), -#endif - "Equivalent to contains(p.x, p.y)") + (arg("p")), + "Equivalent to contains(p.x, p.y)\n") .def("intersects",intersects_p3, -#if BOOST_VERSION >= 103500 - (arg("self"), arg("other")), -#endif + (arg("other")), "Returns True iff this envelope intersects the other envelope,\n" "This relationship is symmetric." "\n" @@ -238,12 +193,10 @@ void export_envelope() ">>> e1.intersects(e2)\n" "True\n" ">>> e1.contains(e2)\n" - "False" + "False\n" ) .def("intersect",intersect, -#if BOOST_VERSION >= 103500 - (arg("self"), arg("other")), -#endif + (arg("other")), "Returns the overlap of this envelope and the other envelope\n" "as a new envelope.\n" "\n" @@ -251,7 +204,7 @@ void export_envelope() ">>> e1 = Envelope(0, 0, 100, 100)\n" ">>> e2 = Envelope(50, 50, 150, 150)\n" ">>> e1.intersect(e2)\n" - "Envelope(50.0, 50.0, 100.0, 100.0)" + "Envelope(50.0, 50.0, 100.0, 100.0)\n" ) .def(self == self) // __eq__ .def(self + self) // __add__ diff --git a/bindings/python/mapnik_map.cpp b/bindings/python/mapnik_map.cpp index 1609d3b8c..dc36bae7b 100644 --- a/bindings/python/mapnik_map.cpp +++ b/bindings/python/mapnik_map.cpp @@ -23,7 +23,6 @@ // boost #include -#include #include #include @@ -147,9 +146,7 @@ void export_map() ; class_("Map","The map object.",init >( -#if BOOST_VERSION >= 103500 - ( arg("self"),arg("width"),arg("height"),arg("srs") ), -#endif + ( arg("width"),arg("height"),arg("srs") ), "Create a Map with a width and height as integers and, optionally,\n" "an srs string either with a Proj.4 epsg code ('+init=epsg:')\n" "or with a Proj.4 literal ('+proj=').\n" diff --git a/bindings/python/mapnik_projection.cpp b/bindings/python/mapnik_projection.cpp index db6060f16..9e246a446 100644 --- a/bindings/python/mapnik_projection.cpp +++ b/bindings/python/mapnik_projection.cpp @@ -22,7 +22,6 @@ //$Id$ //boost -#include #include // mapnik @@ -90,31 +89,24 @@ void export_projection () { using namespace boost::python; - class_ - ("Projection", "Represents a map projection.", - init > - ( -#if BOOST_VERSION >= 103500 - (arg("self"), arg("proj4_string")), -#endif - "Constructs a new projection from its PROJ.4 string representation.\n" - "\n" - "The parameterless version of this constructor is equivalent to\n" - " Projection('+proj=latlong +ellps=WGS84')\n" - "\n" - "The constructor will throw a RuntimeError in case the projection\n" - "cannot be initialized.")) + class_("Projection", "Represents a map projection.",init >( + (arg("proj4_string")), + "Constructs a new projection from its PROJ.4 string representation.\n" + "\n" + "The parameterless version of this constructor is equivalent to\n" + " Projection('+proj=latlong +ellps=WGS84')\n" + "\n" + "The constructor will throw a RuntimeError in case the projection\n" + "cannot be initialized.\n" + ) + ) .def_pickle(projection_pickle_suite()) .def ("params", make_function(&projection::params, - return_value_policy() -#if BOOST_VERSION >= 103500 - , arg("self") -#endif - ), - "Returns the PROJ.4 string for this projection.") + return_value_policy()), + "Returns the PROJ.4 string for this projection.\n") .add_property ("geographic", &projection::is_geographic, - "This property is True if the projection is a geographic projection\n" - "(i.e. it uses lon/lat coordinates)") + "This property is True if the projection is a geographic projection\n" + "(i.e. it uses lon/lat coordinates)\n") ; def("forward_",&forward_pt); diff --git a/bindings/python/mapnik_stroke.cpp b/bindings/python/mapnik_stroke.cpp index ebb0226a0..189d46d73 100644 --- a/bindings/python/mapnik_stroke.cpp +++ b/bindings/python/mapnik_stroke.cpp @@ -23,7 +23,6 @@ // boost #include -#include // mapnik #include @@ -131,14 +130,9 @@ void export_stroke () ; class_("Stroke",init<>( -#if BOOST_VERSION >= 103500 - ( arg("self") ), -#endif "Creates a new default black stroke with the width of 1.\n")) .def(init( -#if BOOST_VERSION >= 103500 - ( arg("self"), arg("color"), arg("width") ), -#endif + (arg("color"),arg("width")), "Creates a new stroke object with a specified color and width.\n") ) .def_pickle(stroke_pickle_suite()) @@ -166,14 +160,9 @@ void export_stroke () "Returns the line join mode of this stroke.\n") // todo consider providing a single get/set property .def("add_dash",&stroke::add_dash, -#if BOOST_VERSION >= 103500 - ( arg("self"), arg("length"), arg("gap") ), -#endif + (arg("length"),arg("gap")), "Adds a dash segment to the dash patterns of this stroke.\n") .def("get_dashes", get_dashes_list, -#if BOOST_VERSION >= 103500 - ( arg("self") ), -#endif "Returns the list of dash segments for this stroke.\n") ; }