NGen
|
#include <FeatureCollection.hpp>
Public Member Functions | |
FeatureCollection (FeatureList &new_features, std::vector< double > bounding_box) | |
Constructor. | |
FeatureCollection (FeatureList &&new_features, std::vector< double > &&bounding_box) | |
Move Constructor. | |
FeatureCollection () | |
FeatureCollection (const FeatureCollection &feature_collection) | |
Copy constructor. | |
template<typename C > | |
FeatureCollection (const FeatureCollection &feature_collection, C &filter) | |
Copy constructor with filter. | |
virtual | ~FeatureCollection () |
Destructor. | |
int | get_size () |
bool | is_empty () |
std::vector< double > | get_bounding_box () const |
Feature | get_feature (int index) const |
Retrieve Feature by index in collection. | |
int | find (Feature feature) |
Finds the index of given Feature in the collection. | |
int | find (std::string ID) |
Finds the index of a Feature with the given ID. | |
Feature | remove_feature (int index) |
Removes a feature from the collection based on index. | |
Feature | remove_feature_by_id (std::string ID) |
Removes a Feature based on its ID. | |
Feature | get_feature (std::string id) const |
Retrieves a Feature based on its ID. | |
FeatureList::const_iterator | begin () const |
FeatureList::const_iterator | end () const |
JSONProperty | get (std::string key) const |
void | visit_features (FeatureVisitor &visitor) |
void | set (const std::string &key, short value) |
void | set (const std::string &key, int value) |
void | set (const std::string &key, long value) |
void | set (const std::string &key, float value) |
void | set (const std::string &key, double value) |
void | set (const std::string &key, std::string value) |
void | set (const std::string &key, JSONProperty &property) |
void | add_feature (Feature feature, std::string *id=nullptr) |
void | add_feature_id (const std::string &id, Feature feature) |
Add a reference to a feature by id. | |
void | set_ids_from_member (const std::string &member_name="id") |
void | set_ids_from_property (const std::string &property_name="id") |
void | set_ids (const std::string &id_field_name="id") |
void | update_ids (const std::string &alt_id={}) |
Update the collection's feature id mapping. | |
int | link_features_from_property (std::string *from_property=nullptr, std::string *to_property=nullptr) |
int | link_features_from_attribute (std::string *from_attribute=nullptr, std::string *to_attribute=nullptr) |
Private Attributes | |
FeatureList | features |
std::vector< double > | bounding_box |
std::map< std::string, Feature > | feature_by_id |
std::map< std::string, JSONProperty > | foreign_members |
|
inline |
Constructor.
new_features | An overall list of features |
bounding_box | A set of bounds for all features |
References features.
|
inline |
Move Constructor.
new_features | An overall list of features |
bounding_box | A set of bounds for all features |
|
inline |
|
inline |
Copy constructor.
feature_collection | The FeatureCollection to copy |
References bounding_box, features, get_bounding_box(), and update_ids().
|
inline |
Copy constructor with filter.
feature_collection | The FeatureCollection to copy |
filter | A container |
References bounding_box, features, get_bounding_box(), and update_ids().
|
inlinevirtual |
Destructor.
void FeatureCollection::add_feature | ( | Feature | feature, |
std::string * | id = nullptr ) |
References feature_by_id, and features.
Referenced by Network_Test::add_catchment().
void FeatureCollection::add_feature_id | ( | const std::string & | id, |
Feature | feature ) |
Add a reference to a feature by id.
id | The id used to reference a feature |
feature | A feature that may be referred to by id |
References feature_by_id.
FeatureList::const_iterator FeatureCollection::begin | ( | ) | const |
References features.
FeatureList::const_iterator FeatureCollection::end | ( | ) | const |
References features.
int FeatureCollection::find | ( | Feature | feature | ) |
Finds the index of given Feature in the collection.
feature | The feature to look for |
References features, and get_size().
Referenced by remove_feature().
int FeatureCollection::find | ( | std::string | ID | ) |
Finds the index of a Feature with the given ID.
ID | The ID of the Feature to look for |
References features, and get_size().
JSONProperty FeatureCollection::get | ( | std::string | key | ) | const |
References foreign_members.
Referenced by link_features_from_attribute(), and link_features_from_property().
std::vector< double > FeatureCollection::get_bounding_box | ( | ) | const |
References bounding_box.
Referenced by FeatureCollection(), and FeatureCollection().
Feature FeatureCollection::get_feature | ( | int | index | ) | const |
Retrieve Feature by index in collection.
index | The index of the feature |
References features.
Referenced by remove_feature(), and remove_feature_by_id().
Feature FeatureCollection::get_feature | ( | std::string | id | ) | const |
Retrieves a Feature based on its ID.
ID | The ID of the Feature to retrieve |
References feature_by_id.
int FeatureCollection::get_size | ( | ) |
References features.
Referenced by find(), find(), and remove_feature_by_id().
bool FeatureCollection::is_empty | ( | ) |
References features.
int FeatureCollection::link_features_from_attribute | ( | std::string * | from_attribute = nullptr, |
std::string * | to_attribute = nullptr ) |
References feature_by_id, features, and get().
int FeatureCollection::link_features_from_property | ( | std::string * | from_property = nullptr, |
std::string * | to_property = nullptr ) |
References feature_by_id, features, and get().
Feature FeatureCollection::remove_feature | ( | int | index | ) |
Removes a feature from the collection based on index.
index | The index of the Feature to remove |
References feature_by_id, features, find(), and get_feature().
Feature FeatureCollection::remove_feature_by_id | ( | std::string | ID | ) |
Removes a Feature based on its ID.
ID | The ID of the Feature to remove |
References feature_by_id, features, get_feature(), and get_size().
void FeatureCollection::set | ( | const std::string & | key, |
double | value ) |
References foreign_members.
void FeatureCollection::set | ( | const std::string & | key, |
float | value ) |
References foreign_members.
void FeatureCollection::set | ( | const std::string & | key, |
int | value ) |
References foreign_members.
void FeatureCollection::set | ( | const std::string & | key, |
JSONProperty & | property ) |
References foreign_members.
void FeatureCollection::set | ( | const std::string & | key, |
long | value ) |
References foreign_members.
void FeatureCollection::set | ( | const std::string & | key, |
short | value ) |
References foreign_members.
void FeatureCollection::set | ( | const std::string & | key, |
std::string | value ) |
References foreign_members.
void FeatureCollection::set_ids | ( | const std::string & | id_field_name = "id" | ) |
References geojson::contains(), features, and update_ids().
void FeatureCollection::set_ids_from_member | ( | const std::string & | member_name = "id" | ) |
References geojson::contains(), features, and update_ids().
void FeatureCollection::set_ids_from_property | ( | const std::string & | property_name = "id" | ) |
References geojson::contains(), features, and update_ids().
void FeatureCollection::update_ids | ( | const std::string & | alt_id = {} | ) |
Update the collection's feature id mapping.
alt_id | Optional, An alternative feature property to also index the feature by |
References feature_by_id, and features.
Referenced by FeatureCollection(), FeatureCollection(), set_ids(), set_ids_from_member(), and set_ids_from_property().
void FeatureCollection::visit_features | ( | FeatureVisitor & | visitor | ) |
References features.
|
private |
Referenced by FeatureCollection(), FeatureCollection(), and get_bounding_box().
|
private |
|
private |
Referenced by FeatureCollection(), FeatureCollection(), FeatureCollection(), add_feature(), begin(), end(), find(), find(), get_feature(), get_size(), is_empty(), link_features_from_attribute(), link_features_from_property(), remove_feature(), remove_feature_by_id(), set_ids(), set_ids_from_member(), set_ids_from_property(), update_ids(), and visit_features().
|
private |