libosmscout  0.1
osmscout::TypeInfo Class Referencefinal

#include <TypeConfig.h>

Classes

struct  TypeCondition
 

Public Types

enum  SpecialType : uint8_t { SpecialType::none = 0, SpecialType::multipolygon = 1, SpecialType::routeMaster = 2, SpecialType::route = 3 }
 

Public Member Functions

TypeInfoAddCondition (unsigned char types, const TagConditionRef &condition)
 
TypeInfoAddDescription (const std::string &languageCode, const std::string &description)
 Add a description of the type for the given language code. More...
 
TypeInfoAddFeature (const FeatureRef &feature)
 Add a feature to this type. More...
 
TypeInfoAddGroup (const std::string &groupName)
 Add a categorizing group name to the type. More...
 
bool CanBeArea () const
 
TypeInfoCanBeArea (bool canBeArea)
 If set to 'true', an area can be of this type. More...
 
bool CanBeNode () const
 
TypeInfoCanBeNode (bool canBeNode)
 If set to 'true', a node can be of this type. More...
 
bool CanBeRelation () const
 
TypeInfoCanBeRelation (bool canBeRelation)
 If set to 'true', a relation can be of this type. More...
 
bool CanBeWay () const
 
TypeInfoCanBeWay (bool canBeWay)
 If set to 'true', a way can be of this type. More...
 
bool CanRoute () const
 
bool CanRoute (Vehicle vehicle) const
 If set to 'true', an object of this type can be traveled by the given vehicle by default. More...
 
bool CanRouteBicycle () const
 
TypeInfoCanRouteBicycle (bool canBeRoute)
 
bool CanRouteCar () const
 
TypeInfoCanRouteCar (bool canBeRoute)
 If set to 'true', an object of this type can be traveled by car by default. More...
 
bool CanRouteFoot () const
 
TypeInfoCanRouteFoot (bool canBeRoute)
 If set to 'true', an object of this type can be traveled by feet by default. More...
 
TypeId GetAreaId () const
 Returns the unique id of this type. More...
 
const std::list< TypeCondition > & GetConditions () const
 Returns the list of conditions for the given type. More...
 
uint8_t GetDefaultAccess () const
 
std::string GetDescription (const std::string &languageCode) const
 Returns the description for the given language code. More...
 
const std::unordered_map< std::string, std::string > & GetDescriptions () const
 
bool GetFeature (const std::string &name, size_t &index) const
 Return the feature with the given name. More...
 
const FeatureInstanceGetFeature (size_t idx) const
 Return the feature at the given index. More...
 
size_t GetFeatureCount () const
 Returns the number of features of the asisgned type. More...
 
size_t GetFeatureMaskBytes () const
 Returns the (rounded) number of bytes required for storing the feature mask. More...
 
const std::vector< FeatureInstance > & GetFeatures () const
 Return the list of features assigned to this type. More...
 
size_t GetFeatureValueBufferSize () const
 Returns the size of the buffer required to store all FeatureValues of this type into. More...
 
const std::unordered_set< std::string > & GetGroups () const
 Return the set of groups the type is in. More...
 
bool GetIgnore () const
 
bool GetIgnoreSeaLand () const
 
size_t GetIndex () const
 Returns the index of this type. More...
 
bool GetIndexAsAddress () const
 
bool GetIndexAsLocation () const
 
bool GetIndexAsPOI () const
 
bool GetIndexAsRegion () const
 
uint8_t GetLanes () const
 
bool GetMergeAreas () const
 
std::string GetName () const
 The name of the given type. More...
 
TypeId GetNodeId () const
 Returns the unique id of this type. More...
 
uint8_t GetOnewayLanes () const
 
bool GetOptimizeLowZoom () const
 
bool GetPinWay () const
 
TypeId GetRouteId () const
 Returns the unique id of this type. More...
 
size_t GetSpecialFeatureMaskBytes () const
 Returns the (rounded) number of bytes required for storing the feature mask and one additional general purpose signal byte. More...
 
SpecialType GetSpecialType () const
 
TypeId GetWayId () const
 Returns the unique id of this type. More...
 
bool HasConditions () const
 Returns true, if there are any conditions bound to the type. More...
 
bool HasFeature (const std::string &featureName) const
 Returns true, if the feature with the given name has already been assigned to this type. More...
 
bool HasFeatures () const
 
bool IsInGroup (const std::string &groupName) const
 
bool IsInternal () const
 Return true, if this is a internal type, else false. More...
 
bool IsMultipolygon () const
 
bool IsPath () const
 
bool IsRoute () const
 
bool IsRouteMaster () const
 
TypeInfooperator= (const TypeInfo &&other)=delete
 
TypeInfooperator= (const TypeInfo &other)=delete
 
TypeInfoSetAreaId (TypeId id)
 Set the id of this type. More...
 
TypeInfoSetIgnore (bool ignore)
 If set to true, an object of this typoe should be ignored (not exported for renderng, routing, location indexing or other services). More...
 
TypeInfoSetIgnoreSeaLand (bool ignoreSeaLand)
 Set, if an object of this type should be ignored for land/sea calculation. More...
 
TypeInfoSetIndex (size_t index)
 Set the index of this type. More...
 
TypeInfoSetIndexAsAddress (bool indexAsAddress)
 Set, if an object of this type should be indexed as an address. More...
 
TypeInfoSetIndexAsLocation (bool indexAsLocation)
 Set, if an object of this type should be indexed as a location. More...
 
TypeInfoSetIndexAsPOI (bool indexAsPOI)
 Set, if an object of this type should be indexed as a POI. More...
 
TypeInfoSetIndexAsRegion (bool indexAsRegion)
 Set, if an object of this type should be indexed as a region. More...
 
TypeInfoSetInternal ()
 Mark this type as internal. More...
 
TypeInfoSetIsPath (bool isPath)
 If set to 'true', a node can be of this type. More...
 
TypeInfoSetLanes (uint8_t lanes)
 
TypeInfoSetMergeAreas (bool mergeAreas)
 Set to true, if "touching" areas of this type should get merged. More...
 
TypeInfoSetMultipolygon ()
 An object is handled as multipolygon even though it may not have type=multipolygon set explicitly. More...
 
TypeInfoSetNodeId (TypeId id)
 Set the id of this type. More...
 
TypeInfoSetOnewayLanes (uint8_t lanes)
 
TypeInfoSetOptimizeLowZoom (bool optimize)
 Set, if an object of this type should be optimized for low zoom. More...
 
TypeInfoSetPinWay (bool pinWay)
 
TypeInfoSetRoute ()
 An object is handled as route. More...
 
TypeInfoSetRouteId (TypeId id)
 Set the id of this type. More...
 
TypeInfoSetRouteMaster ()
 An object is handled as route master. More...
 
TypeInfoSetSpecialType (SpecialType specialType)
 
TypeInfoSetType (const std::string &name)
 The the name of this type. More...
 
TypeInfoSetWayId (TypeId id)
 Set the id of this type. More...
 
 TypeInfo (const std::string &name)
 
 TypeInfo (const TypeInfo &other)=delete
 We forbid copying and moving of TypeInfo instances. More...
 
 TypeInfo (TypeInfo &&other)=delete
 
 ~TypeInfo ()=default
 

Static Public Member Functions

static TypeInfoRef Read (FileScanner &scanner)
 

Static Public Attributes

static const uint8_t typeArea = 1u << 2u
 Condition applies to areas. More...
 
static const uint8_t typeNode = 1u << 0u
 Condition applies to nodes. More...
 
static const uint8_t typeRelation = 1u << 3u
 Condition applies to relations. More...
 
static const uint8_t typeWay = 1u << 1u
 Condition applies to ways. More...
 

Detailed Description

Detailed information about one object type

See also
TypeConfig

Member Enumeration Documentation

◆ SpecialType

enum osmscout::TypeInfo::SpecialType : uint8_t
strong
Enumerator
none 
multipolygon 
routeMaster 
route 

Constructor & Destructor Documentation

◆ TypeInfo() [1/3]

osmscout::TypeInfo::TypeInfo ( const std::string &  name)
explicit

◆ ~TypeInfo()

osmscout::TypeInfo::~TypeInfo ( )
default

◆ TypeInfo() [2/3]

osmscout::TypeInfo::TypeInfo ( const TypeInfo other)
delete

We forbid copying and moving of TypeInfo instances.

◆ TypeInfo() [3/3]

osmscout::TypeInfo::TypeInfo ( TypeInfo &&  other)
delete

Member Function Documentation

◆ AddCondition()

TypeInfo & osmscout::TypeInfo::AddCondition ( unsigned char  types,
const TagConditionRef condition 
)

◆ AddDescription()

TypeInfo & osmscout::TypeInfo::AddDescription ( const std::string &  languageCode,
const std::string &  description 
)

Add a description of the type for the given language code.

Parameters
languageCodelanguage code like for example 'en'or 'de'
descriptiondescription of the type
Returns
type info instance

Referenced by osmscout::ost::Parser::TYPEDESCS().

◆ AddFeature()

TypeInfo & osmscout::TypeInfo::AddFeature ( const FeatureRef feature)

Add a feature to this type.

References osmscout::BitsToBytes().

Referenced by osmscout::ost::Parser::TYPEFEATURE().

◆ AddGroup()

TypeInfo & osmscout::TypeInfo::AddGroup ( const std::string &  groupName)

Add a categorizing group name to the type.

Referenced by osmscout::ost::Parser::GROUPS().

◆ CanBeArea() [1/2]

bool osmscout::TypeInfo::CanBeArea ( ) const
inline

◆ CanBeArea() [2/2]

TypeInfo& osmscout::TypeInfo::CanBeArea ( bool  canBeArea)
inline

If set to 'true', an area can be of this type.

◆ CanBeNode() [1/2]

bool osmscout::TypeInfo::CanBeNode ( ) const
inline

◆ CanBeNode() [2/2]

TypeInfo& osmscout::TypeInfo::CanBeNode ( bool  canBeNode)
inline

If set to 'true', a node can be of this type.

◆ CanBeRelation() [1/2]

bool osmscout::TypeInfo::CanBeRelation ( ) const
inline

◆ CanBeRelation() [2/2]

TypeInfo& osmscout::TypeInfo::CanBeRelation ( bool  canBeRelation)
inline

If set to 'true', a relation can be of this type.

◆ CanBeWay() [1/2]

bool osmscout::TypeInfo::CanBeWay ( ) const
inline

◆ CanBeWay() [2/2]

TypeInfo& osmscout::TypeInfo::CanBeWay ( bool  canBeWay)
inline

If set to 'true', a way can be of this type.

◆ CanRoute() [1/2]

bool osmscout::TypeInfo::CanRoute ( ) const
inline

◆ CanRoute() [2/2]

bool osmscout::TypeInfo::CanRoute ( Vehicle  vehicle) const
inline

If set to 'true', an object of this type can be traveled by the given vehicle by default.

References osmscout::vehicleBicycle, osmscout::vehicleCar, and osmscout::vehicleFoot.

◆ CanRouteBicycle() [1/2]

bool osmscout::TypeInfo::CanRouteBicycle ( ) const
inline

Referenced by GetDefaultAccess().

◆ CanRouteBicycle() [2/2]

TypeInfo& osmscout::TypeInfo::CanRouteBicycle ( bool  canBeRoute)
inline

◆ CanRouteCar() [1/2]

bool osmscout::TypeInfo::CanRouteCar ( ) const
inline

Referenced by GetDefaultAccess().

◆ CanRouteCar() [2/2]

TypeInfo& osmscout::TypeInfo::CanRouteCar ( bool  canBeRoute)
inline

If set to 'true', an object of this type can be traveled by car by default.

Referenced by osmscout::AccessFeature::Parse(), and osmscout::ost::Parser::PATH().

◆ CanRouteFoot() [1/2]

bool osmscout::TypeInfo::CanRouteFoot ( ) const
inline

Referenced by GetDefaultAccess().

◆ CanRouteFoot() [2/2]

TypeInfo& osmscout::TypeInfo::CanRouteFoot ( bool  canBeRoute)
inline

If set to 'true', an object of this type can be traveled by feet by default.

Referenced by osmscout::AccessFeature::Parse(), and osmscout::ost::Parser::PATH().

◆ GetAreaId()

TypeId osmscout::TypeInfo::GetAreaId ( ) const
inline

Returns the unique id of this type.

You should not use the type id as an index.

◆ GetConditions()

const std::list<TypeCondition>& osmscout::TypeInfo::GetConditions ( ) const
inline

Returns the list of conditions for the given type.

◆ GetDefaultAccess()

◆ GetDescription()

std::string osmscout::TypeInfo::GetDescription ( const std::string &  languageCode) const

Returns the description for the given language code.

Returns an empty string, if no description is available for the given language code.

Parameters
languageCodelanguageCode like for example 'en' or 'de'
Returns
Description or empty string

◆ GetDescriptions()

const std::unordered_map<std::string,std::string>& osmscout::TypeInfo::GetDescriptions ( ) const
inline

◆ GetFeature() [1/2]

bool osmscout::TypeInfo::GetFeature ( const std::string &  name,
size_t &  index 
) const

Return the feature with the given name.

◆ GetFeature() [2/2]

const FeatureInstance& osmscout::TypeInfo::GetFeature ( size_t  idx) const
inline

Return the feature at the given index.

◆ GetFeatureCount()

size_t osmscout::TypeInfo::GetFeatureCount ( ) const
inline

Returns the number of features of the asisgned type.

◆ GetFeatureMaskBytes()

size_t osmscout::TypeInfo::GetFeatureMaskBytes ( ) const
inline

Returns the (rounded) number of bytes required for storing the feature mask.

◆ GetFeatures()

const std::vector<FeatureInstance>& osmscout::TypeInfo::GetFeatures ( ) const
inline

Return the list of features assigned to this type.

◆ GetFeatureValueBufferSize()

size_t osmscout::TypeInfo::GetFeatureValueBufferSize ( ) const
inline

Returns the size of the buffer required to store all FeatureValues of this type into.

◆ GetGroups()

const std::unordered_set<std::string>& osmscout::TypeInfo::GetGroups ( ) const
inline

Return the set of groups the type is in.

◆ GetIgnore()

bool osmscout::TypeInfo::GetIgnore ( ) const
inline

◆ GetIgnoreSeaLand()

bool osmscout::TypeInfo::GetIgnoreSeaLand ( ) const
inline

◆ GetIndex()

size_t osmscout::TypeInfo::GetIndex ( ) const
inline

Returns the index of this type.

The index is assured to in the interval [0..GetTypeCount()[

Referenced by osmscout::TypeDistributionDataFile::GetAreaCount(), osmscout::TypeDistributionDataFile::GetNodeCount(), and osmscout::TypeDistributionDataFile::GetWayCount().

◆ GetIndexAsAddress()

bool osmscout::TypeInfo::GetIndexAsAddress ( ) const
inline

◆ GetIndexAsLocation()

bool osmscout::TypeInfo::GetIndexAsLocation ( ) const
inline

◆ GetIndexAsPOI()

bool osmscout::TypeInfo::GetIndexAsPOI ( ) const
inline

◆ GetIndexAsRegion()

bool osmscout::TypeInfo::GetIndexAsRegion ( ) const
inline

◆ GetLanes()

uint8_t osmscout::TypeInfo::GetLanes ( ) const
inline

◆ GetMergeAreas()

bool osmscout::TypeInfo::GetMergeAreas ( ) const
inline

◆ GetName()

std::string osmscout::TypeInfo::GetName ( ) const
inline

The name of the given type.

◆ GetNodeId()

TypeId osmscout::TypeInfo::GetNodeId ( ) const
inline

Returns the unique id of this type.

You should not use the type id as an index.

◆ GetOnewayLanes()

uint8_t osmscout::TypeInfo::GetOnewayLanes ( ) const
inline

◆ GetOptimizeLowZoom()

bool osmscout::TypeInfo::GetOptimizeLowZoom ( ) const
inline

◆ GetPinWay()

bool osmscout::TypeInfo::GetPinWay ( ) const
inline

◆ GetRouteId()

TypeId osmscout::TypeInfo::GetRouteId ( ) const
inline

Returns the unique id of this type.

You should not use the type id as an index.

◆ GetSpecialFeatureMaskBytes()

size_t osmscout::TypeInfo::GetSpecialFeatureMaskBytes ( ) const
inline

Returns the (rounded) number of bytes required for storing the feature mask and one additional general purpose signal byte.

◆ GetSpecialType()

SpecialType osmscout::TypeInfo::GetSpecialType ( ) const
inline

◆ GetWayId()

TypeId osmscout::TypeInfo::GetWayId ( ) const
inline

Returns the unique id of this type.

You should not use the type id as an index.

◆ HasConditions()

bool osmscout::TypeInfo::HasConditions ( ) const
inline

Returns true, if there are any conditions bound to the type.

If the conditions are met for a given object, the object is in turn of the given type. to

◆ HasFeature()

bool osmscout::TypeInfo::HasFeature ( const std::string &  featureName) const

Returns true, if the feature with the given name has already been assigned to this type.

Referenced by osmscout::ost::Parser::TYPEFEATURE().

◆ HasFeatures()

bool osmscout::TypeInfo::HasFeatures ( ) const
inline

◆ IsInGroup()

bool osmscout::TypeInfo::IsInGroup ( const std::string &  groupName) const
inline

◆ IsInternal()

bool osmscout::TypeInfo::IsInternal ( ) const
inline

Return true, if this is a internal type, else false.

◆ IsMultipolygon()

bool osmscout::TypeInfo::IsMultipolygon ( ) const
inline

◆ IsPath()

bool osmscout::TypeInfo::IsPath ( ) const
inline

◆ IsRoute()

bool osmscout::TypeInfo::IsRoute ( ) const
inline

◆ IsRouteMaster()

bool osmscout::TypeInfo::IsRouteMaster ( ) const
inline

◆ operator=() [1/2]

TypeInfo& osmscout::TypeInfo::operator= ( const TypeInfo &&  other)
delete

◆ operator=() [2/2]

TypeInfo& osmscout::TypeInfo::operator= ( const TypeInfo other)
delete

◆ Read()

◆ SetAreaId()

TypeInfo & osmscout::TypeInfo::SetAreaId ( TypeId  id)

Set the id of this type.

◆ SetIgnore()

TypeInfo& osmscout::TypeInfo::SetIgnore ( bool  ignore)
inline

If set to true, an object of this typoe should be ignored (not exported for renderng, routing, location indexing or other services).

◆ SetIgnoreSeaLand()

TypeInfo& osmscout::TypeInfo::SetIgnoreSeaLand ( bool  ignoreSeaLand)
inline

Set, if an object of this type should be ignored for land/sea calculation.

Referenced by osmscout::ost::Parser::TYPEOPTION().

◆ SetIndex()

TypeInfo & osmscout::TypeInfo::SetIndex ( size_t  index)

Set the index of this type.

The index is assured to in the interval [0..GetTypeCount()[

◆ SetIndexAsAddress()

TypeInfo& osmscout::TypeInfo::SetIndexAsAddress ( bool  indexAsAddress)
inline

Set, if an object of this type should be indexed as an address.

Referenced by osmscout::ost::Parser::TYPEOPTION().

◆ SetIndexAsLocation()

TypeInfo& osmscout::TypeInfo::SetIndexAsLocation ( bool  indexAsLocation)
inline

Set, if an object of this type should be indexed as a location.

Referenced by osmscout::ost::Parser::TYPEOPTION().

◆ SetIndexAsPOI()

TypeInfo& osmscout::TypeInfo::SetIndexAsPOI ( bool  indexAsPOI)
inline

Set, if an object of this type should be indexed as a POI.

Referenced by osmscout::ost::Parser::TYPEOPTION().

◆ SetIndexAsRegion()

TypeInfo& osmscout::TypeInfo::SetIndexAsRegion ( bool  indexAsRegion)
inline

Set, if an object of this type should be indexed as a region.

Referenced by osmscout::ost::Parser::TYPEOPTION().

◆ SetInternal()

TypeInfo & osmscout::TypeInfo::SetInternal ( )

Mark this type as internal.

◆ SetIsPath()

TypeInfo& osmscout::TypeInfo::SetIsPath ( bool  isPath)
inline

If set to 'true', a node can be of this type.

Referenced by osmscout::ost::Parser::LANES(), and osmscout::ost::Parser::PATH().

◆ SetLanes()

TypeInfo& osmscout::TypeInfo::SetLanes ( uint8_t  lanes)
inline

◆ SetMergeAreas()

TypeInfo& osmscout::TypeInfo::SetMergeAreas ( bool  mergeAreas)
inline

Set to true, if "touching" areas of this type should get merged.

Referenced by osmscout::ost::Parser::TYPEOPTION().

◆ SetMultipolygon()

TypeInfo& osmscout::TypeInfo::SetMultipolygon ( )
inline

An object is handled as multipolygon even though it may not have type=multipolygon set explicitly.

Referenced by osmscout::ost::Parser::SPECIALTYPE().

◆ SetNodeId()

TypeInfo & osmscout::TypeInfo::SetNodeId ( TypeId  id)

Set the id of this type.

◆ SetOnewayLanes()

TypeInfo& osmscout::TypeInfo::SetOnewayLanes ( uint8_t  lanes)
inline

◆ SetOptimizeLowZoom()

TypeInfo& osmscout::TypeInfo::SetOptimizeLowZoom ( bool  optimize)
inline

Set, if an object of this type should be optimized for low zoom.

Referenced by osmscout::ost::Parser::TYPEOPTION().

◆ SetPinWay()

TypeInfo& osmscout::TypeInfo::SetPinWay ( bool  pinWay)
inline

◆ SetRoute()

TypeInfo& osmscout::TypeInfo::SetRoute ( )
inline

An object is handled as route.

Referenced by osmscout::ost::Parser::SPECIALTYPE().

◆ SetRouteId()

TypeInfo & osmscout::TypeInfo::SetRouteId ( TypeId  id)

Set the id of this type.

◆ SetRouteMaster()

TypeInfo& osmscout::TypeInfo::SetRouteMaster ( )
inline

An object is handled as route master.

Referenced by osmscout::ost::Parser::SPECIALTYPE().

◆ SetSpecialType()

TypeInfo& osmscout::TypeInfo::SetSpecialType ( SpecialType  specialType)
inline

◆ SetType()

TypeInfo & osmscout::TypeInfo::SetType ( const std::string &  name)

The the name of this type.

◆ SetWayId()

TypeInfo & osmscout::TypeInfo::SetWayId ( TypeId  id)

Set the id of this type.

Member Data Documentation

◆ typeArea

const uint8_t osmscout::TypeInfo::typeArea = 1u << 2u
static

◆ typeNode

const uint8_t osmscout::TypeInfo::typeNode = 1u << 0u
static

◆ typeRelation

const uint8_t osmscout::TypeInfo::typeRelation = 1u << 3u
static

◆ typeWay

const uint8_t osmscout::TypeInfo::typeWay = 1u << 1u
static

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