NGen
Loading...
Searching...
No Matches
geojson::PointFeature Class Reference

#include <PointFeature.hpp>

+ Inheritance diagram for geojson::PointFeature:
+ Collaboration diagram for geojson::PointFeature:

Public Member Functions

 PointFeature (const FeatureBase &feature)
 
 PointFeature (const PointFeature &feature)
 
 PointFeature (coordinate_t coordinate, std::string new_id="", PropertyMap new_properties=PropertyMap(), std::vector< double > new_bounding_box=std::vector< double >(), std::vector< FeatureBase * > upstream_features=std::vector< FeatureBase * >(), std::vector< FeatureBase * > downstream_features=std::vector< FeatureBase * >(), std::map< std::string, JSONProperty > members=std::map< std::string, JSONProperty >())
 
coordinate_t geometry () const
 
void visit (FeatureVisitor &visitor) override
 
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::geometryget_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 PropertyMapget_properties () const
 
PropertyMapget_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 ()
 
FeatureBaseget_destination_feature (std::string id)
 
FeatureBaseget_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 >
geometry (int index) const
 
bool operator== (const FeatureBase &rhs)
 
bool operator!= (const FeatureBase &other)
 

Protected Member Functions

virtual void break_links ()
 
virtual void remove_destination (FeatureBase *feature)
 
virtual void remove_origination (FeatureBase *feature)
 
virtual void remove_neighbor (FeatureBase *feature)
 

Protected Attributes

FeatureType type
 
::geojson::geometry geom
 
std::vector<::geojson::geometrygeometry_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
 

Constructor & Destructor Documentation

◆ PointFeature() [1/3]

geojson::PointFeature::PointFeature ( const FeatureBase & feature)
inline

◆ PointFeature() [2/3]

geojson::PointFeature::PointFeature ( const PointFeature & feature)
inline

◆ PointFeature() [3/3]

geojson::PointFeature::PointFeature ( coordinate_t coordinate,
std::string new_id = "",
PropertyMap new_properties = PropertyMap(),
std::vector< double > new_bounding_box = std::vector<double>(),
std::vector< FeatureBase * > upstream_features = std::vector<FeatureBase*>(),
std::vector< FeatureBase * > downstream_features = std::vector<FeatureBase*>(),
std::map< std::string, JSONProperty > members = std::map<std::string, JSONProperty>() )
inline

Member Function Documentation

◆ add_destination_feature()

virtual void geojson::FeatureBase::add_destination_feature ( FeatureBase * feature,
bool connect = true )
inlinevirtualinherited

Set a separate feature as destination from this instance.

Parameters
featureThe feature to link to that is destination from this instance
connectWhether or not to set this instance as upstream from the newly attached destination feature

References geojson::FeatureBase::add_origination_feature(), geojson::contains(), and geojson::FeatureBase::destination.

Referenced by geojson::FeatureBase::FeatureBase(), and geojson::FeatureBase::add_origination_feature().

◆ add_neighbor_feature()

virtual void geojson::FeatureBase::add_neighbor_feature ( FeatureBase * feature,
bool connect = true )
inlinevirtualinherited

Links this feature to a feature that shares a common destination.

Parameters
featureA feature with a common destination
connectWhether or not this feature should be linked to the neighbor as well

References geojson::FeatureBase::add_neighbor_feature(), geojson::contains(), and geojson::FeatureBase::neighbors.

Referenced by geojson::FeatureBase::add_neighbor_feature(), and geojson::FeatureBase::assign_neighbors().

◆ add_origination_feature()

virtual void geojson::FeatureBase::add_origination_feature ( FeatureBase * feature,
bool connect = true )
inlinevirtualinherited

Set a separate feature as upstream from this instance.

Parameters
featureThe feature to link to that is upstream from this instance
connectWhether or not to set this instance as downsteam from the newly attached upstream feature

References geojson::FeatureBase::add_destination_feature(), and geojson::FeatureBase::origination.

Referenced by geojson::FeatureBase::FeatureBase(), and geojson::FeatureBase::add_destination_feature().

◆ assign_neighbors()

virtual void geojson::FeatureBase::assign_neighbors ( )
inlinevirtualinherited

Searches for features that share common destinations and links them.

References geojson::FeatureBase::add_neighbor_feature(), geojson::FeatureBase::destination, and geojson::FeatureBase::destination_features().

◆ break_links()

virtual void geojson::FeatureBase::break_links ( )
inlineprotectedvirtualinherited

◆ destination_features()

std::vector< FeatureBase * > geojson::FeatureBase::destination_features ( ) const
inlineinherited

◆ geometry() [1/2]

template<class T >
T geojson::FeatureBase::geometry ( int index) const
inlineinherited

◆ geometry() [2/2]

coordinate_t geojson::PointFeature::geometry ( ) const
inline

References geojson::FeatureBase::geom.

Referenced by PointFeature().

◆ get()

virtual JSONProperty geojson::FeatureBase::get ( const std::string & key) const
inlinevirtualinherited

Get a foreign member value by name.

Parameters
keyThe name of the foreign member whose value to look for
Returns
The member value identified by the key

References geojson::FeatureBase::foreign_members.

Referenced by geojson::FeatureBase::FeatureBase(), and geojson::FeatureBase::operator==().

◆ get_bounding_box()

std::vector< double > geojson::FeatureBase::get_bounding_box ( ) const
inlineinherited

Collects all values describing the bounds of this feature.

Returns
A collection of double values describing the bounds for this feature

References geojson::FeatureBase::bounding_box.

Referenced by geojson::FeatureBase::FeatureBase().

◆ get_contributor_count()

int geojson::FeatureBase::get_contributor_count ( )
inlineinherited

◆ get_destination_feature()

FeatureBase * geojson::FeatureBase::get_destination_feature ( std::string id)
inlineinherited

◆ get_destination_length()

int geojson::FeatureBase::get_destination_length ( )
inlineinherited

◆ get_geometry_collection()

virtual std::vector< geojson::geometry > geojson::FeatureBase::get_geometry_collection ( ) const
inlinevirtualinherited

Collects a collection of everything held within the inner geometry collection.

Returns
A collection of boost geometry objects
Exceptions
RuntimeError if this feature isn't a collection type

References geojson::FeatureBase::geometry_collection, geojson::GeometryCollection, and geojson::FeatureBase::type.

Referenced by geojson::CollectionFeature::CollectionFeature(), and geojson::FeatureBase::FeatureBase().

◆ get_id() [1/2]

std::string geojson::FeatureBase::get_id ( ) const
inlineinherited

◆ get_id() [2/2]

std::string geojson::FeatureBase::get_id ( std::string alt_id) const
inlineinherited

◆ get_number_of_destination_features()

int geojson::FeatureBase::get_number_of_destination_features ( )
inlineinherited

◆ get_number_of_neighbors()

int geojson::FeatureBase::get_number_of_neighbors ( )
inlineinherited

◆ get_number_of_origination_features()

int geojson::FeatureBase::get_number_of_origination_features ( )
inlineinherited

◆ get_origination_feature()

FeatureBase * geojson::FeatureBase::get_origination_feature ( std::string id)
inlineinherited

◆ get_origination_length()

int geojson::FeatureBase::get_origination_length ( )
inlineinherited

◆ get_properties() [1/2]

PropertyMap & geojson::FeatureBase::get_properties ( )
inlineinherited

◆ get_properties() [2/2]

const PropertyMap & geojson::FeatureBase::get_properties ( ) const
inlineinherited

◆ get_property()

virtual JSONProperty geojson::FeatureBase::get_property ( const std::string & key) const
inlinevirtualinherited

Get a value from the set of properties.

Parameters
keyThe name of the property to get
Returns
The property identified by the key

References geojson::FeatureBase::properties.

Referenced by geojson::FeatureBase::get_id(), and geojson::FeatureBase::operator==().

◆ get_type()

FeatureType geojson::FeatureBase::get_type ( ) const
inlineinherited

◆ has_key()

virtual bool geojson::FeatureBase::has_key ( const std::string & key)
inlinevirtualinherited

◆ has_property()

virtual bool geojson::FeatureBase::has_property ( std::string property_name) const
inlinevirtualinherited

◆ is_leaf()

bool geojson::FeatureBase::is_leaf ( )
inlineinherited

◆ is_root()

bool geojson::FeatureBase::is_root ( )
inlineinherited

◆ keys()

virtual std::vector< std::string > geojson::FeatureBase::keys ( ) const
inlinevirtualinherited

Retrieves a listing of all foreign member keys.

Returns
A list of all the names of foreign member values

References geojson::FeatureBase::foreign_members.

Referenced by geojson::FeatureBase::FeatureBase(), geojson::FeatureBase::has_key(), and geojson::FeatureBase::operator==().

◆ neighbor_features()

std::vector< FeatureBase * > geojson::FeatureBase::neighbor_features ( ) const
inlineinherited

◆ operator!=()

bool geojson::FeatureBase::operator!= ( const FeatureBase & other)
inlineinherited

◆ operator==()

◆ origination_features()

std::vector< FeatureBase * > geojson::FeatureBase::origination_features ( ) const
inlineinherited

◆ property_keys()

virtual std::vector< std::string > geojson::FeatureBase::property_keys ( ) const
inlinevirtualinherited

Retireves a listing of all property keys.

Returns
A list of all the names of the properties for this feature

References geojson::FeatureBase::properties, and geojson::FeatureBase::property_keys().

Referenced by geojson::FeatureBase::has_property(), geojson::FeatureBase::operator==(), and geojson::FeatureBase::property_keys().

◆ remove_destination()

virtual void geojson::FeatureBase::remove_destination ( FeatureBase * feature)
inlineprotectedvirtualinherited

◆ remove_neighbor()

virtual void geojson::FeatureBase::remove_neighbor ( FeatureBase * feature)
inlineprotectedvirtualinherited

◆ remove_origination()

virtual void geojson::FeatureBase::remove_origination ( FeatureBase * feature)
inlineprotectedvirtualinherited

◆ set() [1/7]

virtual void geojson::FeatureBase::set ( const std::string & key,
double value )
inlinevirtualinherited

Sets a foreign member value.

Parameters
keyThe name of the value to set
valueThe value to set

References geojson::FeatureBase::foreign_members.

◆ set() [2/7]

virtual void geojson::FeatureBase::set ( const std::string & key,
float value )
inlinevirtualinherited

Sets a foreign member value.

Parameters
keyThe name of the value to set
valueThe value to set

References geojson::FeatureBase::foreign_members.

◆ set() [3/7]

virtual void geojson::FeatureBase::set ( const std::string & key,
int value )
inlinevirtualinherited

Sets a foreign member value.

Parameters
keyThe name of the value to set
valueThe value to set

References geojson::FeatureBase::foreign_members.

◆ set() [4/7]

virtual void geojson::FeatureBase::set ( const std::string & key,
JSONProperty property )
inlinevirtualinherited

Sets a foreign member value.

Parameters
keyThe name of the value to set
valueThe value to set

References geojson::FeatureBase::foreign_members.

◆ set() [5/7]

virtual void geojson::FeatureBase::set ( const std::string & key,
long value )
inlinevirtualinherited

Sets a foreign member value.

Parameters
keyThe name of the value to set
valueThe value to set

References geojson::FeatureBase::foreign_members.

◆ set() [6/7]

virtual void geojson::FeatureBase::set ( const std::string & key,
short value )
inlinevirtualinherited

Sets a foreign member value.

Parameters
keyThe name of the value to set
valueThe value to set

References geojson::FeatureBase::foreign_members.

Referenced by geojson::FeatureBase::FeatureBase().

◆ set() [7/7]

virtual void geojson::FeatureBase::set ( const std::string & key,
std::string value )
inlinevirtualinherited

Sets a foreign member value.

Parameters
keyThe name of the value to set
valueThe value to set

References geojson::FeatureBase::foreign_members.

◆ set_id()

virtual void geojson::FeatureBase::set_id ( const std::string & new_id)
inlinevirtualinherited

Sets the ID for the Feature.

Parameters
new_idThe new identifier for this feature

◆ visit()

void geojson::PointFeature::visit ( FeatureVisitor & visitor)
inlineoverridevirtual

Member Data Documentation

◆ bounding_box

std::vector<double> geojson::FeatureBase::bounding_box
protectedinherited

◆ destination

◆ foreign_members

◆ geom

◆ geometry_collection

◆ id

std::string geojson::FeatureBase::id
protectedinherited

◆ neighbors

◆ origination

◆ properties

◆ type


The documentation for this class was generated from the following file: