All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes
openfluid::landr::LandRGraph Class Reference

Interface for a graph composed of LandREntity. More...

#include <landr/LandRGraph.hpp>

Inheritance diagram for openfluid::landr::LandRGraph:
openfluid::landr::LineStringGraph openfluid::landr::PolygonGraph

List of all members.

Public Types

enum  GraphType { POLYGON, LINESTRING }
typedef std::list< LandREntity * > Entities_t

Public Member Functions

virtual ~LandRGraph ()
virtual GraphType getType ()=0
 Returns the type of graph.
virtual LandREntitygetEntity (int OfldId)
 Returns the LandREntity with OfldId, or 0 if it doesn't exist.
Entities_t getEntities ()
 Returns a list of the LandREntity of this LandRGraph.
Entities_t getOfldIdOrderedEntities ()
 Returns a list of the LandREntity of this LandRGraph and sorted by identifier.
std::map< int, LandREntity * > getEntitiesByOfldId ()
 Returns a map of the LandREntity of this LandRGraph and their identifiers.
unsigned int getSize () const
 Gets the number of LandREntity in the LandRGraph.
void removeUnusedNodes ()
 Removes from this LandRGraph the nodes of degree 0.
void addAttribute (const std::string &AttributeName)
 Adds an attribute to this LandRGraph.
void removeAttribute (const std::string &AttributeName)
 Removes an attribute to this LandRGraph.
std::vector< std::string > getAttributeNames ()
 Returns a vector of the names of the attributes of this LandRGraph.
void addAGeoRasterValue (openfluid::core::GeoRasterValue &Raster)
 Associates a core::GeoRasterValue to this LandRGraph.
void addAGeoRasterValue (const openfluid::landr::RasterDataset &Raster)
 Associates a RasterDataset to this LandRGraph.
bool hasAnAssociatedRaster ()
 Returns true if this LandRGraph has an associated raster, false otherwise.
openfluid::landr::VectorDatasetgetRasterPolygonized ()
 Transforms the associated raster value into an openfluid::landr::VectorDataset of polygons.
std::vector
< geos::geom::Polygon * > * 
getRasterPolygonizedPolys ()
 Transforms the associated raster value into a vector of geos::geom::Polygon.
virtual float * getRasterValueForEntityCentroid (const LandREntity &Entity)
 Fetchs the associated raster value corresponding to the LandREntity centroid coordinate.
void setAttributeFromRasterValueAtCentroid (const std::string &AttributeName)
 Creates a new attribute for all the LandREntity of this LandRGraph, and set for each LandREntity this attribute value as the raster value corresponding to the LandREntity centroid coordinate.
virtual void setAttributeFromMeanRasterValues (const std::string &AttributeName)=0
 Creates a new attribute for all the LandREntity of this LandRGraph, and set for each LandREntity this attribute value as a mean of the raster value.
void computeNeighbours ()
 Computes the LandREntity neighbours of each LandREntity of this LandRGraph, according to its type.
void exportToShp (const std::string &FilePath, const std::string &FileName)
 Creates on disk a shapefile representing this LandRGraph.
void setAttributeFromVectorId (const std::string &AttributeName, openfluid::core::GeoVectorValue &Vector, const std::string &Column)
 Creates a new attribute for all the LandREntity of this LandRGraph, and set for each LandREntity this attribute value as the vector value corresponding to the entity OFLD_ID.
void setAttributeFromVectorId (const std::string &AttributeName, openfluid::landr::VectorDataset &Vector, const std::string &Column)
 Creates a new attribute for all the LandREntity of this LandRGraph, and set for each LandREntity this attribute value as the vector value corresponding to the entity OFLD_ID.
virtual void setAttributeFromVectorLocation (const std::string &AttributeName, openfluid::core::GeoVectorValue &Vector, const std::string &Column, double Thresh=0.0001)=0
 Creates a new attribute for all the LandREntity of this LandRGraph, and set for each LandREntity this attribute value as the vector value corresponding to the Vector Entity Geometry.
virtual void setAttributeFromVectorLocation (const std::string &AttributeName, openfluid::landr::VectorDataset &Vector, const std::string &Column, double Thresh=0.0001)=0
 Creates a new attribute for all the LandREntity of this LandRGraph, and set for each LandREntity this attribute value as the vector value corresponding to the Vector Entity Geometry.
virtual void removeEntity (int OfldId)=0
 Removes a LandREntity with identifier from this LandRGraph.
void snapVertices (double snapTolerance)

Protected Member Functions

 LandRGraph ()
 LandRGraph (openfluid::core::GeoVectorValue &Val)
 Creates a new LandRGraph from a core::GeoVectorValue.
 LandRGraph (const openfluid::landr::VectorDataset &Vect)
 Creates a new LandRGraph from a VectorDataset.
void addEntitiesFromGeoVector ()
 Adds LandREntity from the associated VectorDataset of this LandRGraph.
void addEntitiesFromEntityList (const LandRGraph::Entities_t &Entities)
 Adds LandREntity from a LandREntity list to this LandRGraph.
virtual void addEntity (LandREntity *Entity)=0
 Adds a LandREntity to this LandRGraph.
virtual LandREntitygetNewEntity (const geos::geom::Geometry *Geom, unsigned int OfldId)=0
 Creates a new LandREntity.
geos::planargraph::Node * getNode (const geos::geom::Coordinate &Coordinate)
 Returns a geos::planagraph::Node of this LandRGraph from a geos::geom::Coordinate.

Protected Attributes

openfluid::landr::VectorDatasetmp_Vector
 The VectorDataset associated to this LandRGraph.
const geos::geom::GeometryFactory * mp_Factory
 The geos::geom::GeometryFactory used to build this LandRGraph.
std::map< int, LandREntity * > m_EntitiesByOfldId
 A map of the LandREntity of this LandRGraph and sorted by identifier.
Entities_t m_Entities
 A list of the LandREntity of this LandRGraph.
openfluid::landr::RasterDatasetmp_Raster
 The RasterDataset associated to this LandRGraph.
openfluid::landr::VectorDatasetmp_RasterPolygonized
 The VectorDataset representation of the RasterDataset associated to this LandRGraph.
std::vector
< geos::geom::Polygon * > * 
mp_RasterPolygonizedPolys
 A vector of geos::geom::Polygon representation of the RasterDataset associated to this LandRGraph.

Static Protected Attributes

static int FileNum

Detailed Description

Interface for a graph composed of LandREntity.


Member Typedef Documentation


Member Enumeration Documentation

Enumerator:
POLYGON 
LINESTRING 

Constructor & Destructor Documentation

Creates a new LandRGraph from a core::GeoVectorValue.

Creates a new LandRGraph from a VectorDataset.

Attention:
Delete also associated RasterPolygonized if present.

Member Function Documentation

Associates a core::GeoRasterValue to this LandRGraph.

Parameters:
RasterA core::GeoRasterValue.

Replace associated raster if exists.

Associates a RasterDataset to this LandRGraph.

Parameters:
RasterA RasterDataset.

Replace associated raster if exists.

void openfluid::landr::LandRGraph::addAttribute ( const std::string &  AttributeName)

Adds an attribute to this LandRGraph.

Doesn't reset if the AttributeName already exists.

Parameters:
AttributeNameThe name of the attribute.

Adds LandREntity from a LandREntity list to this LandRGraph.

Adds LandREntity from the associated VectorDataset of this LandRGraph.

virtual void openfluid::landr::LandRGraph::addEntity ( LandREntity Entity) [protected, pure virtual]

Adds a LandREntity to this LandRGraph.

Parameters:
EntityThe LandREntity to add.

Implemented in openfluid::landr::LineStringGraph, and openfluid::landr::PolygonGraph.

Computes the LandREntity neighbours of each LandREntity of this LandRGraph, according to its type.

void openfluid::landr::LandRGraph::exportToShp ( const std::string &  FilePath,
const std::string &  FileName 
)

Creates on disk a shapefile representing this LandRGraph.

Parameters:
FilePathThe path where to create the out file.
FileNameA name for the out file to create, with a .shp extension.

Returns a vector of the names of the attributes of this LandRGraph.

Returns a list of the LandREntity of this LandRGraph.

Returns a map of the LandREntity of this LandRGraph and their identifiers.

virtual LandREntity* openfluid::landr::LandRGraph::getEntity ( int  OfldId) [virtual]

Returns the LandREntity with OfldId, or 0 if it doesn't exist.

Reimplemented in openfluid::landr::LineStringGraph, and openfluid::landr::PolygonGraph.

virtual LandREntity* openfluid::landr::LandRGraph::getNewEntity ( const geos::geom::Geometry *  Geom,
unsigned int  OfldId 
) [protected, pure virtual]

Creates a new LandREntity.

Parameters:
GeomA geos::geom::Geometry.
OfldIdThe identifier of the new LandREntity.

Implemented in openfluid::landr::LineStringGraph, and openfluid::landr::PolygonGraph.

geos::planargraph::Node* openfluid::landr::LandRGraph::getNode ( const geos::geom::Coordinate &  Coordinate) [protected]

Returns a geos::planagraph::Node of this LandRGraph from a geos::geom::Coordinate.

Parameters:
CoordinateA geos::geom::Coordinate.
Returns:
A geos::planargraph::Node.

Returns a list of the LandREntity of this LandRGraph and sorted by identifier.

Transforms the associated raster value into an openfluid::landr::VectorDataset of polygons.

Returns:
An openfluid::landr::VectorDataset of the created polygons.
std::vector<geos::geom::Polygon*>* openfluid::landr::LandRGraph::getRasterPolygonizedPolys ( )

Transforms the associated raster value into a vector of geos::geom::Polygon.

Returns:
A vector of the created geos::geom::Polygon.
virtual float* openfluid::landr::LandRGraph::getRasterValueForEntityCentroid ( const LandREntity Entity) [virtual]

Fetchs the associated raster value corresponding to the LandREntity centroid coordinate.

Parameters:
EntityThe LandREntity to get the centroid coordinate from.
Returns:
The raster value corresponding to the LandREntity centroid coordinate.
unsigned int openfluid::landr::LandRGraph::getSize ( ) const

Gets the number of LandREntity in the LandRGraph.

Returns the type of graph.

Implemented in openfluid::landr::LineStringGraph, and openfluid::landr::PolygonGraph.

Returns true if this LandRGraph has an associated raster, false otherwise.

void openfluid::landr::LandRGraph::removeAttribute ( const std::string &  AttributeName)

Removes an attribute to this LandRGraph.

Does nothing if AttributeName doesn't exist.

Parameters:
AttributeNameThe name of the attribute.
virtual void openfluid::landr::LandRGraph::removeEntity ( int  OfldId) [pure virtual]

Removes a LandREntity with identifier from this LandRGraph.

The associated nodes of the LandREntity are also removed.

Parameters:
OfldIdThe identifier.

Implemented in openfluid::landr::PolygonGraph, and openfluid::landr::LineStringGraph.

Removes from this LandRGraph the nodes of degree 0.

virtual void openfluid::landr::LandRGraph::setAttributeFromMeanRasterValues ( const std::string &  AttributeName) [pure virtual]

Creates a new attribute for all the LandREntity of this LandRGraph, and set for each LandREntity this attribute value as a mean of the raster value.

Parameters:
AttributeNameThe name of the attribute to create.

Implemented in openfluid::landr::LineStringGraph, and openfluid::landr::PolygonGraph.

void openfluid::landr::LandRGraph::setAttributeFromRasterValueAtCentroid ( const std::string &  AttributeName)

Creates a new attribute for all the LandREntity of this LandRGraph, and set for each LandREntity this attribute value as the raster value corresponding to the LandREntity centroid coordinate.

Parameters:
AttributeNameThe name of the attribute to create.
void openfluid::landr::LandRGraph::setAttributeFromVectorId ( const std::string &  AttributeName,
openfluid::core::GeoVectorValue Vector,
const std::string &  Column 
)

Creates a new attribute for all the LandREntity of this LandRGraph, and set for each LandREntity this attribute value as the vector value corresponding to the entity OFLD_ID.

Parameters:
AttributeNameThe name of the attribute to create.
VectorThe Name of the core::GeoVectorValue.
ColumnThe column of the core::GeoVectorValue to upload.
void openfluid::landr::LandRGraph::setAttributeFromVectorId ( const std::string &  AttributeName,
openfluid::landr::VectorDataset Vector,
const std::string &  Column 
)

Creates a new attribute for all the LandREntity of this LandRGraph, and set for each LandREntity this attribute value as the vector value corresponding to the entity OFLD_ID.

Parameters:
AttributeNameThe name of the attribute to create.
VectorThe Name of the VectorDataset.
ColumnThe column of the core::GeoVectorValue to upload.
virtual void openfluid::landr::LandRGraph::setAttributeFromVectorLocation ( const std::string &  AttributeName,
openfluid::core::GeoVectorValue Vector,
const std::string &  Column,
double  Thresh = 0.0001 
) [pure virtual]

Creates a new attribute for all the LandREntity of this LandRGraph, and set for each LandREntity this attribute value as the vector value corresponding to the Vector Entity Geometry.

Parameters:
AttributeNameThe name of the attribute to create.
VectorThe Name of the core::GeoVectorValue.
ColumnThe column of the core::GeoVectorValue to upload.
ThreshThe threshold of minimum distance between the core::GeoVectorValue geometry and the LandRGraph geometry (only used for LineStringGraph).

Implemented in openfluid::landr::LineStringGraph, and openfluid::landr::PolygonGraph.

virtual void openfluid::landr::LandRGraph::setAttributeFromVectorLocation ( const std::string &  AttributeName,
openfluid::landr::VectorDataset Vector,
const std::string &  Column,
double  Thresh = 0.0001 
) [pure virtual]

Creates a new attribute for all the LandREntity of this LandRGraph, and set for each LandREntity this attribute value as the vector value corresponding to the Vector Entity Geometry.

Parameters:
AttributeNameThe name of the attribute to create.
VectorThe Name of the VectorDataset.
ColumnThe column of the VectorDataset to upload.
ThreshThe threshold of minimum distance between the VectorDataset geometry and the LandRGraph geometry (only used for LineStringGraph).

Implemented in openfluid::landr::LineStringGraph, and openfluid::landr::PolygonGraph.

void openfluid::landr::LandRGraph::snapVertices ( double  snapTolerance)

Member Data Documentation

int openfluid::landr::LandRGraph::FileNum [static, protected]

A list of the LandREntity of this LandRGraph.

A map of the LandREntity of this LandRGraph and sorted by identifier.

const geos::geom::GeometryFactory* openfluid::landr::LandRGraph::mp_Factory [protected]

The geos::geom::GeometryFactory used to build this LandRGraph.

The RasterDataset associated to this LandRGraph.

The VectorDataset representation of the RasterDataset associated to this LandRGraph.

std::vector<geos::geom::Polygon*>* openfluid::landr::LandRGraph::mp_RasterPolygonizedPolys [protected]

A vector of geos::geom::Polygon representation of the RasterDataset associated to this LandRGraph.

The VectorDataset associated to this LandRGraph.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines