python bindings - mapnik.LineStirng basic interface

This commit is contained in:
artemp 2015-03-11 14:02:30 +01:00
parent e91389dcd5
commit 696be39119

View file

@ -272,6 +272,7 @@ void export_geometry()
using namespace boost::python; using namespace boost::python;
implicitly_convertible<mapnik::new_geometry::point, mapnik::new_geometry::geometry>(); implicitly_convertible<mapnik::new_geometry::point, mapnik::new_geometry::geometry>();
implicitly_convertible<mapnik::new_geometry::line_string, mapnik::new_geometry::geometry>();
enum_<mapnik::new_geometry::geometry_types>("GeometryType") enum_<mapnik::new_geometry::geometry_types>("GeometryType")
.value("Point",mapnik::new_geometry::geometry_types::Point) .value("Point",mapnik::new_geometry::geometry_types::Point)
@ -290,6 +291,7 @@ void export_geometry()
using mapnik::new_geometry::geometry; using mapnik::new_geometry::geometry;
using mapnik::new_geometry::point; using mapnik::new_geometry::point;
using mapnik::new_geometry::line_string;
class_<point>("Point", init<double, double>((arg("x"), arg("y")), class_<point>("Point", init<double, double>((arg("x"), arg("y")),
"Constructs a new Point object\n")) "Constructs a new Point object\n"))
@ -298,6 +300,12 @@ void export_geometry()
.def("to_geojson",&to_geojson_impl) .def("to_geojson",&to_geojson_impl)
; ;
class_<line_string>("LineString", init<>(
"Constructs a new LineString object\n"))
.def("add_coord", &line_string::add_coord, "Adds coord")
.def("to_geojson",&to_geojson_impl)
;
class_<geometry, std::shared_ptr<geometry>, boost::noncopyable>("Geometry",no_init) class_<geometry, std::shared_ptr<geometry>, boost::noncopyable>("Geometry",no_init)
.def("envelope",&geometry_envelope_impl) .def("envelope",&geometry_envelope_impl)
.def("from_geojson", from_geojson_impl) .def("from_geojson", from_geojson_impl)