libosmscout
0.1
|
#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 | |
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. More... | |
TypeInfo & | AddFeature (const FeatureRef &feature) |
Add a feature to this type. More... | |
TypeInfo & | AddGroup (const std::string &groupName) |
Add a categorizing group name to the type. More... | |
bool | CanBeArea () const |
TypeInfo & | CanBeArea (bool canBeArea) |
If set to 'true', an area can be of this type. More... | |
bool | CanBeNode () const |
TypeInfo & | CanBeNode (bool canBeNode) |
If set to 'true', a node can be of this type. More... | |
bool | CanBeRelation () const |
TypeInfo & | CanBeRelation (bool canBeRelation) |
If set to 'true', a relation can be of this type. More... | |
bool | CanBeWay () const |
TypeInfo & | CanBeWay (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 |
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. More... | |
bool | CanRouteFoot () const |
TypeInfo & | CanRouteFoot (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 FeatureInstance & | GetFeature (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 |
TypeInfo & | operator= (const TypeInfo &&other)=delete |
TypeInfo & | operator= (const TypeInfo &other)=delete |
TypeInfo & | SetAreaId (TypeId id) |
Set the id of this type. More... | |
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). More... | |
TypeInfo & | SetIgnoreSeaLand (bool ignoreSeaLand) |
Set, if an object of this type should be ignored for land/sea calculation. More... | |
TypeInfo & | SetIndex (size_t index) |
Set the index of this type. More... | |
TypeInfo & | SetIndexAsAddress (bool indexAsAddress) |
Set, if an object of this type should be indexed as an address. More... | |
TypeInfo & | SetIndexAsLocation (bool indexAsLocation) |
Set, if an object of this type should be indexed as a location. More... | |
TypeInfo & | SetIndexAsPOI (bool indexAsPOI) |
Set, if an object of this type should be indexed as a POI. More... | |
TypeInfo & | SetIndexAsRegion (bool indexAsRegion) |
Set, if an object of this type should be indexed as a region. More... | |
TypeInfo & | SetInternal () |
Mark this type as internal. More... | |
TypeInfo & | SetIsPath (bool isPath) |
If set to 'true', a node can be of this type. More... | |
TypeInfo & | SetLanes (uint8_t lanes) |
TypeInfo & | SetMergeAreas (bool mergeAreas) |
Set to true, if "touching" areas of this type should get merged. More... | |
TypeInfo & | SetMultipolygon () |
An object is handled as multipolygon even though it may not have type=multipolygon set explicitly. More... | |
TypeInfo & | SetNodeId (TypeId id) |
Set the id of this type. More... | |
TypeInfo & | SetOnewayLanes (uint8_t lanes) |
TypeInfo & | SetOptimizeLowZoom (bool optimize) |
Set, if an object of this type should be optimized for low zoom. More... | |
TypeInfo & | SetPinWay (bool pinWay) |
TypeInfo & | SetRoute () |
An object is handled as route. More... | |
TypeInfo & | SetRouteId (TypeId id) |
Set the id of this type. More... | |
TypeInfo & | SetRouteMaster () |
An object is handled as route master. More... | |
TypeInfo & | SetSpecialType (SpecialType specialType) |
TypeInfo & | SetType (const std::string &name) |
The the name of this type. More... | |
TypeInfo & | SetWayId (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 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' |
|
inline |
bool osmscout::TypeInfo::GetFeature | ( | const std::string & | name, |
size_t & | index | ||
) | const |
Return the feature with the given 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 |
Referenced by osmscout::LanesFeature::Parse().
|
inline |
|
inline |
The name of the given type.
|
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 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 |
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 |
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.
|
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(), osmscout::TypeConfig::GetNodeType(), and osmscout::ost::Parser::TYPEKIND().
|
static |
Condition applies to relations.
Referenced by AddCondition(), osmscout::TypeConfig::GetRelationType(), and osmscout::ost::Parser::TYPEKIND().
|
static |
Condition applies to ways.
Referenced by AddCondition(), osmscout::TypeConfig::GetWayAreaType(), and osmscout::ost::Parser::TYPEKIND().