|  | Home | Libraries | People | FAQ | More | 
The centroid_exception is thrown if the free centroid function is called with geometries for which the centroid cannot be calculated. For example: a linestring without points, a polygon without points, an empty multi-geometry.
class centroid_exception : public exception { // ... };
| Function | Description | Parameters | 
|---|---|---|
| 
 centroid_exception() 
 | The default constructor. | 
| Function | Description | Parameters | Returns | 
|---|---|---|---|
| 
 char const * what() 
 | Returns the explanatory string. | Pointer to a null-terminated string with explanatory information. | 
Either
          #include <boost/geometry.hpp>
        
Or
          #include <boost/geometry/algorithms/centroid.hpp>