Skip to content

Commit

Permalink
clean-up
Browse files Browse the repository at this point in the history
  • Loading branch information
jorisvandenbossche committed Nov 14, 2024
1 parent e355904 commit 3dbcdf7
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions src/io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,7 @@ class ToWKB {
}

py::bytes operator()(PyObjectGeography a) const {
auto res = m_writer->WriteFeature(a.as_geog_ptr()->geog());
// manually convert basic_string to python bytes object
auto res_py = PyBytes_FromStringAndSize(reinterpret_cast<const char*>(res.data()),
static_cast<ssize_t>(res.size()));
if (!res_py) {
throw py::error_already_set();
}
return py::reinterpret_steal<py::bytes>(res_py);
return m_writer->WriteFeature(a.as_geog_ptr()->geog());
}

private:
Expand Down

0 comments on commit 3dbcdf7

Please sign in to comment.