Questions tagged [boost-geometry]

Boost.Geometry is a template C++ library, included in Boost. It contains geometry classes (such as point, linestring, polygon) and functions (such as distance, intersection, union). Boost.Geometry is Concept based and users can use their own models of e.g. point.

Boost.Geometry (aka Generic Geometry Library, GGL), part of collection of the Boost C++ Libraries, defines concepts, primitives and algorithms for solving geometry problems.

Boost.Geometry contains a dimension-agnostic, coordinate-system-agnostic and scalable kernel, based on concepts, meta-functions and tag dispatching. On top of that kernel, algorithms are built: area, length, perimeter, centroid, convex hull, intersection (clipping), within (point in polygon), distance, envelope (bounding box), simplify, transform, and much more. The library supports high precision arithmetic numbers, such as ttmath.

Boost.Geometry contains instantiable geometry classes, but library users can also use their own. Using registration macros or traits classes their geometries can be adapted to fulfill Boost.Geometry concepts.

Boost.Geometry might be used in all domains where geometry plays a role: mapping and GIS, game development, computer graphics and widgets, robotics, astronomy and more. The core is designed to be as generic as possible and support those domains. Currently, the development has been mostly GIS-oriented.

More information on the Documentation.

Download from Boost download page.

Source code is also available at GitHub.

Contact developers at the Boost.Geometry mailing list or Boost-users mailing list.

348 questions
0
votes
1 answer

Finding a point inside a Boost::Geometry::Polygon

I have a Polygon object and I'm looking for an efficient way to find any point strictly inside it (not on its boundary). What is the best way to do so? I had the following ideas, which I don't really like: Triangulating the polygon and reporting a…
snakile
  • 47,358
  • 57
  • 160
  • 231
0
votes
1 answer

Query for intersection with boost::geometry::index::rtree

I'm having instance of boost::geometry::index::rtree of axis aligned boxes in three dimensions. I'm already using point intersection in 1.54 version of the boost. Works like charm. Well, I'd like also to query for intersection with line (ray,…
thb
  • 3
  • 2
0
votes
1 answer

Geometry, intersection

I have a problem. I would like to intersect a quad with a quad. int main(){ typedef boost::geometry::model::point_xy TBoostPoint; typedef boost::geometry::model::polygon TBoostPoly; TBoostPoint point; TBoostPoly…
0
votes
1 answer

boost::geometry polygon's outer() has wrong coordinates after polygon is rotated

I'm using boost 1.56-rhel5 version. After a polygon is rotated, when I use outer() to get all the points of the polygon, and then get their coordinates, there is wrong coordinate result. Here is my code: #include #include…
Bin Li
  • 7
  • 5
0
votes
1 answer

boost geometry precision loss

#include #include #include #include #include #include #include…
0
votes
1 answer

Intersection Line Poly boost geometry

I want to calculate the intersection point between a line: l := direction * x + origin for x e R or x e [0,R+) and a default Boost polygon. In the documentation I only found the possibility to get the intersection with a line Segment (fixed start…
Hunk
  • 419
  • 7
  • 29
0
votes
1 answer

Calculating distance from point to voronoi cell with boost

Good night. Has anyone encountered a similar problem? Constructing Voronoi diagram has not caused problems. Voronoi cell is a polygon, at least for me. The library also allows you to find the distance from a point to a polygon. But the library…
Inly
  • 1
0
votes
1 answer

Boost geometry intersection does not output correctly

From the following code I calculate the intersection of two polygons. I hope the output can be NULL if it is not polygon. However the output is (((240, 52.9999), (240, 53), (240, 53), (240, 52.9999))). This is not a polygon. Is there any way to…
Jun
  • 379
  • 1
  • 4
  • 12
0
votes
1 answer

Boost geometry union with auto-allocation

#include #include #include #include #include using namespace boost::geometry; class CustomPoint{ public: double X; …
Hunk
  • 419
  • 7
  • 29
0
votes
1 answer

Boost error in has_new_operator.hpp when debugging

I'm using VC-Express 2013. I have integrated a header from a different project that utilized the boost library and when compiling in releasemode everything is fine. When I'm trying to compile in debug-mode I'm getting several of the following…
user3049681
  • 267
  • 3
  • 11
0
votes
1 answer

How to override the floating point tolerance in the boost::geometry::equals algorithm?

I am using the boost geometry library to compare two different polygons. Specifically, I am using the equals algorithm to see if two polygons are congruent (equal dimensions). The problem is that the tolerance on the algorithm is too tight and two…
Neal Kruis
  • 1,805
  • 2
  • 24
  • 45
0
votes
1 answer

c++11 and boost geometry

I getting started on c++11 and tried to run some example code with boost geometry #include #include #include #include…
Hunk
  • 419
  • 7
  • 29
0
votes
1 answer

boost::geometry::covered_by wrong results

I have a problem with boost::geometry::covered_by method to determine if point is inside polygon or not. In the example below I have point that is exactly out of polygon. Point is far away from polygon by x coordinate (0.1377). The 3rd point of…
0
votes
0 answers

Normal vector of polygon using boost::geometry

I'm trying out boost::geometry and was wondering if you know an efficient way to get the normal vector of the polygon at an intersection between a polygon and a line segment. Or something like the line segment_id of the segment where it intersects?…
0
votes
1 answer

boost polygon difference returns intersection

i am trying to substract one polygon from another with boost::geometry::difference. First of all i create 2 polygons, lets call them red and blue. I know the polygons are created correctly because y plotted them. Now, if i compute the difference…
user3013172
  • 1,273
  • 2
  • 11
  • 20