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:
dwMapsGeoPointBuffer
dwMapsPointBuffer
dwMapsPolyline3fBuffer
dwMapsLaneBuffer
dwMapsLaneDividerLineBuffer
dwMapsFeatureBuffer
dwMapsLaneDividerBuffer
dwMapsRoadSegmentBuffer
dwMapsRoadSegmentPointerBuffer
A Buffer struct must be initialized before being passed to the function:
Road Segments provide access to all the map data.
The dwMaps_getRoadSegments() function returns copies of Road Segments that overlap with a bounding box of longitude and latitude coordinates.
To retrieve pointers to Road Segments owned by the system instead use dwMaps_getRoadSegmentPointers(). This has the advantage of reduced memory footprint vs creating copies of dwMapsRoadSegment.
For convenience, there are a few more specific query functions:
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.
dwMaps_getFeatures()
works the same way as dwMaps_getLaneDividers()
.
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.
For more information see Map Access Sample .