CartoType UWP API 9.6-4-g79291b60b
for development in C#, VB.NET and C++
CartoTypeFeatureInfo.h
1/*
2CartoTypeFeatureInfo.h
3Copyright (C) CartoType Ltd 2022.
4See www.cartotype.com for more information.
5*/
6
7#pragma once
8
9#include <cartotype_feature_info.h>
10#include "CartoTypeResult.h"
11
12namespace CartoType
13{
14
16inline uint32_t constexpr FeatureTypeCode(int A,int B,int C)
17 {
18 return (char(A - 'a' + 1) << 10) | (char(B - 'a' + 1) << 5) | (char(C - 'a' + 1));
19 }
20
29public enum class FeatureType
30 {
31 Motorway = 0,
32 MotorwayLink = 1,
33 TrunkRoad = 2,
34 TrunkLink = 3,
35 PrimaryRoad = 4,
36 PrimaryLink = 5,
37 SecondaryRoad = 6,
38 SecondaryLink = 7,
39 TertiaryRoad = 8,
41 ResidentialRoad = 10,
42 Track = 11,
43 ServiceRoad = 12,
44 PedestrianRoad = 13,
45 VehicularFerry = 14,
46 PassengerFerry = 15,
47 LivingStreet = 16,
48 Cycleway = 17,
49 Path = 18,
50 Footway = 19,
51 Bridleway = 20,
52 Steps = 21,
53 OtherRoad = 22,
54 UnpavedRoad = 23,
55 Railway = 24,
56 LightRail = 25,
57 Subway = 26,
58 AerialWay = 27,
59 SkiDownhill = 28,
60 SkiNordic = 29,
61 Waterway = 30,
62 UnknownRoute = 31,
63
64 UnknownNonRoute = 32,
65
66 AdminArea1 = FeatureTypeCode('a','a','a'),
67 AdminArea2 = FeatureTypeCode('a','a','b'),
68 AdminArea3 = FeatureTypeCode('a','a','c'),
69 AdminArea4 = FeatureTypeCode('a','a','d'),
70 AdminArea5 = FeatureTypeCode('a','a','e'),
71 AdminArea6 = FeatureTypeCode('a','a','f'),
72 AdminArea7 = FeatureTypeCode('a','a','g'),
73 AdminArea8 = FeatureTypeCode('a','a','h'),
74 AdminArea9 = FeatureTypeCode('a','a','i'),
75 AdminArea10 = FeatureTypeCode('a','a','j'),
76 Address = FeatureTypeCode('a','d','d'),
77 Aerodrome = FeatureTypeCode('a','e','r'),
78 Airport = FeatureTypeCode('a','i','r'),
79 AirportGate = FeatureTypeCode('a','g','t'),
80 AirportHoldingPosition = FeatureTypeCode('a','h','p'),
81 Allotments = FeatureTypeCode('a','l','l'),
82 AlpineHut = FeatureTypeCode('a','l','p'),
83 AmbulanceStation = FeatureTypeCode('a','m','b'),
84 Apron = FeatureTypeCode('a','p','r'),
85 AerialWayPylon = FeatureTypeCode('a','p','y'),
86 Artwork = FeatureTypeCode('a','r','t'),
87 AerialWayStation = FeatureTypeCode('a','s','t'),
88 AirTerminal = FeatureTypeCode('a','t','e'),
89 Atm = FeatureTypeCode('a','t','m'),
90 Attraction = FeatureTypeCode('a','t','t'),
91 Bar = FeatureTypeCode('b','a','r'),
92 Basin = FeatureTypeCode('b','a','s'),
93 Bay = FeatureTypeCode('b','a','y'),
94 Beach = FeatureTypeCode('b','e','a'),
95 Beacon = FeatureTypeCode('b','e','c'),
96 BedAndBreakfast = FeatureTypeCode('b','e','d'),
97 Bench = FeatureTypeCode('b','e','n'),
98 Bank = FeatureTypeCode('b','n','k'),
99 Boatyard = FeatureTypeCode('b','o','a'),
100 Borough = FeatureTypeCode('b','o','r'),
101 Boundary = FeatureTypeCode('b','o','u'),
102 BicycleParking = FeatureTypeCode('b','p','k'),
103 BicycleRental = FeatureTypeCode('b','r','e'),
104 BareRock = FeatureTypeCode('b','r','c'),
105 Barracks = FeatureTypeCode('b','r','k'),
106 BrownField = FeatureTypeCode('b','r','o'),
107 BusStop = FeatureTypeCode('b','s','p'),
108 BusStation = FeatureTypeCode('b','s','t'),
109 BufferStop = FeatureTypeCode('b','u','f'),
110 Building = FeatureTypeCode('b','u','i'),
111 Bunker = FeatureTypeCode('b','u','n'),
112 Cabin = FeatureTypeCode('c','a','b'),
113 Cafe = FeatureTypeCode('c','a','f'),
114 CampSite = FeatureTypeCode('c','a','m'),
115 Canal = FeatureTypeCode('c','a','n'),
116 CaveEntrance = FeatureTypeCode('c','a','v'),
117 CableCar = FeatureTypeCode('c','c','r'),
118 CableDistributionCabinet = FeatureTypeCode('c','d','c'),
119 Cemetery = FeatureTypeCode('c','e','m'),
120 ChairLift = FeatureTypeCode('c','h','a'),
121 CheckPoint = FeatureTypeCode('c','h','e'),
122 Chalet = FeatureTypeCode('c','h','l'),
123 CivilBoundary = FeatureTypeCode('c','i','b'),
124 Cinema = FeatureTypeCode('c','i','n'),
125 City = FeatureTypeCode('c','i','t'),
126 Cliff = FeatureTypeCode('c','l','f'),
127 Clinic = FeatureTypeCode('c','l','i'),
128 Commercial = FeatureTypeCode('c','m','r'),
129 Coastline = FeatureTypeCode('c','o','a'),
130 College = FeatureTypeCode('c','o','l'),
131 Common = FeatureTypeCode('c','o','m'),
132 Construction = FeatureTypeCode('c','n','s'),
133 Conservation = FeatureTypeCode('c','n','v'),
134 Continent = FeatureTypeCode('c','o','n'),
135 County = FeatureTypeCode('c','o','u'),
136 CarPark = FeatureTypeCode('c','p','k'),
137 CarRental = FeatureTypeCode('c','r','e'),
138 Crossing = FeatureTypeCode('c','r','o'),
139 Country = FeatureTypeCode('c','r','y'),
140 CarSharing = FeatureTypeCode('c','s','h'),
141 CutLine = FeatureTypeCode('c','u','t'),
142 CarWash = FeatureTypeCode('c','w','a'),
143 CaravanSite = FeatureTypeCode('c','v','n'),
144 CyclingRoute = FeatureTypeCode('c','y','r'),
145 Dam = FeatureTypeCode('d','a','m'),
146 DangerArea = FeatureTypeCode('d','a','n'),
147 Dentist = FeatureTypeCode('d','e','n'),
148 Disused = FeatureTypeCode('d','i','s'),
149 Ditch = FeatureTypeCode('d','i','t'),
150 Dock = FeatureTypeCode('d','o','c'),
151 DogPark = FeatureTypeCode('d','o','g'),
152 Drain = FeatureTypeCode('d','r','a'),
153 DragLift = FeatureTypeCode('d','r','g'),
154 Doctors = FeatureTypeCode('d','r','s'),
155 District = FeatureTypeCode('d','s','t'),
156 ElectricVehicleCharging = FeatureTypeCode('e','v','c'),
157 Farm = FeatureTypeCode('f','a','r'),
158 FarmYard = FeatureTypeCode('f','a','y'),
159 Fell = FeatureTypeCode('f','e','l'),
160 FerryTerminal = FeatureTypeCode('f','e','t'),
161 FastFood = FeatureTypeCode('f','f','d'),
162 FireExtinguisher = FeatureTypeCode('f','i','e'),
163 FireFlapper = FeatureTypeCode('f','i','f'),
164 FireHose = FeatureTypeCode('f','i','h'),
165 FireStation = FeatureTypeCode('f','i','s'),
166 FitnessStation = FeatureTypeCode('f','i','t'),
167 FireHydrant = FeatureTypeCode('f','i','y'),
168 Forestry = FeatureTypeCode('f','o','r'),
169 Fishing = FeatureTypeCode('f','s','h'),
170 Fuel = FeatureTypeCode('f','u','e'),
171 Funicular = FeatureTypeCode('f','u','n'),
172 Garages = FeatureTypeCode('g','a','r'),
173 Gate = FeatureTypeCode('g','a','t'),
174 Garden = FeatureTypeCode('g','d','n'),
175 Generator = FeatureTypeCode('g','e','n'),
176 GreenHouse = FeatureTypeCode('g','h','o'),
177 Glacier = FeatureTypeCode('g','l','a'),
178 GolfCourse = FeatureTypeCode('g','o','l'),
179 Gondola = FeatureTypeCode('g','o','n'),
180 GoodsAerialWay = FeatureTypeCode('g','o','o'),
181 Grass = FeatureTypeCode('g','r','a'),
182 GreenField = FeatureTypeCode('g','r','e'),
183 GritBin = FeatureTypeCode('g','r','b'),
184 GraveYard = FeatureTypeCode('g','r','y'),
185 GuestHouse = FeatureTypeCode('g','u','e'),
186 Halt = FeatureTypeCode('h','a','l'),
187 Hamlet = FeatureTypeCode('h','a','m'),
188 Hangar = FeatureTypeCode('h','a','n'),
189 Heath = FeatureTypeCode('h','e','a'),
190 Helipad = FeatureTypeCode('h','e','l'),
191 RailwayHalt = FeatureTypeCode('h','l','t'),
192 HikingRoute = FeatureTypeCode('h','i','k'),
193 HorseRiding = FeatureTypeCode('h','o','r'),
194 Hospital = FeatureTypeCode('h','o','s'),
195 Hotel = FeatureTypeCode('h','o','t'),
196 HorseRidingRoute = FeatureTypeCode('h','r','r'),
197 Hostel = FeatureTypeCode('h','s','t'),
198 IceRink = FeatureTypeCode('i','c','e'),
199 Industrial = FeatureTypeCode('i','n','d'),
200 Information = FeatureTypeCode('i','n','f'),
201 Island = FeatureTypeCode('i','s','l'),
202 IsolatedDwelling = FeatureTypeCode('i','s','o'),
203 Junction = FeatureTypeCode('j','c','t'),
204 Kindergarten = FeatureTypeCode('k','i','n'),
205 LandFill = FeatureTypeCode('l','a','n'),
206 Land = FeatureTypeCode('l','n','d'),
207 LevelCrossing = FeatureTypeCode('l','e','v'),
208 Library = FeatureTypeCode('l','i','b'),
209 Locality = FeatureTypeCode('l','o','c'),
210 LockGate = FeatureTypeCode('l','o','k'),
211 MaritimeBoundary = FeatureTypeCode('m','a','b'),
212 Mall = FeatureTypeCode('m','a','l'),
213 Marsh = FeatureTypeCode('m','a','r'),
214 Meadow = FeatureTypeCode('m','e','a'),
215 Military = FeatureTypeCode('m','i','l'),
216 Marina = FeatureTypeCode('m','n','a'),
217 Motel = FeatureTypeCode('m','o','t'),
218 MinorPowerLine = FeatureTypeCode('m','p','l'),
219 MiniatureGolf = FeatureTypeCode('m','r','g'),
220 MiniatureRailway = FeatureTypeCode('m','r','y'),
221 Mud = FeatureTypeCode('m','u','d'),
222 Municipality = FeatureTypeCode('m','u','n'),
223 Museum = FeatureTypeCode('m','u','s'),
224 NatureReserve = FeatureTypeCode('n','a','t'),
225 NationalPark = FeatureTypeCode('n','a','p'),
226 NavalBase = FeatureTypeCode('n','a','v'),
227 Neighborhood = FeatureTypeCode('n','e','i'),
228 NursingHome = FeatureTypeCode('n','u','r'),
229 Ocean = FeatureTypeCode('o','c','e'),
230 Orchard = FeatureTypeCode('o','r','c'),
231 PrecisionApproachPathIndicator = FeatureTypeCode('p','a','p'),
232 Park = FeatureTypeCode('p','a','r'),
233 PublicBuilding = FeatureTypeCode('p','b','u'),
234 PostBox = FeatureTypeCode('p','b','x'),
235 PostCode = FeatureTypeCode('p','c','o'),
236 PicnicTable = FeatureTypeCode('p','c','t'),
237 Peak = FeatureTypeCode('p','e','a'),
238 Pharmacy = FeatureTypeCode('p','h','a'),
239 Phone = FeatureTypeCode('p','h','o'),
240 PicnicSite = FeatureTypeCode('p','i','c'),
241 Pier = FeatureTypeCode('p','i','e'),
242 Pipeline = FeatureTypeCode('p','i','p'),
243 ParkingEntrance = FeatureTypeCode('p','k','e'),
244 Parking = FeatureTypeCode('p','k','g'),
245 ParkingSpace = FeatureTypeCode('p','k','s'),
246 PlantNursery = FeatureTypeCode('p','l','a'),
247 Platform = FeatureTypeCode('p','l','f'),
248 PlaceOfWorship = FeatureTypeCode('p','l','w'),
249 Playground = FeatureTypeCode('p','l','y'),
250 PostOffice = FeatureTypeCode('p','o','f'),
251 Police = FeatureTypeCode('p','o','l'),
252 Position = FeatureTypeCode('p','o','s'),
253 ProtectedArea = FeatureTypeCode('p','r','a'),
254 PowerSubStation = FeatureTypeCode('p','s','s'),
255 Pub = FeatureTypeCode('p','u','b'),
256 PowerLine = FeatureTypeCode('p','w','l'),
257 PowerStation = FeatureTypeCode('p','w','s'),
258 Quarry = FeatureTypeCode('q','a','r'),
259 Quay = FeatureTypeCode('q','a','y'),
260 Quarter = FeatureTypeCode('q','r','t'),
261 Range = FeatureTypeCode('r','a','n'),
262 Rapids = FeatureTypeCode('r','a','p'),
263 Recycling = FeatureTypeCode('r','c','y'),
264 RecreationGround = FeatureTypeCode('r','e','c'),
265 Reef = FeatureTypeCode('r','e','e'),
266 Region = FeatureTypeCode('r','e','g'),
267 Retail = FeatureTypeCode('r','e','t'),
268 Ridge = FeatureTypeCode('r','i','j'),
269 River = FeatureTypeCode('r','i','v'),
270 Rock = FeatureTypeCode('r','o','c'),
271 RoundHouse = FeatureTypeCode('r','o','u'),
272 ResidentialArea = FeatureTypeCode('r','s','d'),
273 Restaurant = FeatureTypeCode('r','s','t'),
274 Reservoir = FeatureTypeCode('r','s','v'),
275 Runway = FeatureTypeCode('r','u','n'),
276 Route = FeatureTypeCode('r','u','t'),
277 RiverBank = FeatureTypeCode('r','v','b'),
278 SaltPond = FeatureTypeCode('s','a','l'),
279 Sand = FeatureTypeCode('s','a','n'),
280 Sauna = FeatureTypeCode('s','a','u'),
281 School = FeatureTypeCode('s','c','h'),
282 Scree = FeatureTypeCode('s','c','r'),
283 Scrub = FeatureTypeCode('s','c','b'),
284 Sea = FeatureTypeCode('s','e','a'),
285 StateEmergencyServiceStation = FeatureTypeCode('s','e','s'),
286 Shop = FeatureTypeCode('s','h','o'),
287 SkiRoute = FeatureTypeCode('s','k','r'),
288 Slipway = FeatureTypeCode('s','l','i'),
289 SportsCenter = FeatureTypeCode('s','p','o'),
290 SportsPitch = FeatureTypeCode('s','p','p'),
291 Spring = FeatureTypeCode('s','p','r'),
292 SportsTrack = FeatureTypeCode('s','p','t'),
293 State = FeatureTypeCode('s','t','a'),
294 Stadium = FeatureTypeCode('s','t','m'),
295 RailwayStation = FeatureTypeCode('s','t','n'),
296 Station = FeatureTypeCode('s','t','n'), // deliberate duplicate
297 Stone = FeatureTypeCode('s','t','o'),
298 StopPosition = FeatureTypeCode('s','t','p'),
299 Stream = FeatureTypeCode('s','t','r'),
300 Strait = FeatureTypeCode('s','t','t'),
301 Suburb = FeatureTypeCode('s','u','b'),
302 Supermarket = FeatureTypeCode('s','u','p'),
303 SurveyPoint = FeatureTypeCode('s','u','r'),
304 SubwayEntrance = FeatureTypeCode('s','w','e'),
305 SwimmingPool = FeatureTypeCode('s','w','i'),
306 Tank = FeatureTypeCode('t','a','n'),
307 Taxi = FeatureTypeCode('t','a','x'),
308 Theatre = FeatureTypeCode('t','h','e'),
309 ThemePark = FeatureTypeCode('t','h','p'),
310 Toilet = FeatureTypeCode('t','o','i'),
311 Town = FeatureTypeCode('t','o','w'),
312 TurningCircle = FeatureTypeCode('t','c','i'),
313 TurningPoint = FeatureTypeCode('t','p','t'),
314 Tram = FeatureTypeCode('t','r','a'),
315 Tree = FeatureTypeCode('t','r','e'),
316 TrafficSignals = FeatureTypeCode('t','r','f'),
317 TrackPoint = FeatureTypeCode('t','r','p'),
318 TreeRow = FeatureTypeCode('t','r','r'),
319 TramStop = FeatureTypeCode('t','r','s'),
320 TurnTable = FeatureTypeCode('t','u','r'),
321 Tower = FeatureTypeCode('t','w','r'),
322 Taxiway = FeatureTypeCode('t','w','y'),
323 University = FeatureTypeCode('u','n','i'),
324 VisualApproachSlopeIndicator = FeatureTypeCode('v','a','s'),
325 VillageGreen = FeatureTypeCode('v','i','g'),
326 Village = FeatureTypeCode('v','i','l'),
327 Vineyard = FeatureTypeCode('v','i','n'),
328 ViewPoint = FeatureTypeCode('v','i','w'),
329 Volcano = FeatureTypeCode('v','o','l'),
330 Waterfall = FeatureTypeCode('w','a','f'),
331 WaterPark = FeatureTypeCode('w','a','p'),
332 Water = FeatureTypeCode('w','a','t'),
333 Weir = FeatureTypeCode('w','e','r'),
334 Wetland = FeatureTypeCode('w','e','t'),
335 WildernessHut = FeatureTypeCode('w','i','l'),
336 Windsock = FeatureTypeCode('w','i','s'),
337 WalkingRoute = FeatureTypeCode('w','l','k'),
338 Wood = FeatureTypeCode('w','o','o'),
339 Works = FeatureTypeCode('w','o','r'),
340 Waypoint = FeatureTypeCode('w','p','t'),
341 WaterTower = FeatureTypeCode('w','t','t'),
342 WaterWell = FeatureTypeCode('w','t','w'),
343 Zoo = FeatureTypeCode('z','o','o'),
344
345 // legacy types for backward compatibility
346 LegacyBridleway = FeatureTypeCode('b','r','i'),
347 LegacyCycleway = FeatureTypeCode('c','y','c'),
348 LegacyFootway = FeatureTypeCode('f','o','o'),
349 LegacyLightRail = FeatureTypeCode('l','i','r'),
350 LegacyMonorail = FeatureTypeCode('m','o','n'),
351 LegacyNarrowGauge = FeatureTypeCode('n','a','r'),
352 LegacyPreservedRailway = FeatureTypeCode('p','r','y'),
353 LegacyRailway = FeatureTypeCode('r','l','y'),
354 LegacySteps = FeatureTypeCode('s','t','e'),
355 LegacySubway = FeatureTypeCode('s','w','y'),
356 LegacyTram = FeatureTypeCode('t','r','a'),
357
358 Invalid = 32767
359 };
360
362public enum class FeatureDiscriminator
363 {
365 NonRoute = 0,
367 BridgeRoute = 1,
369 TunnelRoute = 2,
371 Route = 3
372 };
373
375public enum class FeatureConstants
376 {
378 KRouteTypeCount = 32,
380 KGradientCount = 8,
382 KMaxSubType = 2047,
383
384 KRouteAccessShift = 26,
385 KRouteAccessMask = int(63U << KRouteAccessShift),
386 KRouteAccessWrongWayFlag = 1 << 26,
387 KRouteAccessPedestrianFlag = 1 << 27,
388 KRouteAccessCycleFlag = 1 << 28,
389 KRouteAccessMotorVehicleFlag = 1 << 29,
390 KRouteAccessEmergencyVehicleFlag = 1 << 30,
391 KRouteAccessOtherFlag = int(1U << 31),
392 KRouteAccessVehicle = KRouteAccessCycleFlag | KRouteAccessMotorVehicleFlag | KRouteAccessEmergencyVehicleFlag,
393 KRouteAccessNormal = KRouteAccessCycleFlag | KRouteAccessMotorVehicleFlag | KRouteAccessPedestrianFlag
394 };
395
414public ref class FeatureInfo sealed
415 {
416 public:
426 FeatureInfo(FeatureType aType,int aSubType);
430 property bool Route { bool get(); };
432 property bool Tunnel { bool get(); void set(bool); };
434 property bool Bridge { bool get(); void set(bool); };
436 property int Level { int get(); void set(int aLevel); };
438 property FeatureType Type { FeatureType get(); void set(FeatureType aType); };
440 property bool OneWay { bool get(); void set(bool aValue); };
442 property bool OneWayForward { bool get(); };
444 property bool OneWayBackward { bool get(); };
446 property bool DriveOnLeft { bool get(); void set(bool aValue); };
448 property bool DriveOnRight { bool get(); void set(bool aValue); };
452 property bool Roundabout { bool get(); void set(bool aValue); };
454 property bool Toll { bool get(); void set(bool aValue); };
456 property bool WrongWay { bool get(); void set(bool aValue); };
458 property int SpeedLimit { int get(); void set(int aValue); };
460 property int Gradient { int get(); void set(int aValue); };
462 void SetVehicleAccess(bool aValue);
464 property bool PedestrianAccess { bool get(); void set(bool aValue); };
466 property bool CycleAccess { bool get(); void set(bool aValue); };
468 property bool MotorVehicleAccess { bool get(); void set(bool aValue); };
470 property bool EmergencyVehicleAccess { bool get(); void set(bool aValue); };
472 property bool OtherAccessRestricted { bool get(); void set(bool aValue); };
474 property bool IsPrivate { bool get(); };
476 property int SubType { int get(); void set(int aValue); }
477
478 internal:
479 operator CartoTypeCore::FeatureInfo();
480 CartoTypeCore::FeatureInfo F() { return CartoTypeCore::FeatureInfo::FromRawValue(m_value); }
481 FeatureInfo(CartoTypeCore::FeatureInfo aInfo);
482 template<typename T> Result SetValue(bool aMustBeRoute,uint32_t aMask,uint32_t aShift,T aValue)
483 {
484 if (Route == aMustBeRoute)
485 {
486 m_value &= ~aMask;
487 m_value |= ((uint32_t(aValue) << aShift) & aMask);
488 return Result::Success;
489 }
491 }
492 Result SetRouteFlag(uint32_t aFlag,bool aValue)
493 {
494 if (Route)
495 {
496 if (aValue)
497 m_value |= aFlag;
498 else
499 m_value &= ~aFlag;
500 return Result::Success;
501 }
503 }
504
505 static const uint32_t KRouteTypeCount = 32;
506 static const uint32_t KGradientCount = 8;
507 static const uint32_t KMaxSubType = 2047;
508 static const uint32_t KRouteAccessShift = 26;
509 static const uint32_t KRouteAccessMask = 63U << KRouteAccessShift;
510 static const uint32_t KRouteAccessWrongWayFlag = 1 << 26;
511 static const uint32_t KRouteAccessPedestrianFlag = 1 << 27;
512 static const uint32_t KRouteAccessCycleFlag = 1 << 28;
513 static const uint32_t KRouteAccessMotorVehicleFlag = 1 << 29;
514 static const uint32_t KRouteAccessEmergencyVehicleFlag = 1 << 30;
515 static const uint32_t KRouteAccessOtherFlag = 1U << 31;
516 static const uint32_t KRouteAccessVehicle = KRouteAccessCycleFlag | KRouteAccessMotorVehicleFlag | KRouteAccessEmergencyVehicleFlag;
517 static const uint32_t KRouteAccessNormal = KRouteAccessCycleFlag | KRouteAccessMotorVehicleFlag | KRouteAccessPedestrianFlag;
518 static const uint32_t KDiscriminatorMask = 3;
519 static const uint32_t KDiscriminatorNonRoute = 0;
520 static const uint32_t KDiscriminatorBridge = 1;
521 static const uint32_t KDiscriminatorTunnel = 2;
522 static const uint32_t KDiscriminatorRoute = 3;
523 static const uint32_t KLevelShift = 2;
524 static const uint32_t KLevelMask = 15 << KLevelShift;
525 static const uint32_t KTypeShift = 6;
526 static const uint32_t KRouteTypeMask = 31 << KTypeShift;
527 static const uint32_t KRouteOneWayFlag = 1 << 11;
528 static const uint32_t KRouteDriveOnLeftFlag = 1 << 12;
529 static const uint32_t KRouteRoundaboutFlag = 1 << 13;
530 static const uint32_t KRouteTollFlag = 1 << 14;
531 static const uint32_t KRouteSpeedLimitShift = 15;
532 static const uint32_t KRouteSpeedLimitMask = 255 << KRouteSpeedLimitShift;
533 static const uint32_t KRouteGradientShift = 23;
534 static const uint32_t KRouteGradientMask = 7 << KRouteGradientShift;
535 static const uint32_t KRouteGradientDirectionFlag = 4 << KRouteGradientShift;
536 static const uint32_t KNonRouteTypeMask = 32767 << KTypeShift;
537 static const uint32_t KNonRouteSubTypeShift = 21;
538 static const uint32_t KNonRouteSubTypeMask = 2047U << KNonRouteSubTypeShift;
539
540 uint32_t m_value;
541 };
542
543}
A structured address. Any field may be empty or null, but at least one field should be non-empty for ...
Definition: CartoTypeWrapper.h:931
Feature information for a map object, represented internally as a 32-bit value.
Definition: CartoTypeFeatureInfo.h:415
bool OneWayBackward
True if this is a one-way route in the direction opposite to the one in which the route is stored.
Definition: CartoTypeFeatureInfo.h:444
int SubType
The sub-type. Always 0 if this is a route. This property cannot be set for route objects.
Definition: CartoTypeFeatureInfo.h:476
bool Toll
True if this is a toll route. This property cannot be set for non-route objects.
Definition: CartoTypeFeatureInfo.h:454
FeatureDiscriminator Discriminator
Returns the feature discriminator.
Definition: CartoTypeFeatureInfo.h:428
bool DriveOnRight
Returns true if this is a two-way route and the rule of the road is to drive on the right....
Definition: CartoTypeFeatureInfo.h:448
bool PedestrianAccess
True if this is a route and pedestrian access is allowed. This property cannot be set for non-route o...
Definition: CartoTypeFeatureInfo.h:464
int SpeedLimit
The speed limit in kph. A value of zero indicates that no speed limit is known. This property cannot ...
Definition: CartoTypeFeatureInfo.h:458
bool CycleAccess
True if this is a route and cycle access is allowed. This property cannot be set for non-route object...
Definition: CartoTypeFeatureInfo.h:466
void ReverseOneWayDirection()
Reverses the one-way direction if this is a one-way route.
bool WrongWay
True if this is a route with a one-way direction opposite to the order of its points....
Definition: CartoTypeFeatureInfo.h:456
bool DriveOnLeft
True if this is a two-way route and the rule of the road is to drive on the left. The rule of the roa...
Definition: CartoTypeFeatureInfo.h:446
bool Route
True if this is a route.
Definition: CartoTypeFeatureInfo.h:430
void SetVehicleAccess(bool aValue)
Sets or clears the vehicle access flags. Throws an exception if this is not a route.
FeatureType Type
The feature type. Route objects can only be set to route types, and non-route objects to non-route ty...
Definition: CartoTypeFeatureInfo.h:438
bool Tunnel
True if this is a route that is a tunnel. Non-route objects cannot be made into tunnels.
Definition: CartoTypeFeatureInfo.h:432
bool Roundabout
True if this is a route that is part of a roundabout. This property cannot be set for non-route objec...
Definition: CartoTypeFeatureInfo.h:452
bool Bridge
True if this is a route that is a bridge. Non-route objects cannot be made into bridges.
Definition: CartoTypeFeatureInfo.h:434
FeatureInfo()
Creates a feature info object of type UnknownNonRoute.
bool OneWay
True if this is a one-way route. Non-route objects cannot be set as one-way.
Definition: CartoTypeFeatureInfo.h:440
FeatureInfo(FeatureType aType)
Creates a feature info object from a feature type.
bool IsPrivate
Returns true if this is a route and no normal access is allowed.
Definition: CartoTypeFeatureInfo.h:474
bool OtherAccessRestricted
True if this is a route and there are access restrictions other than those specified by the standard ...
Definition: CartoTypeFeatureInfo.h:472
bool EmergencyVehicleAccess
True if this is a route and emergency vehicle access is allowed. This property cannot be set for non-...
Definition: CartoTypeFeatureInfo.h:470
int Level
The level, which is in the range -8 ... 7.
Definition: CartoTypeFeatureInfo.h:436
bool MotorVehicleAccess
True if this is a route and motor vehicle access is allowed. This property cannot be set for non-rout...
Definition: CartoTypeFeatureInfo.h:468
bool OneWayForward
True if this is a one-way route in the direction in which the route is stored.
Definition: CartoTypeFeatureInfo.h:442
int Gradient
The gradient as a number in the range 0...7. Values 0...3 are uphill and 4...7 are downhill....
Definition: CartoTypeFeatureInfo.h:460
Information about an entire route.
Definition: CartoTypeWrapper.h:873
A path defining a set of open and closed curves.
Definition: CartoTypeGeometry.h:140
Definition: CartoTypeWrapper.h:69
Result
Result codes returned by CartoType API functions.
Definition: CartoTypeResult.h:15
@ Success
No error; a successful result.
@ ErrorInvalidArgument
This error is returned when an invalid argument has been given to a function.
FeatureConstants
Constants referring to the FeatureType and FeatureInfo classes.
Definition: CartoTypeFeatureInfo.h:376
@ KMaxSubType
The maximum value for the sub-type of a non-route object.
@ KRouteTypeCount
The number of feature types that are used for routes. These values are also indexes into the speed an...
@ KGradientCount
The number of gradients.
uint32_t constexpr FeatureTypeCode(int A, int B, int C)
Definition: CartoTypeFeatureInfo.h:16
@ Position
A flag used in Framework.Navigate to indicate that the position is valid.
FeatureType
Every map object has a feature type.
Definition: CartoTypeFeatureInfo.h:30
@ SkiNordic
The index for nordic ski trails in the speed, bonus and restriction override arrays.
@ LightRail
The index for light railways in the speed, bonus and restriction override arrays.
@ Waterway
The index for waterways in the speed, bonus and restriction override arrays.
@ TrunkRoad
The index for trunk roads in the speed, bonus and restriction override arrays.
@ Motorway
The index for motorways in the speed, bonus and restriction override arrays.
@ Bridleway
The index for bridleways in the speed, bonus and restriction override arrays.
@ AerialWay
The index for aerial ways in the speed, bonus and restriction override arrays.
@ Railway
The index for railways in the speed, bonus and restriction override arrays.
@ Subway
The index for subways in the speed, bonus and restriction override arrays.
@ Footway
The index for footways in the speed, bonus and restriction override arrays.
@ LivingStreet
The index for living streets in the speed, bonus and restriction override arrays.
@ PedestrianRoad
The index for pedestrian roads in the speed, bonus and restriction override arrays.
@ TrunkLink
The index for trunk road links in the speed, bonus and restriction override arrays.
@ UnpavedRoad
The index for unpaved roads in the speed, bonus and restriction override arrays.
@ PrimaryRoad
The index for primary roads in the speed, bonus and restriction override arrays.
@ Track
The index for tracks in the speed, bonus and restriction override arrays.
@ PassengerFerry
The index for passenger ferries in the speed, bonus and restriction override arrays.
@ OtherRoad
The index for other roads in the speed, bonus and restriction override arrays.
@ VehicularFerry
The index for vehicular ferries in the speed, bonus and restriction override arrays.
@ PrimaryLink
The index for primary road links in the speed, bonus and restriction override arrays.
@ MotorwayLink
The index for motorway links in the speed, bonus and restriction override arrays.
@ UnclassifiedRoad
The index for unclassified roads in the speed, bonus and restriction override arrays.
@ SkiDownhill
The index for downhill ski trails in the speed, bonus and restriction override arrays.
@ Cycleway
The index for cycleways in the speed, bonus and restriction override arrays.
@ SecondaryLink
The index for secondary road links in the speed, bonus and restriction override arrays.
@ UnknownRoute
The index for unknown routes in the speed, bonus and restriction override arrays.
@ SecondaryRoad
The index for secondary roads in the speed, bonus and restriction override arrays.
@ ResidentialRoad
The index for residential roads in the speed, bonus and restriction override arrays.
@ Steps
The index for steps in the speed, bonus and restriction override arrays.
@ TertiaryRoad
The index for tertiary roads in the speed, bonus and restriction override arrays.
@ ServiceRoad
The index for service roads in the speed, bonus and restriction override arrays.
FeatureDiscriminator
The feature discriminator stored in a FeatureInfo object.
Definition: CartoTypeFeatureInfo.h:363
@ TunnelRoute
A route that is a tunnel.
@ BridgeRoute
A route that is a bridge.