|
libosmscout 0.1
|
Detailed information about one object type. More...
#include <TypeConfig.h>
Classes | |
| struct | TypeCondition |
| A type can have a number of conditions that allow to identify the type of an object based on its tag values. More... | |
Public Types | |
| enum class | SpecialType : uint8_t { none = 0 , multipolygon = 1 , routeMaster = 2 , route = 3 } |
Public Member Functions | |
| TypeInfo & | AddCondition (unsigned char types, const TagConditionRef &condition) |
| TypeInfo & | AddDescription (const std::string &languageCode, const std::string &description) |
| Add a description of the type for the given language code. | |
| TypeInfo & | AddFeature (const FeatureRef &feature) |
| Add a feature to this type. | |
| TypeInfo & | AddGroup (const std::string &groupName) |
| Add a categorizing group name to the type. | |
| bool | CanBeArea () const |
| TypeInfo & | CanBeArea (bool canBeArea) |
| If set to 'true', an area can be of this type. | |
| bool | CanBeNode () const |
| TypeInfo & | CanBeNode (bool canBeNode) |
| If set to 'true', a node can be of this type. | |
| bool | CanBeRelation () const |
| TypeInfo & | CanBeRelation (bool canBeRelation) |
| If set to 'true', a relation can be of this type. | |
| bool | CanBeWay () const |
| TypeInfo & | CanBeWay (bool canBeWay) |
| If set to 'true', a way can be of this type. | |
| 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. | |
| bool | CanRouteBicycle () const |
| TypeInfo & | CanRouteBicycle (bool canBeRoute) |
| bool | CanRouteCar () const |
| TypeInfo & | CanRouteCar (bool canBeRoute) |
| If set to 'true', an object of this type can be traveled by car by default. | |
| bool | CanRouteFoot () const |
| TypeInfo & | CanRouteFoot (bool canBeRoute) |
| If set to 'true', an object of this type can be traveled by feet by default. | |
| TypeId | GetAreaId () const |
| Returns the unique id of this type. | |
| const std::list< TypeCondition > & | GetConditions () const |
| Returns the list of conditions for the given type. | |
| uint8_t | GetDefaultAccess () const |
| std::string | GetDescription (const std::string &languageCode) const |
| Returns the description for the given language code. | |
| 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. | |
| const FeatureInstance & | GetFeature (size_t idx) const |
| Return the feature at the given index. | |
| size_t | GetFeatureCount () const |
| Returns the number of features of the asisgned type. | |
| size_t | GetFeatureMaskBytes () const |
| Returns the (rounded) number of bytes required for storing the feature mask. | |
| const std::vector< FeatureInstance > & | GetFeatures () const |
| Return the list of features assigned to this type. | |
| size_t | GetFeatureValueBufferSize () const |
| Returns the size of the buffer required to store all FeatureValues of this type into. | |
| const std::unordered_set< std::string > & | GetGroups () const |
| Return the set of groups the type is in. | |
| bool | GetIgnore () const |
| bool | GetIgnoreSeaLand () const |
| size_t | GetIndex () const |
| Returns the index of this type. | |
| bool | GetIndexAsAddress () const |
| bool | GetIndexAsLocation () const |
| bool | GetIndexAsPOI () const |
| bool | GetIndexAsRegion () const |
| uint8_t | GetLanes () const |
| std::string | GetLocalizedDescription (const std::string &languageCode) const |
| Returns the description for the given language code, falling back to the English description. | |
| bool | GetMergeAreas () const |
| std::string | GetName () const |
| The name of the given type. | |
| TypeId | GetNodeId () const |
| Returns the unique id of this type. | |
| uint8_t | GetOnewayLanes () const |
| bool | GetOptimizeLowZoom () const |
| bool | GetPinWay () const |
| TypeId | GetRouteId () const |
| Returns the unique id of this type. | |
| size_t | GetSpecialFeatureMaskBytes () const |
| Returns the (rounded) number of bytes required for storing the feature mask and one additional general purpose signal byte. | |
| SpecialType | GetSpecialType () const |
| TypeId | GetWayId () const |
| Returns the unique id of this type. | |
| bool | HasConditions () const |
| Returns true, if there are any conditions bound to the type. | |
| bool | HasFeature (const std::string &featureName) const |
| Returns true, if the feature with the given name has already been assigned to this type. | |
| bool | HasFeatures () const |
| bool | IsInGroup (const std::string &groupName) const |
| bool | IsInternal () const |
| Return true, if this is a internal type, else false. | |
| bool | IsMultipolygon () const |
| bool | IsPath () const |
| bool | IsRoute () const |
| bool | IsRouteMaster () const |
| TypeInfo & | operator= (const TypeInfo &&other)=delete |
| TypeInfo & | operator= (const TypeInfo &other)=delete |
| TypeInfo & | SetAreaId (TypeId id) |
| Set the id of this type. | |
| TypeInfo & | SetIgnore (bool ignore) |
| If set to true, an object of this typoe should be ignored (not exported for renderng, routing, location indexing or other services). | |
| TypeInfo & | SetIgnoreSeaLand (bool ignoreSeaLand) |
| Set, if an object of this type should be ignored for land/sea calculation. | |
| TypeInfo & | SetIndex (size_t index) |
| Set the index of this type. | |
| TypeInfo & | SetIndexAsAddress (bool indexAsAddress) |
| Set, if an object of this type should be indexed as an address. | |
| TypeInfo & | SetIndexAsLocation (bool indexAsLocation) |
| Set, if an object of this type should be indexed as a location. | |
| TypeInfo & | SetIndexAsPOI (bool indexAsPOI) |
| Set, if an object of this type should be indexed as a POI. | |
| TypeInfo & | SetIndexAsRegion (bool indexAsRegion) |
| Set, if an object of this type should be indexed as a region. | |
| TypeInfo & | SetInternal () |
| Mark this type as internal. | |
| TypeInfo & | SetIsPath (bool isPath) |
| If set to 'true', a node can be of this type. | |
| TypeInfo & | SetLanes (uint8_t lanes) |
| TypeInfo & | SetMergeAreas (bool mergeAreas) |
| Set to true, if "touching" areas of this type should get merged. | |
| TypeInfo & | SetMultipolygon () |
| An object is handled as multipolygon even though it may not have type=multipolygon set explicitly. | |
| TypeInfo & | SetNodeId (TypeId id) |
| Set the id of this type. | |
| TypeInfo & | SetOnewayLanes (uint8_t lanes) |
| TypeInfo & | SetOptimizeLowZoom (bool optimize) |
| Set, if an object of this type should be optimized for low zoom. | |
| TypeInfo & | SetPinWay (bool pinWay) |
| TypeInfo & | SetRoute () |
| An object is handled as route. | |
| TypeInfo & | SetRouteId (TypeId id) |
| Set the id of this type. | |
| TypeInfo & | SetRouteMaster () |
| An object is handled as route master. | |
| TypeInfo & | SetSpecialType (SpecialType specialType) |
| TypeInfo & | SetType (const std::string &name) |
| The the name of this type. | |
| TypeInfo & | SetWayId (TypeId id) |
| Set the id of this type. | |
| TypeInfo (const std::string &name) | |
| TypeInfo (const TypeInfo &other)=delete | |
| We forbid copying and moving of TypeInfo instances. | |
| 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. | |
| static const uint8_t | typeNode = 1u << 0u |
| Condition applies to nodes. | |
| static const uint8_t | typeRelation = 1u << 3u |
| Condition applies to relations. | |
| static const uint8_t | typeWay = 1u << 1u |
| Condition applies to ways. | |
Detailed information about one object type.
|
strong |
|
explicit |
|
default |
|
delete |
We forbid copying and moving of TypeInfo instances.
|
delete |
| TypeInfo & osmscout::TypeInfo::AddCondition | ( | unsigned char | types, |
| const TagConditionRef & | condition | ||
| ) |
| TypeInfo & osmscout::TypeInfo::AddDescription | ( | const std::string & | languageCode, |
| const std::string & | description | ||
| ) |
Add a description of the type for the given language code.
| languageCode | language code like for example 'en'or 'de' |
| description | description of the type |
Referenced by osmscout::ost::Parser::TYPEDESCS().
| TypeInfo & osmscout::TypeInfo::AddFeature | ( | const FeatureRef & | feature | ) |
Add a feature to this type.
References osmscout::BitsToBytes().
Referenced by osmscout::ost::Parser::TYPEFEATURE().
| TypeInfo & osmscout::TypeInfo::AddGroup | ( | const std::string & | groupName | ) |
Add a categorizing group name to the type.
Referenced by osmscout::ost::Parser::GROUPS().
|
inline |
|
inline |
If set to 'true', an area can be of this type.
|
inline |
|
inline |
If set to 'true', a node can be of this type.
|
inline |
|
inline |
If set to 'true', a relation can be of this type.
|
inline |
|
inline |
If set to 'true', a way can be of this type.
|
inline |
|
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.
|
inline |
Referenced by GetDefaultAccess().
|
inline |
Referenced by osmscout::AccessFeature::Parse(), and osmscout::ost::Parser::PATH().
|
inline |
Referenced by GetDefaultAccess().
|
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().
|
inline |
Referenced by GetDefaultAccess().
|
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().
|
inline |
Returns the unique id of this type.
You should not use the type id as an index.
|
inline |
Returns the list of conditions for the given type.
| uint8_t osmscout::TypeInfo::GetDefaultAccess | ( | ) | const |
References osmscout::AccessFeatureValue::bicycleBackward, osmscout::AccessFeatureValue::bicycleForward, CanRouteBicycle(), CanRouteCar(), CanRouteFoot(), osmscout::AccessFeatureValue::carBackward, osmscout::AccessFeatureValue::carForward, osmscout::AccessFeatureValue::footBackward, and osmscout::AccessFeatureValue::footForward.
| 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.
| languageCode | languageCode like for example 'en' or 'de' |
Referenced by GetLocalizedDescription().
|
inline |
| bool osmscout::TypeInfo::GetFeature | ( | const std::string & | name, |
| size_t & | index | ||
| ) | const |
Return the feature with the given name.
References name.
|
inline |
Return the feature at the given index.
|
inline |
Returns the number of features of the asisgned type.
|
inline |
Returns the (rounded) number of bytes required for storing the feature mask.
|
inline |
Return the list of features assigned to this type.
|
inline |
Returns the size of the buffer required to store all FeatureValues of this type into.
|
inline |
Return the set of groups the type is in.
|
inline |
|
inline |
|
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().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
References lanes.
Referenced by osmscout::LanesFeature::Parse().
| std::string osmscout::TypeInfo::GetLocalizedDescription | ( | const std::string & | languageCode | ) | const |
Returns the description for the given language code, falling back to the English description.
Returns the description for the given language code.
If the type carries no description for the given language, the description for 'en' is returned. If it carries neither, an empty string is returned, so that a caller can tell a type without a description from a described one.
| languageCode | languageCode like for example 'de' |
Returns the English description, if no description is available for the given language code. Returns an empty string, if the type has no description at all.
| languageCode | languageCode like for example 'de' |
References GetDescription().
|
inline |
|
inline |
The name of the given type.
References name.
|
inline |
Returns the unique id of this type.
You should not use the type id as an index.
|
inline |
Referenced by osmscout::LanesFeature::Parse().
|
inline |
|
inline |
|
inline |
Returns the unique id of this type.
You should not use the type id as an index.
|
inline |
Returns the (rounded) number of bytes required for storing the feature mask and one additional general purpose signal byte.
|
inline |
|
inline |
Returns the unique id of this type.
You should not use the type id as an index.
|
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
| 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().
|
inline |
|
inline |
|
inline |
Return true, if this is a internal type, else false.
|
inline |
|
inline |
|
inline |
|
inline |
|
static |
References lanes, name, osmscout::FileScanner::ReadBool(), osmscout::FileScanner::ReadString(), and osmscout::FileScanner::ReadUInt8().
Referenced by osmscout::TypeConfig::LoadFromDataFile().
|
inline |
If set to true, an object of this typoe should be ignored (not exported for renderng, routing, location indexing or other services).
|
inline |
Set, if an object of this type should be ignored for land/sea calculation.
Referenced by osmscout::ost::Parser::TYPEOPTION().
| TypeInfo & osmscout::TypeInfo::SetIndex | ( | size_t | index | ) |
Set the index of this type.
The index is assured to in the interval [0..GetTypeCount()[
|
inline |
Set, if an object of this type should be indexed as an address.
Referenced by osmscout::ost::Parser::TYPEOPTION().
|
inline |
Set, if an object of this type should be indexed as a location.
Referenced by osmscout::ost::Parser::TYPEOPTION().
|
inline |
Set, if an object of this type should be indexed as a POI.
Referenced by osmscout::ost::Parser::TYPEOPTION().
|
inline |
Set, if an object of this type should be indexed as a region.
Referenced by osmscout::ost::Parser::TYPEOPTION().
| TypeInfo & osmscout::TypeInfo::SetInternal | ( | ) |
Mark this type as internal.
|
inline |
If set to 'true', a node can be of this type.
Referenced by osmscout::ost::Parser::LANES(), and osmscout::ost::Parser::PATH().
|
inline |
References lanes.
Referenced by osmscout::ost::Parser::LANES().
|
inline |
Set to true, if "touching" areas of this type should get merged.
Referenced by osmscout::ost::Parser::TYPEOPTION().
|
inline |
An object is handled as multipolygon even though it may not have type=multipolygon set explicitly.
Referenced by osmscout::ost::Parser::SPECIALTYPE().
|
inline |
References lanes.
Referenced by osmscout::ost::Parser::LANES().
|
inline |
Set, if an object of this type should be optimized for low zoom.
Referenced by osmscout::ost::Parser::TYPEOPTION().
|
inline |
Referenced by osmscout::ost::Parser::TYPEOPTION().
|
inline |
An object is handled as route.
Referenced by osmscout::ost::Parser::SPECIALTYPE().
|
inline |
An object is handled as route master.
Referenced by osmscout::ost::Parser::SPECIALTYPE().
|
inline |
| TypeInfo & osmscout::TypeInfo::SetType | ( | const std::string & | name | ) |
The the name of this type.
References name.
|
static |
Condition applies to areas.
Referenced by AddCondition(), osmscout::TypeConfig::GetRelationType(), osmscout::TypeConfig::GetWayAreaType(), and osmscout::ost::Parser::TYPEKIND().
|
static |
Condition applies to nodes.
Referenced by AddCondition(), and osmscout::ost::Parser::TYPEKIND().
|
static |
Condition applies to relations.
Referenced by AddCondition(), and osmscout::ost::Parser::TYPEKIND().
|
static |
Condition applies to ways.
Referenced by AddCondition(), osmscout::TypeConfig::GetWayAreaType(), and osmscout::ost::Parser::TYPEKIND().