|
17 | 17 | namespace py = pybind11; |
18 | 18 | using namespace shapely::geometry; |
19 | 19 | using namespace shapely_py; |
| 20 | +using namespace shapely_py::detail; |
20 | 21 |
|
21 | 22 | // Re-export native_to_array for module-local use (templated) |
22 | 23 | namespace { |
23 | 24 | template <typename T> |
24 | 25 | py::array_t<T> _native_to_array(const T* data, size_t rows, size_t cols) { |
25 | | - return shapely_py::native_to_array(data, rows, cols); |
| 26 | + return shapely_py::detail::native_to_array(data, rows, cols); |
26 | 27 | } |
27 | 28 | } |
28 | 29 |
|
@@ -385,11 +386,14 @@ PYBIND11_MODULE(shapelycpp, m) { |
385 | 386 | m.def("intersects_polygon_polygon", &intersects_poly_poly); |
386 | 387 |
|
387 | 388 | // ====================================================================== |
388 | | - // Project / interpolate (from pycpp) |
| 389 | + // Project / interpolate (inlined from pycpp — no standalone helpers) |
389 | 390 | // ====================================================================== |
390 | | - m.def("project_linestring_point", &project_ls_pt); |
| 391 | + m.def("project_linestring_point", [](const LineString<double>& l, const Point<double>& p) { |
| 392 | + return l.project(p); |
| 393 | + }, py::arg("ls"), py::arg("pt")); |
391 | 394 | m.def("interpolate_linestring", [](const LineString<double>& ls, double dist, bool normalized) { |
392 | | - return interpolate_ls(ls, dist, normalized); |
| 395 | + auto r = ls.interpolate(dist, normalized); |
| 396 | + return std::make_tuple(r.x, r.y); |
393 | 397 | }, py::arg("ls"), py::arg("distance"), py::arg("normalized") = false); |
394 | 398 |
|
395 | 399 | // ====================================================================== |
|
0 commit comments