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
4
votes
1 answer

Cannot remove element from boost::geometry::index::rtree by its index

I'm creating a boost geometry rtree. From the sample page I create: typedef bg::model::point point; typedef bg::model::box box; typedef std::pair value; I want to add value elements to the…
Jepessen
  • 9,377
  • 11
  • 64
  • 111
4
votes
0 answers

MySQL 5.7: Invalid GIS data

The following query seems to be working just fine under MySQL 5.6 (returns 0 for the Area), but on MySQL 5.7 it returns an error saying ERROR 3037 (22023): Invalid GIS data provided to function st_area.. SELECT ST_Area(GeomFromText('POLYGON((0 0, 0…
uri2x
  • 3,012
  • 1
  • 9
  • 22
4
votes
1 answer

Boost::geometry How do you add polygons to a multi_polygon

I want to create a boost::geometry::model::multi_polygon by adding boost::geometry::model::polygons to it in a loop. I've looked through boost's examples and documentation but they are unclear how to do it. Here is the code I have typedef…
Matthew Lueder
  • 763
  • 9
  • 23
4
votes
1 answer

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

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…
pr4n
  • 2,665
  • 3
  • 24
  • 40
4
votes
0 answers

Boost Geometry doesn't copy the attributes of my custom point class

I am attempting to use Boost Geometry with a custom vertex class that has x, y and many parameters for rendering such as texture coordinates. I registered the custom class using BOOST_GEOMETRY_REGISTER_POINT_2D and the algorithms such as union_…
4
votes
2 answers

boost::geometry Most efficient way of measuring max/min distance of a point to a polygon ring

I have been using boost::geometry library in a program, mostly for handling polygon objects. I am now trying to optimize my code to scale better with larger polygons. One my functions checks for a given polygon and a given point (usually inside the…
Learning is a mess
  • 3,886
  • 3
  • 24
  • 56
4
votes
2 answers

c ++ Boost Loop through dimensions of model::point

I was wondering if there was a way to loop through the dimensions of a boost point model. I am trying to create a function to do calculations on two custom points, with a definable number of dimensions. In other words the number of dimensions of…
Zack Frost
  • 135
  • 11
4
votes
1 answer

Boost::geometry query returning indexes

I want to have class, which uses boost::geometry::index::rtree for spatial indexers. This class alone should know about boost, so I use something like this: struct VeryImportantInfo { ... float x; float y; } class Catalogue { …
DoctorMoisha
  • 1,463
  • 12
  • 22
4
votes
1 answer

Why boost::geometry::intersection does not work correct?

I wrote next test function for Boost Geometry intersection function typedef boost::geometry::model::polygon > Polygon; void test_boost_intersection() { Polygon green, blue; boost::geometry::read_wkt("POLYGON((0 0,0 9,9…
aptypr
  • 407
  • 5
  • 14
4
votes
3 answers

Boost Polygon Serialization: Ring

According to this related question (Boost Polygon Serialization). I am trying to serialize polygons with Boost. The problem I have now is that I am trying to compile an example using polygons of custom X, Y, points, but the compiler throws this…
4
votes
1 answer

boost::geometry 3D polygon intersection compilation errors

This code snippet works fine in 2D version, but doesn't compile in 3D version: namespace bg = boost::geometry; typedef bg::model::point Point3D; typedef bg::model::polygon Poly3D; Poly3D …
Paul Jurczak
  • 5,766
  • 36
  • 58
4
votes
2 answers

Boost Polygon Serialization

I am using boost geometry in my project, and I need to serialize polygons. I have been using boost serialization without problems for many boost data types, but boost geometry seems that currently does not support serialization, as I cannot find any…
Alvaro Luis Bustamante
  • 7,487
  • 3
  • 26
  • 37
4
votes
3 answers

Use boost to convert degrees minutes seconds radians boost_1_48_0

I have got this code to work: typedef model::point > degree_point; degree_point FlindersSE(-37.0, 144.0); and this: quantity Flinders = 0.375 * radians; //this works 0.375 radians But I…
TheIdeasMan
  • 67
  • 1
  • 7
3
votes
1 answer

boost::geometry multi_point can't be constructed like polygon

First off, a big thanks to the people behind the new boost::geometry library! This question replaces an earlier one which I have now split into two as two separate issues have become clearer. I have read…
Sideshow Bob
  • 4,231
  • 4
  • 34
  • 76
3
votes
2 answers

Boost point_circle coming out in weird shapes

I'm attempting to create a 10m radius polygon on Earth using Boost's Geometry library. Here's the tutorial. To compile this example, I used Wandbox with the latest Clang and Boost 1.73.0. I first discovered the issue in my production environment,…
Chris Watts
  • 4,889
  • 5
  • 38
  • 90
1 2
3
23 24