|
NGen
|
Represents an individual feature within a Geojson definition. More...
#include <FeatureBase.hpp>
Inheritance diagram for geojson::FeatureBase:
Collaboration diagram for geojson::FeatureBase:Public Member Functions | |
| FeatureBase (const FeatureBase &feature) | |
| Copy Constructor. | |
| virtual | ~FeatureBase () |
| Destructor. | |
| FeatureType | get_type () const |
| Retrieve an indicator as to what type of feature this is. | |
| virtual void | add_origination_feature (FeatureBase *feature, bool connect=true) |
| Set a separate feature as upstream from this instance. | |
| virtual void | add_destination_feature (FeatureBase *feature, bool connect=true) |
| Set a separate feature as destination from this instance. | |
| virtual void | assign_neighbors () |
| Searches for features that share common destinations and links them. | |
| virtual void | add_neighbor_feature (FeatureBase *feature, bool connect=true) |
| Links this feature to a feature that shares a common destination. | |
| virtual JSONProperty | get_property (const std::string &key) const |
| Get a value from the set of properties. | |
| virtual void | set_id (const std::string &new_id) |
| Sets the ID for the Feature. | |
| virtual JSONProperty | get (const std::string &key) const |
| Get a foreign member value by name. | |
| virtual void | set (const std::string &key, short value) |
| Sets a foreign member value. | |
| virtual void | set (const std::string &key, int value) |
| Sets a foreign member value. | |
| virtual void | set (const std::string &key, long value) |
| Sets a foreign member value. | |
| virtual void | set (const std::string &key, float value) |
| Sets a foreign member value. | |
| virtual void | set (const std::string &key, double value) |
| Sets a foreign member value. | |
| virtual void | set (const std::string &key, std::string value) |
| Sets a foreign member value. | |
| virtual void | set (const std::string &key, JSONProperty property) |
| Sets a foreign member value. | |
| virtual bool | has_key (const std::string &key) |
| virtual std::vector< std::string > | keys () const |
| Retrieves a listing of all foreign member keys. | |
| virtual std::vector< std::string > | property_keys () const |
| Retireves a listing of all property keys. | |
| virtual bool | has_property (std::string property_name) const |
| virtual std::vector< geojson::geometry > | get_geometry_collection () const |
| Collects a collection of everything held within the inner geometry collection. | |
| std::vector< double > | get_bounding_box () const |
| Collects all values describing the bounds of this feature. | |
| const PropertyMap & | get_properties () const |
| PropertyMap & | get_properties () |
| std::string | get_id () const |
| std::string | get_id (std::string alt_id) const |
| int | get_number_of_destination_features () |
| int | get_number_of_origination_features () |
| int | get_number_of_neighbors () |
| FeatureBase * | get_destination_feature (std::string id) |
| FeatureBase * | get_origination_feature (std::string id) |
| std::vector< FeatureBase * > | origination_features () const |
| std::vector< FeatureBase * > | destination_features () const |
| std::vector< FeatureBase * > | neighbor_features () const |
| int | get_origination_length () |
| int | get_destination_length () |
| int | get_contributor_count () |
| bool | is_leaf () |
| bool | is_root () |
| template<class T > | |
| T | geometry () const |
| const std::shared_ptr< const ::geojson::geometry > & | geometry () const |
| The feature's geometry, as a shared handle. | |
| template<class T > | |
| T | geometry (int index) const |
| virtual void | visit (FeatureVisitor &visitor)=0 |
| bool | operator== (const FeatureBase &rhs) const |
| bool | operator!= (const FeatureBase &other) |
Protected Member Functions | |
| FeatureBase (std::string new_id="", PropertyMap new_properties=PropertyMap(), std::vector< double > new_bounding_box=std::vector< double >(), std::vector< FeatureBase * > origination_features=std::vector< FeatureBase * >(), std::vector< FeatureBase * > destination_features=std::vector< FeatureBase * >(), PropertyMap members=PropertyMap()) | |
| Verbose constructor for the basic attributes of a feature. | |
| virtual void | break_links () |
| virtual void | remove_destination (FeatureBase *feature) |
| virtual void | remove_origination (FeatureBase *feature) |
| virtual void | remove_neighbor (FeatureBase *feature) |
| void | set_geom (::geojson::geometry new_geom) |
| Give this feature a geometry, replacing rather than modifying any it already has. | |
Protected Attributes | |
| FeatureType | type |
| std::shared_ptr< const ::geojson::geometry > | geom |
| The feature's geometry, shared rather than owned outright. | |
| std::vector<::geojson::geometry > | geometry_collection |
| PropertyMap | properties |
| std::vector< double > | bounding_box |
| PropertyMap | foreign_members |
| std::string | id |
| std::vector< FeatureBase * > | origination |
| std::vector< FeatureBase * > | destination |
| std::vector< FeatureBase * > | neighbors |
Friends | |
| class | FeatureCollection |
Represents an individual feature within a Geojson definition.
|
inlineprotected |
Verbose constructor for the basic attributes of a feature.
| new_id | An id for the feature so that it may be referenced by name |
| new_properties | A mapping between a name for a property and its values |
| new_bounding_box | A list of double values describing the boundaries for a feature |
| origination_features | A series of raw pointers to features that lie upstream from this feature |
| destination_features | A series of raw pointers to features that lie downstream from this feature |
| members | A mapping of foreign members for the feature between the member name and its value |
References add_destination_feature(), add_origination_feature(), bounding_box, destination_features(), foreign_members, origination_features(), and properties.
|
inline |
Copy Constructor.
References bounding_box, destination, destination_features(), geom, geometry_collection, geojson::GeometryCollection, get(), get_bounding_box(), get_geometry_collection(), get_id(), get_properties(), get_type(), keys(), origination, origination_features(), properties, set(), and type.
|
inlinevirtual |
Destructor.
References break_links().
|
inlinevirtual |
Set a separate feature as destination from this instance.
| feature | The feature to link to that is destination from this instance |
| connect | Whether or not to set this instance as upstream from the newly attached destination feature |
References add_origination_feature(), geojson::contains(), and destination.
Referenced by FeatureBase(), and add_origination_feature().
|
inlinevirtual |
Links this feature to a feature that shares a common destination.
| feature | A feature with a common destination |
| connect | Whether or not this feature should be linked to the neighbor as well |
References add_neighbor_feature(), geojson::contains(), and neighbors.
Referenced by add_neighbor_feature(), and assign_neighbors().
|
inlinevirtual |
Set a separate feature as upstream from this instance.
| feature | The feature to link to that is upstream from this instance |
| connect | Whether or not to set this instance as downsteam from the newly attached upstream feature |
References add_destination_feature(), and origination.
Referenced by FeatureBase(), and add_destination_feature().
|
inlinevirtual |
Searches for features that share common destinations and links them.
References add_neighbor_feature(), destination, and destination_features().
|
inlineprotectedvirtual |
References destination, neighbors, and origination.
Referenced by ~FeatureBase().
|
inline |
References destination.
Referenced by FeatureBase(), FeatureBase(), and assign_neighbors().
|
inline |
References geom, and geojson::get_geometry_type().
|
inline |
The feature's geometry, as a shared handle.
A handle rather than the geometry itself: a geometry may hold many thousands of coordinates, and nothing reading one should be made to copy it. Holding it keeps the geometry alive, so the feature and the collection it was parsed from may be released while the geometry stays readable.
References geom.
|
inline |
References geometry_collection, and geojson::get_geometry_type().
|
inlinevirtual |
Get a foreign member value by name.
| key | The name of the foreign member whose value to look for |
References foreign_members.
Referenced by FeatureBase(), and operator==().
|
inline |
Collects all values describing the bounds of this feature.
References bounding_box.
Referenced by FeatureBase().
|
inline |
References geojson::contains(), and origination.
|
inline |
References destination.
|
inline |
References destination, and is_leaf().
|
inlinevirtual |
Collects a collection of everything held within the inner geometry collection.
| Runtime | Error if this feature isn't a collection type |
References geometry_collection, geojson::GeometryCollection, and type.
Referenced by geojson::CollectionFeature::CollectionFeature(), and FeatureBase().
|
inline |
References id.
Referenced by FeatureBase(), and operator==().
|
inline |
References geojson::JSONProperty::as_string(), get_property(), and id.
|
inline |
References destination.
|
inline |
References neighbors.
|
inline |
References origination.
|
inline |
References origination.
|
inline |
References is_root(), and origination.
|
inline |
References properties.
|
inline |
References properties.
Referenced by FeatureBase().
|
inlinevirtual |
Get a value from the set of properties.
| key | The name of the property to get |
References properties.
Referenced by get_id(), and operator==().
|
inline |
Retrieve an indicator as to what type of feature this is.
References type.
Referenced by FeatureBase(), geojson::LineStringFeature::LineStringFeature(), geojson::MultiLineStringFeature::MultiLineStringFeature(), geojson::MultiPointFeature::MultiPointFeature(), geojson::PointFeature::PointFeature(), and operator==().
|
inlinevirtual |
References keys().
|
inlinevirtual |
References property_keys().
|
inline |
References destination.
Referenced by get_destination_length().
|
inline |
References origination.
Referenced by get_origination_length().
|
inlinevirtual |
Retrieves a listing of all foreign member keys.
References foreign_members.
Referenced by FeatureBase(), has_key(), and operator==().
|
inline |
References neighbors.
|
inline |
References operator==().
|
inline |
References bounding_box, geojson::contains(), destination, geom, geometry_collection, geojson::GeometryCollection, get(), get_id(), get_property(), get_type(), keys(), neighbors, origination, and property_keys().
Referenced by operator!=().
|
inline |
References origination.
Referenced by FeatureBase(), and FeatureBase().
|
inlinevirtual |
Retireves a listing of all property keys.
References properties, and property_keys().
Referenced by has_property(), operator==(), and property_keys().
|
inlineprotectedvirtual |
References destination.
|
inlineprotectedvirtual |
References neighbors.
|
inlineprotectedvirtual |
References origination.
|
inlinevirtual |
Sets a foreign member value.
| key | The name of the value to set |
| value | The value to set |
References foreign_members.
|
inlinevirtual |
Sets a foreign member value.
| key | The name of the value to set |
| value | The value to set |
References foreign_members.
|
inlinevirtual |
Sets a foreign member value.
| key | The name of the value to set |
| value | The value to set |
References foreign_members.
|
inlinevirtual |
Sets a foreign member value.
| key | The name of the value to set |
| value | The value to set |
References foreign_members.
|
inlinevirtual |
Sets a foreign member value.
| key | The name of the value to set |
| value | The value to set |
References foreign_members.
|
inlinevirtual |
Sets a foreign member value.
| key | The name of the value to set |
| value | The value to set |
References foreign_members.
Referenced by FeatureBase().
|
inlinevirtual |
Sets a foreign member value.
| key | The name of the value to set |
| value | The value to set |
References foreign_members.
|
inlineprotected |
Give this feature a geometry, replacing rather than modifying any it already has.
Referenced by geojson::LineStringFeature::LineStringFeature(), geojson::LineStringFeature::LineStringFeature(), geojson::MultiLineStringFeature::MultiLineStringFeature(), geojson::MultiLineStringFeature::MultiLineStringFeature(), geojson::MultiPointFeature::MultiPointFeature(), geojson::MultiPointFeature::MultiPointFeature(), geojson::MultiPolygonFeature::MultiPolygonFeature(), geojson::MultiPolygonFeature::MultiPolygonFeature(), geojson::PointFeature::PointFeature(), geojson::PointFeature::PointFeature(), and geojson::PolygonFeature::PolygonFeature().
|
inlinevirtual |
Sets the ID for the Feature.
| new_id | The new identifier for this feature |
|
pure virtual |
|
friend |
|
protected |
Referenced by FeatureBase(), FeatureBase(), get_bounding_box(), and operator==().
|
protected |
|
protected |
|
protected |
The feature's geometry, shared rather than owned outright.
A geometry may hold many thousands of coordinates, and a caller that only reads one should not be made to hold a copy.
Const because it is replaced, never modified: a feature given a new geometry points at a new one through set_geom, leaving whoever still holds the previous one unaffected. Copies of a feature therefore share until one of them is given a different geometry, which keeps them as independent as the rest of this type's value semantics already are.
Referenced by FeatureBase(), geometry(), geojson::LineStringFeature::geometry(), geojson::MultiLineStringFeature::geometry(), geojson::MultiPointFeature::geometry(), geojson::MultiPolygonFeature::geometry(), geojson::PointFeature::geometry(), geojson::PolygonFeature::geometry(), and operator==().
|
protected |
|
protected |
Referenced by add_neighbor_feature(), break_links(), get_number_of_neighbors(), neighbor_features(), operator==(), and remove_neighbor().
|
protected |
|
protected |
Referenced by FeatureBase(), FeatureBase(), get_properties(), get_properties(), get_property(), and property_keys().
|
protected |
Referenced by geojson::CollectionFeature::CollectionFeature(), geojson::CollectionFeature::CollectionFeature(), FeatureBase(), geojson::LineStringFeature::LineStringFeature(), geojson::LineStringFeature::LineStringFeature(), geojson::MultiLineStringFeature::MultiLineStringFeature(), geojson::MultiLineStringFeature::MultiLineStringFeature(), geojson::MultiPointFeature::MultiPointFeature(), geojson::MultiPointFeature::MultiPointFeature(), geojson::MultiPolygonFeature::MultiPolygonFeature(), geojson::MultiPolygonFeature::MultiPolygonFeature(), geojson::PointFeature::PointFeature(), geojson::PointFeature::PointFeature(), geojson::PolygonFeature::PolygonFeature(), geojson::SentinelFeature::SentinelFeature(), get_geometry_collection(), and get_type().