Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
zhixiong-tang committed Oct 3, 2024
1 parent c426d74 commit fa81a43
Showing 1 changed file with 8 additions and 18 deletions.
26 changes: 8 additions & 18 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,21 @@ using rvp = py::return_value_policy;

namespace cubao
{
void bind_geojson(py::module &m);
void bind_rapidjson(py::module &m);
void bind_geojson(py::module &m);
void bind_crs_transform(py::module &m);
} // namespace cubao

PYBIND11_MODULE(_core, m)
{
using namespace mapbox::geobuf;

cubao::bind_rapidjson(m);
auto geojson = m.def_submodule("geojson");
cubao::bind_geojson(geojson);
auto tf = m.def_submodule("tf");
cubao::bind_crs_transform(tf);

m.def(
"normalize_json",
[](const std::string &input, const std::string &output, bool indent,
Expand Down Expand Up @@ -247,8 +253,7 @@ PYBIND11_MODULE(_core, m)
"Get the dimension of the encoded coordinates (2 or 3).")
.def("e", &Encoder::__e,
"Get the encoding factor used for coordinate precision.")
.def("keys", &Encoder::__keys,
"Get the list of keys used in the encoded data.")
.def("keys", &Encoder::__keys, "Get keys used in the encoded data.")
.def(
"encode",
[](Encoder &self, const mapbox::geojson::geojson &geojson) {
Expand Down Expand Up @@ -358,13 +363,6 @@ PYBIND11_MODULE(_core, m)
Returns:
Bool: succ or not.
)docstring")
.def("keys", &Encoder::__keys,
R"docstring(
Get the list of keys used in the encoding process.
Returns:
list: A list of strings representing the keys used during encoding.
)docstring")
//
;

Expand Down Expand Up @@ -526,9 +524,6 @@ PYBIND11_MODULE(_core, m)
//
;

auto geojson = m.def_submodule("geojson");
cubao::bind_geojson(geojson);

using namespace FlatGeobuf;
py::class_<NodeItem>(m, "NodeItem", py::module_local())
.def_property_readonly(
Expand Down Expand Up @@ -940,11 +935,6 @@ PYBIND11_MODULE(_core, m)
//
;

cubao::bind_rapidjson(m);

auto tf = m.def_submodule("tf");
cubao::bind_crs_transform(tf);

#ifdef VERSION_INFO
m.attr("__version__") = MACRO_STRINGIFY(VERSION_INFO);
#else
Expand Down

0 comments on commit fa81a43

Please sign in to comment.