Discuss Boost.Geometry (Generic Geometry Library) - https://github.com/boostorg/geometry
barendgehrels on develop
[coordinate] deprecate util/pro… [intersection] use balance betw… [test] enhance/fix robustness t… (compare)
barendgehrels on select_a_b
[coordinate] deprecate util/pro… [intersection] use balance betw… [test] enhance/fix robustness t… (compare)
You are correct that all of the algorithms are implemented and that the interface would be the most complex part.
But to give you some idea I think that this should be implemented as a more generalized version of the rtree, let's say bounding_tree or similar. So a tree created bottom-up allowing to define any bounding geometry (spheres, oriented bounding boxes, variants. etc.) and additional data stored in the internal nodes. Maybe even allowing to define the exact type of an element stored in the internal node. Then the r-tree would be implemented on top of that.
Aside from user-defined spatial queries it would also be possible to implement user-defined knn queries. E.g. AFAIR there is an experimental version of "path query", i.e. a knn query returning the k nearest values intersecting a linear geometry which could be interpreted as first object hit by a ray or first object found on a driving path or a river, etc. So knn queries could be generalized too.
I'm also not sure if this is a good idea for a GSoC project. I'm only asking because you mentioned GSoC before.
From The PostGIS in Action book at https://livebook.manning.com/book/postgis-in-action-third-edition/chapter-2/v-15/36
Float a bunch of polygons in three-coordinate space and glue them together at their edges, and you’ll form a patchwork referred to as a polyhedral surface. Although polygons make up both multipolygons and polyhedral surfaces, there is one fundamental difference: polygons in multipolygons can’t share edges; polygons in a polyhedral surface almost always do. There are two other notable restrictions in the construction of polyhedral surfaces: polygons can’t overlap, and each edge can be mated with at most one other edge.
However, my point was that @ayushgupta138 comment here :point_up: March 22, 2021 4:59 PM suggested he is misunderstanding the difference and using Polyhedral Surface and Polyhedron interchangeably, what is wrong.
Why I think @ayushgupta138 mismatches these two?
Because the page he referred https://postgis.net/docs/manual-2.0/ST_GeometryN.html does not even use word 'Polyhedron', but he is asking his question about Polyhedron referring to that page.
IOW, communication needs to be precise to avoid side discussion on what is what.
However, my point was that @ayushgupta138 comment here :point_up: March 22, 2021 4:59 PM suggested he is misunderstanding the difference and using Polyhedral Surface and Polyhedron interchangeably, what is wrong.
Yes, I used polyhedron and polyhedral surface interchangeably and it was my fault for doing so. Thanks to @mloskot and @vissarion the difference is clear to me now.