mirror of
https://github.com/mapnik/mapnik.git
synced 2025-12-08 20:13:09 +00:00
make point implicitly_convertible to geometry + to_geojson()
This commit is contained in:
parent
f0798a8ae3
commit
e91389dcd5
@ -271,6 +271,8 @@ void export_geometry()
|
||||
{
|
||||
using namespace boost::python;
|
||||
|
||||
implicitly_convertible<mapnik::new_geometry::point, mapnik::new_geometry::geometry>();
|
||||
|
||||
enum_<mapnik::new_geometry::geometry_types>("GeometryType")
|
||||
.value("Point",mapnik::new_geometry::geometry_types::Point)
|
||||
.value("LineString",mapnik::new_geometry::geometry_types::LineString)
|
||||
@ -293,6 +295,7 @@ void export_geometry()
|
||||
"Constructs a new Point object\n"))
|
||||
.add_property("x", &point::x, "X coordinate")
|
||||
.add_property("y", &point::y, "Y coordinate")
|
||||
.def("to_geojson",&to_geojson_impl)
|
||||
;
|
||||
|
||||
class_<geometry, std::shared_ptr<geometry>, boost::noncopyable>("Geometry",no_init)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user