GeoDesk for C++
Fast and storage-efficient spatial database engine for OpenStreetMap features
|
Utility class for creating polygon rings from Relation members. More...
#include <Polygonizer.h>
Public Member Functions | |
Polygonizer () | |
const Ring * | outerRings () const |
Returns the assembled outer rings. | |
const Ring * | innerRings () const |
Returns the assembled outer rings. | |
void | createRings (FeatureStore *store, RelationPtr relation) |
Creates only the raw outer and inner rings, without assigning the inner rings to outer, and without merging inner rings whose edges touch. | |
void | assignAndMergeHoles () |
Assigns inner rings to outer, and merges any inner rings whose edges touch. | |
Utility class for creating polygon rings from Relation members.
In OpenStreetMap, polygons with holes and multi-polygons are represented as relations. Member ways with role outer
and inner
form the linework. The Polygonizer assembles these linestrings into rings and ensures that inner rings are matched with their corresponding outer rings.
geodesk::Polygonizer::Polygonizer | ( | ) |
void geodesk::Polygonizer::assignAndMergeHoles | ( | ) |
Assigns inner rings to outer, and merges any inner rings whose edges touch.
The createRings() method must have been called.
void geodesk::Polygonizer::createRings | ( | FeatureStore * | store, |
RelationPtr | relation ) |
Creates only the raw outer and inner rings, without assigning the inner rings to outer, and without merging inner rings whose edges touch.
(This is sufficient for many operations such as area or centroid computation)
store | the FeatureStore |
relation | pointer to the stored Relation |
|
inline |
Returns the assembled outer rings.
The Ring objects form a linked list. createRings() must have been called, or the result of this method will be nullptr
. After a subsequent call to assignAndMergeHoles() this method will always return nullptr
, as the inner rings will have been assigned to their outer rings.
nullptr
if no valid outer rings could be assembled, or if they have been assigned to their outer rings.
|
inline |
Returns the assembled outer rings.
The Ring objects form a linked list. createRings() must have been called, or the result of this method will be nullptr
.
nullptr
if no valid outer rings could be assembled.