1 # Copyright (c) 2019-2020, NVIDIA CORPORATION. All rights reserved.
3 @page maps_usecase3 Map Query
5 @note SW Release Applicability: This tutorial is applicable to modules in **NVIDIA DRIVE Software** releases.
9 Maps module functions that return an array of elements write the returned elements into a fixed size buffer that is passed in as an argument. There are Buffer structs for various map elements:
11 - `dwMapsGeoPointBuffer`
13 - `dwMapsPolyline3fBuffer`
15 - `dwMapsLaneDividerLineBuffer`
16 - `dwMapsFeatureBuffer`
17 - `dwMapsLaneDividerBuffer`
18 - `dwMapsRoadSegmentBuffer`
19 - `dwMapsRoadSegmentPointerBuffer`
21 A Buffer struct must be initialized before being passed to the function:
23 - buffer: pointer to the fixed size array
24 - maxSize: size of the fixed size array
25 - size: current number of valid elements in the array
31 Road Segments provide access to all the map data.
33 The dwMaps_getRoadSegments() function returns copies of Road Segments that overlap with a bounding box of longitude and latitude coordinates.
36 dwStatus dwMaps_getRoadSegments(
37 dwMapsRoadSegmentBuffer* roadSegments,
38 const dwMapsBounds* bounds,
39 dwConstMapHandle_t mapHandle);
42 To retrieve pointers to Road Segments owned by the system instead use dwMaps_getRoadSegmentPointers().
43 This has the advantage of reduced memory footprint vs creating copies of dwMapsRoadSegment.
46 dwStatus dwMaps_getRoadSegmentPointers(
47 dwMapsRoadSegmentPointerBuffer* roadSegmentPointers,
48 const dwMapsBounds* bounds,
49 dwConstMapHandle_t mapHandle);
52 For convenience, there are a few more specific query functions:
54 - `dwMaps_getLaneDividers()`
55 - `dwMaps_getFeatures()`
60 dwStatus dwMaps_getLaneDividers(
61 dwMapsLaneDividerBuffer* laneDividers,
63 const dwMapsBounds* bounds,
64 dwConstMapHandle_t mapHandle);
67 `dwMaps_getLaneDividers()` returns all Lane Dividers that overlap with a bounding box of longitude and latitude coordinates, filtered by their type. A logical combination of type flags can be used to specify which Lane Dividers are returned.
72 dwStatus dwMaps_getFeatures(
73 dwMapsFeatureBuffer* features,
75 const dwMapsBounds* bounds,
76 dwConstMapHandle_t mapHandle);
79 `dwMaps_getFeatures()` works the same way as `dwMaps_getLaneDividers()`.
84 dwStatus dwMaps_getClosestLane(
85 const dwMapsLane** closestLane,
86 dwMapsGeoPoint* closestPoint,
87 const dwMapsGeoPoint* p,
90 dwConstMapHandle_t mapHandle);
93 `dwMaps_getClosestLane()` returns the closest Lane, and the closest point on it, to a given query point p. When the `onlyDrivable` flag is set to true, non-drivable lanes are not considered. `ignoreHeight` can be set if the height of the input point is unknown or inaccurate. In that case, the distances are compared, after projecting all points to height 0.
95 @note The maps module also provides a map tracker that allows a robust selection of the current lane when driving along a road. It also incorporates orientation and logical connections and thus can give a better result than just picking the closest lane.
97 For more information see @ref dwx_hd_map_access_sample .