boost-geometry

What does boost::geometry::intersection return

房东的猫 提交于 2020-08-10 12:59:50
问题 The documentation for boost::geometry::intersection ( https://www.boost.org/doc/libs/1_73_0/libs/geometry/doc/html/geometry/reference/algorithms/intersection/intersection_3.html ) says the function returns a bool. However the docs do NOT say what the return value indicates. I guessed it would return true if an intersection was found. Wrong!!! This code #include <iostream> #include <deque> #include <boost/geometry.hpp> #include <boost/geometry/geometries/register/point.hpp> namespace bg =

C++ Boost Geometry error: no matching function for call to 'assertion_failed'

删除回忆录丶 提交于 2020-07-05 10:18:46
问题 I am trying to test if a Polygon is contained within another Polygon using Boost library. I just started writing my code using this as an example, and got a massive compile error even before I could begin my main block. (It was so massive SO threw an error stating question body length exceeded limit of 30000 chars). My code goes as #include <boost/geometry.hpp> #include <boost/geometry/geometries/point_xy.hpp> #include <boost/geometry/geometries/polygon.hpp> int main(int argc, char** argv) {

boost geometry precision loss

人走茶凉 提交于 2020-01-17 04:49:07
问题 #include <iostream> #include <vector> #include <boost/geometry.hpp> #include <boost/geometry/strategies/cartesian/distance_pythagoras.hpp> #include <boost/geometry/geometries/point_xy.hpp> #include <boost/geometry/geometries/polygon.hpp> #include <boost/geometry/geometries/linestring.hpp> #include <boost/geometry/multi/geometries/multi_polygon.hpp> #include <boost/geometry/io/wkt/wkt.hpp> #include <boost/foreach.hpp> int main(int argc, char *argv[]) { typedef boost::geometry::model::d2::point

Create solid polygon in boost geometry

风格不统一 提交于 2020-01-13 20:34:14
问题 I'm newbie at boost geometry, I have created polygon with boost::geometry::assign_points() . But I only create outer and inner of that polygon is empty. So I try test boost::geometry::overlaps() with two polygons A, B and A is inside B, result is not overlaps. So, What can I do to create solid polygon (only know outer point of polygon and inside of polygon is valid) ? 回答1: Polygons are by definition solid until you subtract inner rings. From §6.1.11.1 from the standard¹: A Polygon is a planar

Boost intersection

﹥>﹥吖頭↗ 提交于 2020-01-06 02:30:07
问题 I have a problem with boost intersection algorithm. I am not sure if I did an error or it is a bug. #include <boost/geometry/algorithms/intersection.hpp> #include <boost/version.hpp> #include <boost/geometry.hpp> #include <boost/geometry/geometries/point_xy.hpp> #include <boost/geometry/geometries/ring.hpp> #include <boost/geometry/geometries/polygon.hpp> int main() { typedef boost::geometry::model::d2::point_xy<double> BoostPointXY; typedef boost::geometry::model::polygon<BoostPointXY>

How to use Boost::Geometry _union with integers

≯℡__Kan透↙ 提交于 2019-12-31 05:01:05
问题 I'm trying to use Boost::Geometry _union with integers, for both performance and numeric accuracy. For that, I multiply the coordinates of my input with 10,000. Thus creating coordinates with up to 9 digits. I figured that since I use 64-bit integers, that should work well. Unfortunately, when I run the code, I get strange results (the output polygon includes a point that is far from any polygon in the input). Investigating the code of Boost::Geometry brought me to the conclusion that the

CMake Boost 1.59.0 geometry

霸气de小男生 提交于 2019-12-24 17:42:02
问题 I am fairly new to using boost along with C++. I have just installed Boost 1.59.0 and I want to use the geometry library. If I include FIND_PACKAGE( Boost 1.47 REQUIRED ) it finds boost and no problems arises. If I then include FIND_PACKAGE( Boost 1.47 COMPONENTS geometry REQUIRED ) I get the following error: Unable to find the requested Boost libraries. Boost version: 1.59.0 Boost include path: /usr/include Could not find the following Boost libraries: boost_geometry No Boost libraries were

Defining a dimensional point in Boost.Geometry

寵の児 提交于 2019-12-24 13:53:58
问题 I am struggling to define and fill a point in d dimensions. To be exact, I exploited that letting Boost.Geometry handle any dimension by the user, is impossible (that is what I saw from the docs and their mailing list). So, I am trying to define a 100D or 10000D dimension point. Here is the code, where my attempts and the help from their list developed: #include <boost/geometry.hpp> #include <boost/geometry/geometries/point.hpp> #include <boost/geometry/index/rtree.hpp> namespace bg = boost:

does it matter in boost geometry c++ library the order of points I add?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-24 11:13:22
问题 I'm a total newbie with boost and even more with boost-geometry, so my question is... Does it matter to boost-geometry the order in which I add points to a polygon? Eg: Is this the same? // create a polygon polygon p; p.outer().push_back(point(0, 0)); p.outer().push_back(point(0, 10)); p.outer().push_back(point(10, 0)); p.outer().push_back(point(10, 10)); // create a polygon the same polygon? polygon p; p.outer().push_back(point(0, 0)); p.outer().push_back(point(0, 10)); p.outer().push_back

Distance in the Boost::geometry negative buffer

你说的曾经没有我的故事 提交于 2019-12-23 17:22:07
问题 I continue from this post: Negative buffer of Boost::geometry::multi_polygon I am making some more tests to undrestand what is going on with the distance strategy when this distance is negative. Using the code below, I got empty MultiPolygons for some values of the buffer. This case only appears with the polygon imported from the given WKT for a buffer of -1e-4, -1e-5 or -1e-6. But it is not empty for -1e-7 and -1e-8. Could someone explain me why please? #include <iostream> #include <iomanip>