libosmscout  1.1.1
TypeConfig.h
Go to the documentation of this file.
1 #ifndef OSMSCOUT_TYPECONFIG_H
2 #define OSMSCOUT_TYPECONFIG_H
3 
4 /*
5  This source is part of the libosmscout library
6  Copyright (C) 2009 Tim Teulings
7 
8  This library is free software; you can redistribute it and/or
9  modify it under the terms of the GNU Lesser General Public
10  License as published by the Free Software Foundation; either
11  version 2.1 of the License, or (at your option) any later version.
12 
13  This library is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  Lesser General Public License for more details.
17 
18  You should have received a copy of the GNU Lesser General Public
19  License along with this library; if not, write to the Free Software
20  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 */
22 
23 #include <list>
24 #include <memory>
25 #include <string>
26 #include <unordered_map>
27 #include <unordered_set>
28 #include <vector>
29 
31 
32 #include <osmscout/ObjectRef.h>
33 #include <osmscout/OSMScoutTypes.h>
34 #include <osmscout/Tag.h>
35 #include <osmscout/TypeFeature.h>
36 
40 
41 #include <osmscout/system/Assert.h>
42 
44 
45 namespace osmscout {
46 
54  static const TypeId typeIgnore = 0;
55 
56  class TypeInfo;
57 
58  using TypeInfoRef = std::shared_ptr<TypeInfo>;
59 
60 
68  class OSMSCOUT_API TypeInfo CLASS_FINAL
69  {
70  public:
71  static const uint8_t typeNode = 1u << 0u;
72  static const uint8_t typeWay = 1u << 1u;
73  static const uint8_t typeArea = 1u << 2u;
74  static const uint8_t typeRelation = 1u << 3u;
75 
76  enum class SpecialType : uint8_t {
77  none = 0,
78  multipolygon = 1,
79  routeMaster = 2,
80  route = 3
81  };
82 
83  public:
92  {
93  unsigned char types;
95  };
96 
97  private:
98  TypeId nodeId=0;
99  TypeId wayId=0;
100  TypeId areaId=0;
101  TypeId routeId=0;
102  std::string name;
103  size_t index=0;
104 
105  bool internal=false;
106 
107  std::list<TypeCondition> conditions;
108  std::unordered_map<std::string,size_t> nameToFeatureMap;
109  std::vector<FeatureInstance> features;
110  size_t featureMaskBytes=0;
111  size_t specialFeatureMaskBytes=0;
112  size_t valueBufferSize=0;
113 
114  bool canBeNode=false;
115  bool canBeWay=false;
116  bool canBeArea=false;
117  bool canBeRelation=false;
118  bool isPath=false;
119  bool canRouteFoot=false;
120  bool canRouteBicycle=false;
121  bool canRouteCar=false;
122  bool indexAsAddress=false;
123  bool indexAsLocation=false;
124  bool indexAsRegion=false;
125  bool indexAsPOI=false;
126  bool optimizeLowZoom=false;
127  SpecialType specialType=SpecialType::none;
128  bool pinWay=false;
129  bool mergeAreas=false;
130  bool ignoreSeaLand=false;
131  bool ignore=false;
132  uint8_t lanes=1;
133  uint8_t onewayLanes=1;
134 
135  std::unordered_set<std::string> groups;
136  std::unordered_map<std::string,std::string> descriptions;
137 
138  private:
142  TypeInfo(const TypeInfo& other) = delete;
143 
144  TypeInfo& operator=(const TypeInfo& other) = delete;
145 
146  public:
147  explicit TypeInfo(const std::string& name);
148 
152  TypeInfo& SetNodeId(TypeId id);
153 
157  TypeInfo& SetWayId(TypeId id);
158 
162  TypeInfo& SetAreaId(TypeId id);
163 
167  TypeInfo& SetRouteId(TypeId id);
168 
172  TypeInfo& SetIndex(size_t index);
173 
177  TypeInfo& SetInternal();
178 
182  TypeInfo& SetType(const std::string& name);
183 
184  TypeInfo& AddCondition(unsigned char types,
185  const TagConditionRef& condition);
186 
190  TypeInfo& AddFeature(const FeatureRef& feature);
191 
195  TypeInfo& AddGroup(const std::string& groupName);
196 
197  TypeInfo& AddDescription(const std::string& languageCode,
198  const std::string& description);
199 
200  bool HasFeatures() const
201  {
202  return !features.empty();
203  }
204 
209  bool HasFeature(const std::string& featureName) const;
210 
214  bool GetFeature(const std::string& name,
215  size_t& index) const;
216 
220  const FeatureInstance& GetFeature(size_t idx) const
221  {
222  return features[idx];
223  }
224 
228  const std::vector<FeatureInstance>& GetFeatures() const
229  {
230  return features;
231  }
232 
236  size_t GetFeatureCount() const
237  {
238  return features.size();
239  }
240 
244  size_t GetFeatureMaskBytes() const
245  {
246  return featureMaskBytes;
247  }
248 
254  {
255  return specialFeatureMaskBytes;
256  }
257 
262  {
263  return valueBufferSize;
264  }
265 
271  {
272  return nodeId;
273  }
274 
279  TypeId GetWayId() const
280  {
281  return wayId;
282  }
283 
288  {
289  return areaId;
290  }
291 
296  {
297  return routeId;
298  }
299 
303  size_t GetIndex() const
304  {
305  return index;
306  }
307 
311  bool IsInternal() const
312  {
313  return internal;
314  }
315 
319  std::string GetName() const
320  {
321  return name;
322  }
323 
329  bool HasConditions() const
330  {
331  return !conditions.empty();
332  }
333 
337  const std::list<TypeCondition>& GetConditions() const
338  {
339  return conditions;
340  }
341 
345  TypeInfo& CanBeNode(bool canBeNode)
346  {
347  this->canBeNode=canBeNode;
348 
349  return *this;
350  }
351 
352  bool CanBeNode() const
353  {
354  return canBeNode;
355  }
356 
360  TypeInfo& CanBeWay(bool canBeWay)
361  {
362  this->canBeWay=canBeWay;
363 
364  return *this;
365  }
366 
367  bool CanBeWay() const
368  {
369  return canBeWay;
370  }
371 
375  TypeInfo& CanBeArea(bool canBeArea)
376  {
377  this->canBeArea=canBeArea;
378 
379  return *this;
380  }
381 
382  bool CanBeArea() const
383  {
384  return canBeArea;
385  }
386 
390  TypeInfo& CanBeRelation(bool canBeRelation)
391  {
392  this->canBeRelation=canBeRelation;
393 
394  return *this;
395  }
396 
397  bool CanBeRelation() const
398  {
399  return canBeRelation;
400  }
401 
405  TypeInfo& SetIsPath(bool isPath)
406  {
407  this->isPath=isPath;
408 
409  return *this;
410  }
411 
412  bool IsPath() const
413  {
414  return isPath;
415  }
416 
420  TypeInfo& CanRouteFoot(bool canBeRoute)
421  {
422  this->canRouteFoot=canBeRoute;
423 
424  return *this;
425  }
426 
427  TypeInfo& CanRouteBicycle(bool canBeRoute)
428  {
429  this->canRouteBicycle=canBeRoute;
430 
431  return *this;
432  }
433 
437  TypeInfo& CanRouteCar(bool canBeRoute)
438  {
439  this->canRouteCar=canBeRoute;
440 
441  return *this;
442  }
443 
444  bool CanRoute() const
445  {
446  return canRouteFoot || canRouteBicycle || canRouteCar;
447  }
448 
452  bool CanRoute(Vehicle vehicle) const
453  {
454  switch (vehicle)
455  {
456  case vehicleFoot:
457  return canRouteFoot;
458  case vehicleBicycle:
459  return canRouteBicycle;
460  case vehicleCar:
461  return canRouteCar;
462  }
463 
464  return false;
465  }
466 
467  bool CanRouteFoot() const
468  {
469  return canRouteFoot;
470  }
471 
472  bool CanRouteBicycle() const
473  {
474  return canRouteBicycle;
475  }
476 
477  bool CanRouteCar() const
478  {
479  return canRouteCar;
480  }
481 
482  uint8_t GetDefaultAccess() const;
483 
487  TypeInfo& SetIndexAsAddress(bool indexAsAddress)
488  {
489  this->indexAsAddress=indexAsAddress;
490 
491  return *this;
492  }
493 
494  bool GetIndexAsAddress() const
495  {
496  return indexAsAddress;
497  }
498 
502  TypeInfo& SetIndexAsLocation(bool indexAsLocation)
503  {
504  this->indexAsLocation=indexAsLocation;
505 
506  return *this;
507  }
508 
509  bool GetIndexAsLocation() const
510  {
511  return indexAsLocation;
512  }
513 
517  TypeInfo& SetIndexAsRegion(bool indexAsRegion)
518  {
519  this->indexAsRegion=indexAsRegion;
520 
521  return *this;
522  }
523 
524  bool GetIndexAsRegion() const
525  {
526  return indexAsRegion;
527  }
528 
532  TypeInfo& SetIndexAsPOI(bool indexAsPOI)
533  {
534  this->indexAsPOI=indexAsPOI;
535 
536  return *this;
537  }
538 
539  bool GetIndexAsPOI() const
540  {
541  return indexAsPOI;
542  }
543 
547  TypeInfo& SetOptimizeLowZoom(bool optimize)
548  {
549  this->optimizeLowZoom=optimize;
550 
551  return *this;
552  }
553 
554  bool GetOptimizeLowZoom() const
555  {
556  return optimizeLowZoom;
557  }
558 
559  TypeInfo& SetSpecialType(SpecialType specialType) {
560  this->specialType=specialType;
561 
562  return *this;
563  }
564 
566  {
567  return specialType;
568  }
573  TypeInfo& SetMultipolygon()
574  {
575  this->specialType=SpecialType::multipolygon;
576 
577  return *this;
578  }
579 
583  TypeInfo& SetRouteMaster()
584  {
585  this->specialType=SpecialType::routeMaster;
586 
587  return *this;
588  }
589 
593  TypeInfo& SetRoute()
594  {
595  this->specialType=SpecialType::route;
596 
597  return *this;
598  }
599 
600  bool IsMultipolygon() const
601  {
602  return specialType==SpecialType::multipolygon;
603  }
604 
605  bool IsRouteMaster() const
606  {
607  return specialType==SpecialType::routeMaster;
608  }
609 
610  bool IsRoute() const
611  {
612  return specialType==SpecialType::route;
613  }
614 
615  TypeInfo& SetPinWay(bool pinWay)
616  {
617  this->pinWay=pinWay;
618 
619  return *this;
620  }
621 
622  bool GetPinWay() const
623  {
624  return pinWay;
625  }
626 
630  TypeInfo& SetMergeAreas(bool mergeAreas)
631  {
632  this->mergeAreas=mergeAreas;
633 
634  return *this;
635  }
636 
637  bool GetMergeAreas() const
638  {
639  return mergeAreas;
640  }
641 
645  TypeInfo& SetIgnoreSeaLand(bool ignoreSeaLand)
646  {
647  this->ignoreSeaLand=ignoreSeaLand;
648 
649  return *this;
650  }
651 
652  bool GetIgnoreSeaLand() const
653  {
654  return ignoreSeaLand;
655  }
656 
661  TypeInfo& SetIgnore(bool ignore)
662  {
663  this->ignore=ignore;
664 
665  return *this;
666  }
667 
668  bool GetIgnore() const
669  {
670  return ignore;
671  }
672 
673  TypeInfo& SetLanes(uint8_t lanes)
674  {
675  this->lanes=lanes;
676 
677  return *this;
678  }
679 
680  uint8_t GetLanes() const
681  {
682  return lanes;
683  }
684 
685  TypeInfo& SetOnewayLanes(uint8_t lanes)
686  {
687  this->onewayLanes=lanes;
688 
689  return *this;
690  }
691 
692  uint8_t GetOnewayLanes() const
693  {
694  return onewayLanes;
695  }
696 
700  const std::unordered_set<std::string>& GetGroups() const
701  {
702  return groups;
703  }
704 
705  bool IsInGroup(const std::string& groupName) const
706  {
707  return groups.find(groupName)!=groups.end();
708  }
709 
710  const std::unordered_map<std::string,std::string>& GetDescriptions() const
711  {
712  return descriptions;
713  };
714 
715  std::string GetDescription(const std::string& languageCode) const;
716 
717  static TypeInfoRef Read(FileScanner& scanner);
718  };
719 
724  class OSMSCOUT_API FeatureValueBuffer CLASS_FINAL
725  {
726  private:
727  TypeInfoRef type;
728  uint8_t *featureBits;
729  char *featureValueBuffer;
730 
731  private:
732  void DeleteData();
733  void AllocateBits();
734  void AllocateValueBufferLazy();
735 
740  FeatureValue* GetValueAndAllocateBuffer(size_t idx)
741  {
742  AllocateValueBufferLazy();
743  return static_cast<FeatureValue*>(static_cast<void*>(&featureValueBuffer[type->GetFeature(idx).GetOffset()]));
744  }
745 
746  public:
747  FeatureValueBuffer();
748  FeatureValueBuffer(const FeatureValueBuffer& other);
749  ~FeatureValueBuffer();
750 
758  void Set(const FeatureValueBuffer& other);
759 
773  void CopyMissingValues(const FeatureValueBuffer& other);
774 
778  void ClearFeatureValues();
779 
780  void SetType(const TypeInfoRef& type);
781 
783  {
784  return type;
785  }
786 
790  size_t GetFeatureCount() const
791  {
792  return type->GetFeatureCount();
793  }
794 
798  FeatureInstance GetFeature(size_t idx) const
799  {
800  return type->GetFeature(idx);
801  }
802 
806  bool HasFeature(size_t idx) const
807  {
808  size_t featureBit=type->GetFeature(idx).GetFeatureBit();
809 
810  return (featureBits[featureBit/8] & (1u << featureBit%8))!=0;
811  }
812 
821  FeatureValue* GetValue(size_t idx) const
822  {
823  return featureValueBuffer==nullptr ? nullptr
824  : static_cast<FeatureValue*>(static_cast<void*>(&featureValueBuffer[type->GetFeature(idx).GetOffset()]));
825  }
826 
827  FeatureValue* AllocateValue(size_t idx);
828  void FreeValue(size_t idx);
829 
830  void Parse(TagErrorReporter& errorReporter,
831  const TagRegistry& tagRegistry,
832  const ObjectOSMRef& object,
833  const TagMap& tags);
834 
835  void Read(FileScanner& scanner);
836  void Read(FileScanner& scanner,
837  bool& specialFlag);
838  void Read(FileScanner& scanner,
839  bool& specialFlag1,
840  bool& specialFlag2);
841  void Write(FileWriter& writer) const;
842  void Write(FileWriter& writer,
843  bool specialFlag) const;
844  void Write(FileWriter& writer,
845  bool specialFlag1,
846  bool specialFlag2) const;
847 
848  FeatureValueBuffer& operator=(const FeatureValueBuffer& other);
849  bool operator==(const FeatureValueBuffer& other) const;
850  bool operator!=(const FeatureValueBuffer& other) const;
851 
852  template<class T> const T* findValue() const
853  {
854  for (const auto& featureInstance :GetType()->GetFeatures()) {
855  if (HasFeature(featureInstance.GetIndex())) {
856  osmscout::FeatureRef feature=featureInstance.GetFeature();
857  if (feature->HasValue()) {
858  const osmscout::FeatureValue* value=GetValue(featureInstance.GetIndex());
859  const auto *v=dynamic_cast<const T*>(value);
860  if (v!=nullptr) {
861  return v;
862  }
863  }
864  }
865  }
866 
867  return nullptr;
868  }
869  };
870 
871  using FeatureValueBufferRef = std::shared_ptr<FeatureValueBuffer>;
872 
873  // Forward declaration
874  class TypeConfig;
875 
876  static const uint32_t FILE_FORMAT_VERSION=22;
877 
884  class OSMSCOUT_API TypeConfig CLASS_FINAL
885  {
886  public:
887  static const char* FILE_TYPES_DAT;
888  static const uint32_t MIN_FORMAT_VERSION = FILE_FORMAT_VERSION;
889  static const uint32_t MAX_FORMAT_VERSION = FILE_FORMAT_VERSION;
890 
891  private:
892  // Tags
893  TagRegistry tagRegistry;
894 
895  // Types
896 
897  std::vector<TypeInfoRef> types;
898  std::vector<TypeInfoRef> nodeTypes;
899  std::vector<TypeInfoRef> wayTypes;
900  std::vector<TypeInfoRef> areaTypes;
901  std::vector<TypeInfoRef> routeTypes;
902 
903  uint8_t nodeTypeIdBytes=1;
904  uint8_t wayTypeIdBytes=1;
905  uint8_t areaTypeIdBits=1;
906  uint8_t areaTypeIdBytes=1;
907  uint8_t routeTypeIdBytes=1;
908 
909  std::unordered_map<std::string,TypeInfoRef> nameToTypeMap;
910 
911  // Features
912 
913  std::vector<FeatureRef> features;
914 
915  std::unordered_map<std::string,FeatureRef> nameToFeatureMap;
916 
917  FeatureRef featureName;
918  FeatureRef featureNameShort;
919  FeatureRef featureRef;
920  FeatureRef featureLocation;
921  FeatureRef featureAddress;
922  FeatureRef featurePostalCode;
923  FeatureRef featureWebsite;
924  FeatureRef featurePhone;
925  FeatureRef featureAccess;
926  FeatureRef featureAccessRestricted;
927  FeatureRef featureLayer;
928  FeatureRef featureWidth;
929  FeatureRef featureMaxSpeed;
930  FeatureRef featureGrade;
931  FeatureRef featureBridge;
932  FeatureRef featureTunnel;
933  FeatureRef featureEmbankment;
934  FeatureRef featureRoundabout;
935  FeatureRef featureLanes;
936 
937  public:
938  // Internal use (only available during preprocessing)
945 
954 
955  public:
956  TypeConfig();
957  ~TypeConfig();
958 
963  TagId GetTagId(const char* name) const
964  {
965  return tagRegistry.GetTagId(name);
966  }
967 
968  TagId GetTagId(const std::string& name) const
969  {
970  return tagRegistry.GetTagId(name);
971  }
972 
973  const TagRegistry& GetTagRegistry() const
974  {
975  return tagRegistry;
976  }
977 
978  TagRegistry& GetTagRegistry()
979  {
980  return tagRegistry;
981  }
983 
988  void RegisterSurfaceToGradeMapping(const std::string& surface,
989  size_t grade)
990  {
991  tagRegistry.RegisterSurfaceToGradeMapping(surface,
992  grade);
993  }
995 
1000  void RegisterMaxSpeedAlias(const std::string& alias,
1001  uint8_t maxSpeed)
1002  {
1003  tagRegistry.RegisterMaxSpeedAlias(alias,
1004  maxSpeed);
1005  }
1007 
1012  TypeInfoRef RegisterType(const TypeInfoRef& typeInfo);
1013 
1017  const std::vector<TypeInfoRef>& GetTypes() const
1018  {
1019  return types;
1020  }
1021 
1025  const std::vector<TypeInfoRef>& GetNodeTypes() const
1026  {
1027  return nodeTypes;
1028  }
1029 
1030  uint8_t GetNodeTypeIdBytes() const
1031  {
1032  return nodeTypeIdBytes;
1033  }
1034 
1038  const std::vector<TypeInfoRef>& GetWayTypes() const
1039  {
1040  return wayTypes;
1041  }
1042 
1043  uint8_t GetWayTypeIdBytes() const
1044  {
1045  return wayTypeIdBytes;
1046  }
1047 
1051  const std::vector<TypeInfoRef>& GetAreaTypes() const
1052  {
1053  return areaTypes;
1054  }
1055 
1056  uint8_t GetAreaTypeIdBits() const
1057  {
1058  return areaTypeIdBits;
1059  }
1060 
1061  uint8_t GetAreaTypeIdBytes() const
1062  {
1063  return areaTypeIdBytes;
1064  }
1065 
1069  const std::vector<TypeInfoRef>& GetRouteTypes() const
1070  {
1071  return routeTypes;
1072  }
1073 
1074  uint8_t GetRouteTypeIdBytes() const
1075  {
1076  return routeTypeIdBytes;
1077  }
1078 
1083  size_t GetTypeCount() const
1084  {
1085  return types.size();
1086  }
1087 
1091  TypeId GetMaxTypeId() const;
1092 
1096  TypeInfoRef GetTypeInfo(size_t index) const
1097  {
1098  assert(index<types.size());
1099 
1100  return types[index];
1101  }
1102 
1107  {
1108  assert(id<=nodeTypes.size());
1109 
1110  if (id==typeIgnore) {
1111  return typeInfoIgnore;
1112  }
1113 
1114  return nodeTypes[id-1];
1115  }
1116 
1121  {
1122  assert(id<=wayTypes.size());
1123 
1124  if (id==typeIgnore) {
1125  return typeInfoIgnore;
1126  }
1127 
1128  return wayTypes[id-1];
1129  }
1130 
1135  {
1136  assert(id<=areaTypes.size());
1137 
1138  if (id==typeIgnore) {
1139  return typeInfoIgnore;
1140  }
1141 
1142  return areaTypes[id-1];
1143  }
1144 
1149  {
1150  assert(id<=routeTypes.size());
1151 
1152  if (id==typeIgnore) {
1153  return typeInfoIgnore;
1154  }
1155 
1156  return routeTypes[id-1];
1157  }
1158 
1163  const TypeInfoRef GetTypeInfo(const std::string& name) const;
1164 
1171  TypeInfoRef GetNodeType(const TagMap& tagMap) const;
1172 
1179  bool GetWayAreaType(const TagMap& tagMap,
1180  TypeInfoRef& wayType,
1181  TypeInfoRef& areaType) const;
1182 
1189  TypeInfoRef GetRelationType(const TagMap& tagMap) const;
1191 
1197  void RegisterFeature(const FeatureRef& feature);
1198 
1203  FeatureRef GetFeature(const std::string& name) const;
1204 
1208  const std::vector<FeatureRef>& GetFeatures() const
1209  {
1210  return features;
1211  }
1213 
1218  bool LoadFromOSTFile(const std::string& filename);
1219  bool LoadFromDataFile(const std::string& directory);
1220  bool StoreToDataFile(const std::string& directory) const;
1222  };
1223 
1224 
1227  using TypeConfigRef = std::shared_ptr<TypeConfig>;
1228 
1232 }
1233 
1234 #endif
TypeInfo & SetIgnoreSeaLand(bool ignoreSeaLand)
Definition: TypeConfig.h:645
TypeInfo & CanBeNode(bool canBeNode)
Definition: TypeConfig.h:345
bool GetIndexAsAddress() const
Definition: TypeConfig.h:494
TypeInfoRef typeInfoTileSea
Internal type for ground tiles of type "sea".
Definition: TypeConfig.h:948
bool IsPath() const
Definition: TypeConfig.h:412
FeatureInstance GetFeature(size_t idx) const
Definition: TypeConfig.h:798
Definition: OSMScoutTypes.h:59
TypeInfoRef typeInfoOSMSubTileBorder
Internal type for OSM tile borders.
Definition: TypeConfig.h:953
bool CanRoute(Vehicle vehicle) const
Definition: TypeConfig.h:452
uint16_t TagId
Definition: Tag.h:39
std::string GetName() const
Definition: TypeConfig.h:319
uint8_t GetRouteTypeIdBytes() const
Definition: TypeConfig.h:1074
uint8_t GetAreaTypeIdBytes() const
Definition: TypeConfig.h:1061
TagId tagType
Definition: TypeConfig.h:942
TypeInfo & SetRouteMaster()
Definition: TypeConfig.h:583
bool GetPinWay() const
Definition: TypeConfig.h:622
const TagRegistry & GetTagRegistry() const
Definition: TypeConfig.h:973
bool IsInternal() const
Definition: TypeConfig.h:311
TypeInfoRef GetTypeInfo(size_t index) const
Definition: TypeConfig.h:1096
const std::list< TypeCondition > & GetConditions() const
Definition: TypeConfig.h:337
TypeInfoRef GetAreaTypeInfo(TypeId id) const
Definition: TypeConfig.h:1134
static const TypeId typeIgnore
Definition: TypeConfig.h:54
uint8_t GetLanes() const
Definition: TypeConfig.h:680
const std::vector< TypeInfoRef > & GetTypes() const
Definition: TypeConfig.h:1017
bool GetIndexAsPOI() const
Definition: TypeConfig.h:539
bool CanBeWay() const
Definition: TypeConfig.h:367
TypeId GetNodeId() const
Definition: TypeConfig.h:270
TagId tagNatural
Definition: TypeConfig.h:940
bool IsMultipolygon() const
Definition: TypeConfig.h:600
TypeInfo & SetIsPath(bool isPath)
Definition: TypeConfig.h:405
const std::vector< FeatureRef > & GetFeatures() const
Definition: TypeConfig.h:1208
bool GetIgnore() const
Definition: TypeConfig.h:668
bool CanRouteBicycle() const
Definition: TypeConfig.h:472
Definition: Area.h:86
uint16_t TypeId
Definition: OSMScoutTypes.h:53
uint8_t GetNodeTypeIdBytes() const
Definition: TypeConfig.h:1030
const std::unordered_set< std::string > & GetGroups() const
Definition: TypeConfig.h:700
TypeId GetWayId() const
Definition: TypeConfig.h:279
Vehicle
Definition: OSMScoutTypes.h:55
TypeId GetRouteId() const
Definition: TypeConfig.h:295
const std::vector< TypeInfoRef > & GetNodeTypes() const
Definition: TypeConfig.h:1025
TagConditionRef condition
The root condition.
Definition: TypeConfig.h:94
TypeInfo & SetSpecialType(SpecialType specialType)
Definition: TypeConfig.h:559
TypeInfo & CanBeArea(bool canBeArea)
Definition: TypeConfig.h:375
TypeInfo & SetPinWay(bool pinWay)
Definition: TypeConfig.h:615
TagId GetTagId(const std::string &name) const
Definition: TypeConfig.h:968
TypeInfoRef GetType() const
Definition: TypeConfig.h:782
bool operator!=(const MapViewStruct &r1, const MapViewStruct &r2)
Definition: DBThread.h:61
TypeInfo & SetIndexAsAddress(bool indexAsAddress)
Definition: TypeConfig.h:487
const std::vector< TypeInfoRef > & GetRouteTypes() const
Definition: TypeConfig.h:1069
const std::vector< FeatureInstance > & GetFeatures() const
Definition: TypeConfig.h:228
const std::vector< TypeInfoRef > & GetAreaTypes() const
Definition: TypeConfig.h:1051
bool GetMergeAreas() const
Definition: TypeConfig.h:637
static const uint32_t FILE_FORMAT_VERSION
Definition: TypeConfig.h:876
bool HasFeature(size_t idx) const
Definition: TypeConfig.h:806
TypeInfo & SetOptimizeLowZoom(bool optimize)
Definition: TypeConfig.h:547
TypeInfo & SetIndexAsPOI(bool indexAsPOI)
Definition: TypeConfig.h:532
size_t GetSpecialFeatureMaskBytes() const
Definition: TypeConfig.h:253
bool IsRouteMaster() const
Definition: TypeConfig.h:605
Definition: OSMScoutTypes.h:57
TypeInfo & CanRouteFoot(bool canBeRoute)
Definition: TypeConfig.h:420
TagId tagRestriction
Definition: TypeConfig.h:943
TypeInfo & CanRouteCar(bool canBeRoute)
Definition: TypeConfig.h:437
TypeInfoRef typeInfoTileLand
Internal type for ground tiles of type "land".
Definition: TypeConfig.h:947
bool CanBeRelation() const
Definition: TypeConfig.h:397
bool GetOptimizeLowZoom() const
Definition: TypeConfig.h:554
std::shared_ptr< FeatureValueBuffer > FeatureValueBufferRef
Definition: TypeConfig.h:871
Definition: Area.h:38
TypeInfo & SetOnewayLanes(uint8_t lanes)
Definition: TypeConfig.h:685
SpecialType GetSpecialType() const
Definition: TypeConfig.h:565
bool GetIndexAsRegion() const
Definition: TypeConfig.h:524
size_t GetFeatureCount() const
Definition: TypeConfig.h:236
bool HasConditions() const
Definition: TypeConfig.h:329
TypeInfoRef GetWayTypeInfo(TypeId id) const
Definition: TypeConfig.h:1120
Definition: TypeFeature.h:40
size_t GetTypeCount() const
Definition: TypeConfig.h:1083
TypeInfo & CanRouteBicycle(bool canBeRoute)
Definition: TypeConfig.h:427
#define CLASS_FINAL
Definition: Compiler.h:26
#define OSMSCOUT_API
Definition: CoreImportExport.h:45
TypeInfoRef typeInfoIgnore
Definition: TypeConfig.h:946
size_t GetIndex() const
Definition: TypeConfig.h:303
unsigned char types
Bitset of types the condition can be applied to.
Definition: TypeConfig.h:93
FeatureValue * GetValue(size_t idx) const
Definition: TypeConfig.h:821
bool GetIgnoreSeaLand() const
Definition: TypeConfig.h:652
TypeId GetAreaId() const
Definition: TypeConfig.h:287
std::shared_ptr< Feature > FeatureRef
Definition: TypeFeature.h:219
TypeInfoRef typeInfoCoastline
Internal type for coastlines.
Definition: TypeConfig.h:951
Definition: TagErrorReporter.h:32
bool CanBeNode() const
Definition: TypeConfig.h:352
bool HasFeatures() const
Definition: TypeConfig.h:200
TagRegistry & GetTagRegistry()
Definition: TypeConfig.h:978
TypeInfoRef typeInfoTileUnknown
Internal type for ground tiles of type "unknown".
Definition: TypeConfig.h:950
const T * findValue() const
Definition: TypeConfig.h:852
TypeInfoRef typeInfoTileCoast
Internal type for ground tiles of type "coast".
Definition: TypeConfig.h:949
TypeInfo & SetMergeAreas(bool mergeAreas)
Definition: TypeConfig.h:630
static const char * FILE_TYPES_DAT
Definition: TypeConfig.h:887
bool operator==(const MapView &a, const MapView &b)
Definition: InputHandler.h:222
void RegisterMaxSpeedAlias(const std::string &alias, uint8_t maxSpeed)
Definition: TypeConfig.h:1000
bool CanRouteCar() const
Definition: TypeConfig.h:477
TagId tagJunction
Definition: TypeConfig.h:944
TypeInfo & SetMultipolygon()
Definition: TypeConfig.h:573
TagId tagArea
Definition: TypeConfig.h:939
TagId tagDataPolygon
Definition: TypeConfig.h:941
TypeInfoRef typeInfoOSMTileBorder
Internal type for OSM tile borders.
Definition: TypeConfig.h:952
const std::unordered_map< std::string, std::string > & GetDescriptions() const
Definition: TypeConfig.h:710
TypeInfoRef GetRouteTypeInfo(TypeId id) const
Definition: TypeConfig.h:1148
std::shared_ptr< TypeInfo > TypeInfoRef
Definition: TypeConfig.h:58
size_t GetFeatureMaskBytes() const
Definition: TypeConfig.h:244
TypeInfo & CanBeRelation(bool canBeRelation)
Definition: TypeConfig.h:390
const FeatureInstance & GetFeature(size_t idx) const
Definition: TypeConfig.h:220
const std::vector< TypeInfoRef > & GetWayTypes() const
Definition: TypeConfig.h:1038
TypeInfo & SetIgnore(bool ignore)
Definition: TypeConfig.h:661
void RegisterSurfaceToGradeMapping(const std::string &surface, size_t grade)
Definition: TypeConfig.h:988
uint8_t GetAreaTypeIdBits() const
Definition: TypeConfig.h:1056
uint8_t GetWayTypeIdBytes() const
Definition: TypeConfig.h:1043
bool CanRoute() const
Definition: TypeConfig.h:444
SpecialType
Definition: TypeConfig.h:76
uint8_t GetOnewayLanes() const
Definition: TypeConfig.h:692
std::unordered_map< TagId, std::string > TagMap
Definition: Tag.h:41
std::shared_ptr< TagCondition > TagConditionRef
Definition: Tag.h:68
TypeInfo & CanBeWay(bool canBeWay)
Definition: TypeConfig.h:360
std::shared_ptr< TypeConfig > TypeConfigRef
Definition: TypeConfig.h:1227
TypeInfo & SetRoute()
Definition: TypeConfig.h:593
Definition: TypeConfig.h:91
bool CanBeArea() const
Definition: TypeConfig.h:382
TagId GetTagId(const char *name) const
Definition: TypeConfig.h:963
TypeInfo & SetIndexAsRegion(bool indexAsRegion)
Definition: TypeConfig.h:517
TypeInfo & SetLanes(uint8_t lanes)
Definition: TypeConfig.h:673
bool IsRoute() const
Definition: TypeConfig.h:610
Definition: OSMScoutTypes.h:58
bool CanRouteFoot() const
Definition: TypeConfig.h:467
bool GetIndexAsLocation() const
Definition: TypeConfig.h:509
TypeInfo & SetIndexAsLocation(bool indexAsLocation)
Definition: TypeConfig.h:502
TypeInfoRef GetNodeTypeInfo(TypeId id) const
Definition: TypeConfig.h:1106
bool IsInGroup(const std::string &groupName) const
Definition: TypeConfig.h:705
size_t GetFeatureValueBufferSize() const
Definition: TypeConfig.h:261