GeoDesk for C++
Fast and storage-efficient spatial database engine for OpenStreetMap features
|
A collection containing only Way features. More...
#include <Features.h>
Public Member Functions | |
State and Membership | |
operator bool () const | |
Returns true if this collection contains at least one Feature. | |
bool | operator! () const |
Returns true if this collection is empty. | |
bool | contains (const Feature &feature) const |
Checks if the specified Feature exists in this collection. | |
Filtering by type and tags | |
Features | operator() (const char *query) const |
Only features that match the given query. | |
Nodes | nodes () const |
Only nodes. | |
Nodes | nodes (const char *query) const |
Only nodes that match the given query. | |
Ways | ways () const |
Only ways. | |
Ways | ways (const char *query) const |
Only ways that match the given query. | |
Relations | relations () const |
Only relations. | |
Relations | relations (const char *query) const |
Only relations that match the given query. | |
Spatial Filters | |
Features | operator() (const Box &box) const |
Only features whose bounding box intersects the given bounding box. | |
Features | operator() (Coordinate xy) const |
Only features whose bounding box contains the given Coordinate. | |
Features | operator() (const Feature &feature) const |
Only features whose geometry intersects with the given Feature (short form of intersecting()) | |
Features | intersecting (const Feature &feature) const |
Only features whose geometry intersects with the given Feature. | |
Features | within (const Feature &feature) const |
Only features that lie entirely inside the geometry of the given Feature. | |
Features | containing (const Feature &feature) const |
Only features whose geometry contains the given Feature. | |
Features | containing (Coordinate xy) const |
Only features whose geometry contains the given Coordinate. | |
Features | containingLonLat (double lon, double lat) const |
Only features whose geometry contains the given location. | |
Features | crossing (const Feature &feature) const |
Only features whose geometry crosses the given Feature. | |
Features | maxMetersFrom (double distance, Coordinate xy) const |
Only features whose closest point lies within distance meters of xy . | |
Features | maxMetersFrom (double distance, double lon, double lat) const |
Only features whose closest point lies within distance meters of the given location. | |
Retrieving Features | |
std::optional< Feature > | first () const |
Returns the first Feature in this collection, or std::nullopt if the collection is empty. | |
Feature | one () const |
Returns the one and only Feature in this collection. | |
void | addTo (std::vector< Feature > &features) const |
Appends the Feature objects in this collection to the given std::vector . | |
void | addTo (std::vector< FeaturePtr > &features) const |
Appends the Feature objects in this collection to the given std::vector as FeaturePtr pointers. | |
Scalar Queries | |
uint64_t | count () const |
Returns the total number of features in this collection. | |
double | length () const |
Computes the total length (in meters) of the features in this collection. | |
double | area () const |
Computes the total area (in square meters) of the features in this collection. | |
Topological Filters | |
Features | nodesOf (const Feature &feature) const |
Only nodes that belong to the given Way. | |
Features | membersOf (const Feature &feature) const |
Only features that belong to the given Relation. | |
Features | parentsOf (const Feature &feature) const |
Only features that are parent relations of the given Feature (or parent ways of the given Node). | |
Features | connectedTo (const Feature &feature) const |
Only features that share a common node with the given Feature. | |
Filtering with Predicate | |
template<typename Predicate > | |
Features | filter (Predicate predicate) const |
Only features that match the given predicate. | |
Access to the Low-Level API | |
FeatureStore * | store () const noexcept |
Returns a pointer to the FeatureStore which contains the features in this collection. | |
A collection containing only Way features.
|
inherited |
Appends the Feature objects in this collection to the given std::vector
.
|
inherited |
Appends the Feature objects in this collection to the given std::vector
as FeaturePtr pointers.
|
inherited |
Computes the total area (in square meters) of the features in this collection.
QueryException | if one or more tiles that contain the geometry of a Relation are missing |
Only features that share a common node with the given Feature.
Only features whose geometry contains the given Feature.
QueryException | if one or more tiles that contain the geometry of a Relation are missing |
|
inherited |
Only features whose geometry contains the given Coordinate.
|
inherited |
Only features whose geometry contains the given location.
lon | degrees longitude |
lat | degrees latitude |
|
inherited |
Checks if the specified Feature exists in this collection.
|
inherited |
Returns the total number of features in this collection.
Only features whose geometry crosses the given Feature.
QueryException | if one or more tiles that contain the geometry of a Relation are missing |
|
inherited |
Only features that match the given predicate.
predicate | A callable object (e.g., lambda, function pointer, or functor) that defines the filtering logic. The callable must accept a Feature and return a bool . |
Important: The provided predicate must be thread-safe, as it may be invoked concurrently.
|
inherited |
Only features whose geometry intersects with the given Feature.
QueryException | if one or more tiles that contain the geometry of a Relation are missing |
|
inherited |
Computes the total length (in meters) of the features in this collection.
QueryException | if one or more tiles that contain the geometry of a Relation are missing |
|
inherited |
Only features whose closest point lies within distance
meters of xy
.
distance | the maximum distance (in meters) |
xy | the center of the search radius |
|
inherited |
Only features whose closest point lies within distance
meters of the given location.
distance | the maximum distance (in meters) |
lon | longitude of the search radius center |
lat | latitude of the search radius center |
Only features that belong to the given Relation.
|
inherited |
Only nodes.
|
inherited |
Only nodes that match the given query.
query | a query in GOQL format |
QueryException | if the query is malformed. |
Only nodes that belong to the given Way.
|
inherited |
Returns the one and only Feature in this collection.
QueryException | if this collection is empty or contains more than one Feature |
|
inherited |
Returns true
if this collection contains at least one Feature.
|
inherited |
Returns true
if this collection is empty.
Only features whose bounding box intersects the given bounding box.
box |
|
inherited |
Only features that match the given query.
query | a query in GOQL format |
QueryException | if the query is malformed. |
Only features whose geometry intersects with the given Feature (short form of intersecting())
|
inherited |
Only features whose bounding box contains the given Coordinate.
xy |
|
inherited |
Only relations.
|
inherited |
Only relations that match the given query.
query | a query in GOQL format |
QueryException | if the query is malformed. |
|
noexceptinherited |
Returns a pointer to the FeatureStore which contains the features in this collection.
|
inherited |
Only ways.
|
inherited |
Only ways that match the given query.
query | a query in GOQL format |
QueryException | if the query is malformed. |
Only features that lie entirely inside the geometry of the given Feature.
QueryException | if one or more tiles that contain the geometry of a Relation are missing |