[geos-commits] [SCM] GEOS branch master updated. 4b518f34d55756b4404ae9bcd0840ee80db17eef
git at osgeo.org
git at osgeo.org
Sat Nov 28 12:58:59 PST 2020
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GEOS".
The branch, master has been updated
via 4b518f34d55756b4404ae9bcd0840ee80db17eef (commit)
via ce650cf01a73b08f34662fa2db8667d014584a34 (commit)
from 3e3bf5074031cf86a10a017bddfdf693389a322f (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 4b518f34d55756b4404ae9bcd0840ee80db17eef
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date: Sat Nov 28 12:58:55 2020 -0800
Add another test like the Python tests currently failing
diff --git a/tests/unit/capi/GEOSSTRtreeTest.cpp b/tests/unit/capi/GEOSSTRtreeTest.cpp
index 5d6c2a4..f88807f 100644
--- a/tests/unit/capi/GEOSSTRtreeTest.cpp
+++ b/tests/unit/capi/GEOSSTRtreeTest.cpp
@@ -297,6 +297,42 @@ void object::test<8>
}
+// querying tree with box
+template<>
+template<>
+void object::test<9>
+()
+{
+ GEOSSTRtree* tree = GEOSSTRtree_create(10);
+
+ GEOSGeometry* g = GEOSGeomFromWKT("POINT (2 3)");
+ int payload = 876;
+ GEOSSTRtree_insert(tree, g, &payload);
+
+ GEOSGeometry* q = GEOSGeomFromWKT("POLYGON ((0 0, 10 0, 10 10, 0 10, 0 0))");
+
+ typedef std::vector<int*> IList;
+ IList items;
+ ensure_equals(items.size(), 0);
+ GEOSSTRtree_query(
+ tree,
+ q,
+ [](void* item, void* userdata) {
+ IList* items = (IList*)userdata;
+ items->push_back((int*)item);
+ },
+ &items);
+
+ ensure_equals(items.size(), 1);
+
+ ensure_equals(*(items[0]), payload);
+
+ GEOSGeom_destroy(q);
+ GEOSGeom_destroy(g);
+ GEOSSTRtree_destroy(tree);
+}
+
+
// >>> import pygeos
// >>> pygeos.geos_version
// (3, 9, 0)
commit ce650cf01a73b08f34662fa2db8667d014584a34
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date: Sat Nov 28 12:58:38 2020 -0800
Rename parameter variable shadowing member var
diff --git a/src/index/strtree/SimpleSTRnode.cpp b/src/index/strtree/SimpleSTRnode.cpp
index ee66664..36299f7 100644
--- a/src/index/strtree/SimpleSTRnode.cpp
+++ b/src/index/strtree/SimpleSTRnode.cpp
@@ -74,10 +74,10 @@ SimpleSTRnode::getNumLeafNodes() const
}
bool
-SimpleSTRnode::removeItem(void *item)
+SimpleSTRnode::removeItem(void *itemToRemove)
{
for (auto it = childNodes.begin(); it != childNodes.end(); ++it) {
- if ((*it)->getItem() == item) {
+ if ((*it)->getItem() == itemToRemove) {
childNodes.erase(it);
return true;
}
-----------------------------------------------------------------------
Summary of changes:
src/index/strtree/SimpleSTRnode.cpp | 4 ++--
tests/unit/capi/GEOSSTRtreeTest.cpp | 36 ++++++++++++++++++++++++++++++++++++
2 files changed, 38 insertions(+), 2 deletions(-)
hooks/post-receive
--
GEOS
More information about the geos-commits
mailing list