OTB  9.0.0
Orfeo Toolbox
Public Types | Public Member Functions | Static Public Member Functions | List of all members
otb::OSMDataToVectorDataGenerator Class Reference

#include <otbOSMDataToVectorDataGenerator.h>

+ Inheritance diagram for otb::OSMDataToVectorDataGenerator:
+ Collaboration diagram for otb::OSMDataToVectorDataGenerator:

Public Types

typedef itk::SmartPointer< const SelfConstPointer
 
typedef std::map< int, VertexTypeContainerType
 
typedef VectorDataType::DataNodeType DataNodeType
 
typedef std::pair< std::string, std::string > ElementPairType
 
typedef std::map< std::string, StringVectorTypeKeyMapType
 
typedef DataNodeType::LineType LineType
 
typedef itk::SmartPointer< SelfPointer
 
typedef std::vector< VertexTypePointTypeList
 
typedef DataNodeType::PolygonType PolygonType
 
typedef OSMDataToVectorDataGenerator Self
 
typedef std::vector< std::string > StringVectorType
 
typedef VectorDataSource< otb::VectorData<> > Superclass
 
typedef std::vector< VectorDataElementTypeVectorDataElementListType
 
typedef std::pair< ElementPairType, PointTypeListVectorDataElementType
 
typedef Superclass::OutputVectorDataType VectorDataType
 
typedef LineType::VertexType VertexType
 
- Public Types inherited from otb::VectorDataSource< otb::VectorData<> >
typedef itk::SmartPointer< const SelfConstPointer
 
typedef itk::ProcessObject::DataObjectPointerArraySizeType DataObjectPointerArraySizeType
 
typedef otb::VectorData<> ::Pointer OutputVectorDataPointer
 
typedef otb::VectorData<> OutputVectorDataType
 
typedef itk::SmartPointer< SelfPointer
 
typedef VectorDataSource Self
 
typedef itk::ProcessObject Superclass
 

Public Member Functions

virtual ::itk::LightObject::Pointer CreateAnother (void) const
 
virtual const char * GetNameOfClass () const
 
- Public Member Functions inherited from otb::VectorDataSource< otb::VectorData<> >
virtual ::itk::LightObject::Pointer CreateAnother (void) const
 
virtual const char * GetNameOfClass () const
 
virtual void GraftOutput (itk::DataObject *output)
 
virtual void GraftNthOutput (unsigned int idx, itk::DataObject *output)
 
virtual OutputVectorDataTypeGetOutput (void)
 
virtual OutputVectorDataTypeGetOutput (DataObjectPointerArraySizeType idx)
 

Static Public Member Functions

static Pointer New ()
 
- Static Public Member Functions inherited from otb::VectorDataSource< otb::VectorData<> >
static Pointer New ()
 
double m_North
 
double m_South
 
double m_East
 
double m_West
 
std::string m_Url
 
bool m_UseUrl
 
std::vector< std::string > m_KeyList
 
std::string m_FileName
 
ContainerType m_GeoPointContainer
 
VectorDataElementListType m_VectorDataElementList
 
CurlHelper::Pointer m_Curl
 
VectorDataType::Pointer m_OutputVectorData
 
KeyMapType m_KeysMap
 
std::string m_ClassKey
 
int m_ClassKeyValue
 
virtual void SetFileName (const char *_arg)
 
virtual const char * GetFileName () const
 
virtual void SetNorth (double _arg)
 
virtual void SetSouth (double _arg)
 
virtual void SetEast (double _arg)
 
virtual void SetWest (double _arg)
 
virtual double GetNorth ()
 
virtual double GetSouth ()
 
virtual double GetEast ()
 
virtual double GetWest ()
 
virtual std::string GetClassKey () const
 
virtual void SetClassKey (std::string _arg)
 
virtual int GetClassKeyValue () const
 
virtual void SetClassKeyValue (int _arg)
 
virtual void SetUseUrl (bool _arg)
 
void AddKey (const std::string &key)
 
const KeyMapType GetKeysMap () const
 
const VectorDataTypeGetVectorDataByName (const std::string &key)
 
const VectorDataTypeGetVectorDataByName (const std::string &key, const std::string &value)
 
void GenerateData () override
 
void ParseXmlFile ()
 
void ProcessVectorData (const std::string &key, const std::string &value)
 
bool IsKeyPresent (const std::string &key)
 
 OSMDataToVectorDataGenerator ()
 
 ~OSMDataToVectorDataGenerator () override
 
 OSMDataToVectorDataGenerator (const Self &)=delete
 
void operator= (const Self &)=delete
 
void AddKeyTypeToMap (const std::string &key, const std::string &value)
 

Additional Inherited Members

- Protected Member Functions inherited from otb::VectorDataSource< otb::VectorData<> >
 VectorDataSource ()
 
 ~VectorDataSource () override
 
void PrintSelf (std::ostream &os, itk::Indent indent) const override
 
virtual void AllocateOutputs ()
 

Detailed Description

Request OSM Server using the OSM API 0.6 to get the xml file storing the vector elements available.

This class request the OSM server using a bbox. The bbox parameters can be set using the methods Set{North, South, East, West}. Thus, only the vector elements that are within this bbox are returned in the Xml file.

The class parse the XML file for certain keys by default, the class allow adding key to be searched in the XML file. Use AddKey(const std::string& key) to add it to the search list. Here is a link to the OSM wiki where all the keys are listed : http://wiki.openstreetmap.org/wiki/Map_Features.

Adding a field and its integer value is possible through the methods SetClassKey(const std::string&) and SetClassKeyValue() The field is retrieved by GetFieldAsInt(), thus must be int-compatible

Getting output VectorData is possible via two methods :

1: Get all the features of key in a vector data via GetVectorDataByName(const std::string& key) For instance : GetVectorDataByName("highway")

2: Get only the features for a key that match a given value via GetVectorDataByName(const std::string& key, const std::string& value) For instance : GetVectorDataByName("highway", "motorway")

All the keys and their relative values are stored in a map. To get this map use the method GetKeysMap().

Note that if one of the server limits are crossed node/way/relation or area requested, an exception is raised.

Definition at line 78 of file otbOSMDataToVectorDataGenerator.h.

Member Typedef Documentation

◆ ConstPointer

typedef itk::SmartPointer<const Self> otb::OSMDataToVectorDataGenerator::ConstPointer

Definition at line 85 of file otbOSMDataToVectorDataGenerator.h.

◆ ContainerType

Definition at line 94 of file otbOSMDataToVectorDataGenerator.h.

◆ DataNodeType

typedef VectorDataType::DataNodeType otb::OSMDataToVectorDataGenerator::DataNodeType

Definition at line 88 of file otbOSMDataToVectorDataGenerator.h.

◆ ElementPairType

typedef std::pair<std::string, std::string> otb::OSMDataToVectorDataGenerator::ElementPairType

Definition at line 97 of file otbOSMDataToVectorDataGenerator.h.

◆ KeyMapType

Definition at line 106 of file otbOSMDataToVectorDataGenerator.h.

◆ LineType

typedef DataNodeType::LineType otb::OSMDataToVectorDataGenerator::LineType

Definition at line 89 of file otbOSMDataToVectorDataGenerator.h.

◆ Pointer

Definition at line 84 of file otbOSMDataToVectorDataGenerator.h.

◆ PointTypeList

Definition at line 100 of file otbOSMDataToVectorDataGenerator.h.

◆ PolygonType

typedef DataNodeType::PolygonType otb::OSMDataToVectorDataGenerator::PolygonType

Definition at line 90 of file otbOSMDataToVectorDataGenerator.h.

◆ Self

Standard class typedefs

Definition at line 82 of file otbOSMDataToVectorDataGenerator.h.

◆ StringVectorType

typedef std::vector<std::string> otb::OSMDataToVectorDataGenerator::StringVectorType

Definition at line 105 of file otbOSMDataToVectorDataGenerator.h.

◆ Superclass

Definition at line 83 of file otbOSMDataToVectorDataGenerator.h.

◆ VectorDataElementListType

Definition at line 102 of file otbOSMDataToVectorDataGenerator.h.

◆ VectorDataElementType

Definition at line 101 of file otbOSMDataToVectorDataGenerator.h.

◆ VectorDataType

Definition at line 87 of file otbOSMDataToVectorDataGenerator.h.

◆ VertexType

typedef LineType::VertexType otb::OSMDataToVectorDataGenerator::VertexType

Definition at line 91 of file otbOSMDataToVectorDataGenerator.h.

Constructor & Destructor Documentation

◆ OSMDataToVectorDataGenerator() [1/2]

otb::OSMDataToVectorDataGenerator::OSMDataToVectorDataGenerator ( )
protected

the url in OSM API format

◆ ~OSMDataToVectorDataGenerator()

otb::OSMDataToVectorDataGenerator::~OSMDataToVectorDataGenerator ( )
overrideprotected

the url in OSM API format

◆ OSMDataToVectorDataGenerator() [2/2]

otb::OSMDataToVectorDataGenerator::OSMDataToVectorDataGenerator ( const Self )
privatedelete

the url in OSM API format

Member Function Documentation

◆ AddKey()

void otb::OSMDataToVectorDataGenerator::AddKey ( const std::string &  key)
inline

Add a key to search into the list

Definition at line 146 of file otbOSMDataToVectorDataGenerator.h.

◆ AddKeyTypeToMap()

void otb::OSMDataToVectorDataGenerator::AddKeyTypeToMap ( const std::string &  key,
const std::string &  value 
)
private

the url in OSM API format

◆ CreateAnother()

virtual::itk::LightObject::Pointer otb::OSMDataToVectorDataGenerator::CreateAnother ( void  ) const

◆ GenerateData()

void otb::OSMDataToVectorDataGenerator::GenerateData ( )
overrideprotected

Generate Data method : launch the process

◆ GetClassKey()

virtual std::string otb::OSMDataToVectorDataGenerator::GetClassKey ( ) const
virtual

Field name containing the class identifier

◆ GetClassKeyValue()

virtual int otb::OSMDataToVectorDataGenerator::GetClassKeyValue ( ) const
virtual

Field name containing the class identifier

◆ GetEast()

virtual double otb::OSMDataToVectorDataGenerator::GetEast ( )
virtual

the url in OSM API format

◆ GetFileName()

virtual const char* otb::OSMDataToVectorDataGenerator::GetFileName ( ) const
virtual

the url in OSM API format

◆ GetKeysMap()

const KeyMapType otb::OSMDataToVectorDataGenerator::GetKeysMap ( ) const
inline

Method to get the map where are stored the keys and their value found when parsing the osm file.

Definition at line 155 of file otbOSMDataToVectorDataGenerator.h.

◆ GetNameOfClass()

virtual const char* otb::OSMDataToVectorDataGenerator::GetNameOfClass ( ) const
virtual

Run-time type information (and related methods).

Reimplemented in otb::ImageToOSMVectorDataGenerator< TImage >.

◆ GetNorth()

virtual double otb::OSMDataToVectorDataGenerator::GetNorth ( )
virtual

the url in OSM API format

◆ GetSouth()

virtual double otb::OSMDataToVectorDataGenerator::GetSouth ( )
virtual

the url in OSM API format

◆ GetVectorDataByName() [1/2]

const VectorDataType* otb::OSMDataToVectorDataGenerator::GetVectorDataByName ( const std::string &  key)

Method to get a VectorData where are stored elements corresponding the key

◆ GetVectorDataByName() [2/2]

const VectorDataType* otb::OSMDataToVectorDataGenerator::GetVectorDataByName ( const std::string &  key,
const std::string &  value 
)

Method to get a VectorData where are stored elements corresponding the key and the value

◆ GetWest()

virtual double otb::OSMDataToVectorDataGenerator::GetWest ( )
virtual

the url in OSM API format

◆ IsKeyPresent()

bool otb::OSMDataToVectorDataGenerator::IsKeyPresent ( const std::string &  key)
protected

internal convenient method to search if a key was already added

◆ New()

static Pointer otb::OSMDataToVectorDataGenerator::New ( )
static

Method for creation through the object factory.

◆ operator=()

void otb::OSMDataToVectorDataGenerator::operator= ( const Self )
privatedelete

the url in OSM API format

◆ ParseXmlFile()

void otb::OSMDataToVectorDataGenerator::ParseXmlFile ( )
protected

Parse the xml file get from OSM to compose the requested vector data

◆ ProcessVectorData()

void otb::OSMDataToVectorDataGenerator::ProcessVectorData ( const std::string &  key,
const std::string &  value 
)
protected

Compose the vector data

◆ SetClassKey()

virtual void otb::OSMDataToVectorDataGenerator::SetClassKey ( std::string  _arg)
virtual

the url in OSM API format

◆ SetClassKeyValue()

virtual void otb::OSMDataToVectorDataGenerator::SetClassKeyValue ( int  _arg)
virtual

the url in OSM API format

◆ SetEast()

virtual void otb::OSMDataToVectorDataGenerator::SetEast ( double  _arg)
virtual

the url in OSM API format

◆ SetFileName()

virtual void otb::OSMDataToVectorDataGenerator::SetFileName ( const char *  _arg)
virtual

Set/Get FileName

◆ SetNorth()

virtual void otb::OSMDataToVectorDataGenerator::SetNorth ( double  _arg)
virtual

Macro to Set/GEt the extent

◆ SetSouth()

virtual void otb::OSMDataToVectorDataGenerator::SetSouth ( double  _arg)
virtual

the url in OSM API format

◆ SetUseUrl()

virtual void otb::OSMDataToVectorDataGenerator::SetUseUrl ( bool  _arg)
virtual

the url in OSM API format

◆ SetWest()

virtual void otb::OSMDataToVectorDataGenerator::SetWest ( double  _arg)
virtual

the url in OSM API format

Member Data Documentation

◆ m_ClassKey

std::string otb::OSMDataToVectorDataGenerator::m_ClassKey
private

Class key and its value

Definition at line 229 of file otbOSMDataToVectorDataGenerator.h.

◆ m_ClassKeyValue

int otb::OSMDataToVectorDataGenerator::m_ClassKeyValue
private

the url in OSM API format

Definition at line 230 of file otbOSMDataToVectorDataGenerator.h.

◆ m_Curl

CurlHelper::Pointer otb::OSMDataToVectorDataGenerator::m_Curl
private

Curl object to get the XML file

Definition at line 220 of file otbOSMDataToVectorDataGenerator.h.

◆ m_East

double otb::OSMDataToVectorDataGenerator::m_East
private

the url in OSM API format

Definition at line 204 of file otbOSMDataToVectorDataGenerator.h.

◆ m_FileName

std::string otb::OSMDataToVectorDataGenerator::m_FileName
private

Variable used in to store the result of the parsing

Definition at line 215 of file otbOSMDataToVectorDataGenerator.h.

◆ m_GeoPointContainer

ContainerType otb::OSMDataToVectorDataGenerator::m_GeoPointContainer
private

the url in OSM API format

Definition at line 216 of file otbOSMDataToVectorDataGenerator.h.

◆ m_KeyList

std::vector<std::string> otb::OSMDataToVectorDataGenerator::m_KeyList
private

List to store keys to search

Definition at line 212 of file otbOSMDataToVectorDataGenerator.h.

◆ m_KeysMap

KeyMapType otb::OSMDataToVectorDataGenerator::m_KeysMap
private

container to store the keys and their types found

Definition at line 226 of file otbOSMDataToVectorDataGenerator.h.

◆ m_North

double otb::OSMDataToVectorDataGenerator::m_North
private

the url in OSM API format

Definition at line 202 of file otbOSMDataToVectorDataGenerator.h.

◆ m_OutputVectorData

VectorDataType::Pointer otb::OSMDataToVectorDataGenerator::m_OutputVectorData
private

Output VectorData requested with the method GetVectorDataByName

Definition at line 223 of file otbOSMDataToVectorDataGenerator.h.

◆ m_South

double otb::OSMDataToVectorDataGenerator::m_South
private

the url in OSM API format

Definition at line 203 of file otbOSMDataToVectorDataGenerator.h.

◆ m_Url

std::string otb::OSMDataToVectorDataGenerator::m_Url
private

the url in OSM API format

Definition at line 208 of file otbOSMDataToVectorDataGenerator.h.

◆ m_UseUrl

bool otb::OSMDataToVectorDataGenerator::m_UseUrl
private

the url in OSM API format

Definition at line 209 of file otbOSMDataToVectorDataGenerator.h.

◆ m_VectorDataElementList

VectorDataElementListType otb::OSMDataToVectorDataGenerator::m_VectorDataElementList
private

the url in OSM API format

Definition at line 217 of file otbOSMDataToVectorDataGenerator.h.

◆ m_West

double otb::OSMDataToVectorDataGenerator::m_West
private

the url in OSM API format

Definition at line 205 of file otbOSMDataToVectorDataGenerator.h.


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