-
-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
consistently use namespaces everywhere
- Loading branch information
Showing
19 changed files
with
148 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
* | ||
* This file is part of pyosmium. (https://osmcode.org/pyosmium/) | ||
* | ||
* Copyright (C) 2023 Sarah Hoffmann <[email protected]> and others. | ||
* Copyright (C) 2024 Sarah Hoffmann <[email protected]> and others. | ||
* For a full list of authors see the git log. | ||
*/ | ||
#ifndef PYOSMIUM_CAST_H | ||
|
@@ -122,6 +122,6 @@ T const &cast_list(pybind11::object const &o) { | |
return o.attr("_list").cast<T const &>(); | ||
} | ||
|
||
} | ||
} // namespace | ||
|
||
#endif // PYOSMIUM_CAST_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,7 +29,7 @@ class EmptyTagFilter : public pyosmium::BaseFilter | |
|
||
}; | ||
|
||
} | ||
} // namespace | ||
|
||
namespace pyosmium { | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
* | ||
* This file is part of pyosmium. (https://osmcode.org/pyosmium/) | ||
* | ||
* Copyright (C) 2023 Sarah Hoffmann <[email protected]> and others. | ||
* Copyright (C) 2024 Sarah Hoffmann <[email protected]> and others. | ||
* For a full list of authors see the git log. | ||
*/ | ||
#include <pybind11/pybind11.h> | ||
|
@@ -21,6 +21,8 @@ | |
namespace py = pybind11; | ||
namespace og = osmium::geom; | ||
|
||
namespace { | ||
|
||
struct WKBFactory : osmium::geom::WKBFactory<> | ||
{ | ||
public: | ||
|
@@ -46,7 +48,7 @@ void make_factory_class(py::module_ &m, char const *name, char const *doc) | |
if (py::isinstance<osmium::Location>(o)) { | ||
return f.create_point(o.cast<osmium::Location const &>()); | ||
} | ||
auto const *node = pyosmium::try_cast<COSMNode>(o); | ||
auto const *node = pyosmium::try_cast<pyosmium::COSMNode>(o); | ||
if (node) { | ||
return f.create_point(*node->get()); | ||
} | ||
|
@@ -57,7 +59,7 @@ void make_factory_class(py::module_ &m, char const *name, char const *doc) | |
"Create a point geometry from a :py:class:`osmium.osm.Node`.") | ||
.def("create_linestring", | ||
[](Factory &f, py::object const &o, og::use_nodes un, og::direction dir) { | ||
auto const *way = pyosmium::try_cast<COSMWay>(o); | ||
auto const *way = pyosmium::try_cast<pyosmium::COSMWay>(o); | ||
if (way) { | ||
return f.create_linestring(*way->get(), un, dir); | ||
} | ||
|
@@ -69,13 +71,15 @@ void make_factory_class(py::module_ &m, char const *name, char const *doc) | |
"Create a LineString geometry from a :py:class:`osmium.osm.Way`.") | ||
.def("create_multipolygon", | ||
[](Factory &f, py::object const &o) { | ||
return f.create_multipolygon(*pyosmium::cast<COSMArea>(o).get()); | ||
return f.create_multipolygon(*pyosmium::cast<pyosmium::COSMArea>(o).get()); | ||
}, | ||
py::arg("area"), | ||
"Create a MultiPolygon geometry from a :py:class:`osmium.osm.Area`.") | ||
; | ||
} | ||
|
||
} // namespace | ||
|
||
PYBIND11_MODULE(geom, m) | ||
{ | ||
py::enum_<og::use_nodes>(m, "use_nodes") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
* | ||
* This file is part of pyosmium. (https://osmcode.org/pyosmium/) | ||
* | ||
* Copyright (C) 2023 Sarah Hoffmann <[email protected]> and others. | ||
* Copyright (C) 2024 Sarah Hoffmann <[email protected]> and others. | ||
* For a full list of authors see the git log. | ||
*/ | ||
#include <pybind11/pybind11.h> | ||
|
@@ -19,7 +19,7 @@ class FileBuffer : public osmium::io::File | |
using osmium::io::File::File; | ||
}; | ||
|
||
} | ||
} // namespace | ||
|
||
|
||
PYBIND11_MODULE(io, m) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.