How to get road sign warnings using HERE SDK?
What is Road Sign Warning Event?
As you drive along a road, your vehicle may pass a variety of road signs that communicate critical information such as speed limits, warnings, yield instructions, and directional guidance. To receive timely and detailed notifications about these road signs, you can configure a RoadSignWarningListener using the HERE SDK. This listener actively monitors the vehicle's surroundings and triggers a RoadSignWarning event whenever a relevant road sign is detected along the route. These alerts can improve situational awareness and contribute to safer driving by informing the application of upcoming regulations or hazards.
Each RoadSignWarning event contains structured data about the detected road sign, including attributes like RoadSignType and RoadSignCategory. The HERE SDK defines a comprehensive set of RoadSignType values that describe the nature of each detected sign—for example, STOP_SIGN, YIELD, or SPEED_LIMIT. While the appearance of road signs may vary slightly depending on the country or region, certain types such as STOP_SIGN tend to follow international conventions and have a nearly identical look worldwide.
It's important to note that the HERE SDK does not provide the visual representation (i.e., icon or image) of the road signs. Instead, it delivers only the semantic information that describes the sign’s type and category. Additionally, the precise geographic location of the road sign is not included in the event. However, the event does supply an "ahead distance," allowing applications to estimate when the vehicle is approaching the sign and trigger timely in-app alerts accordingly.
Developers can further customize behavior by using RoadSignWarningOptions, which allow filtering for specific types or categories of road signs. This enables applications to selectively listen for only the most relevant signs, optimizing both performance and user experience.
How to configure Road Sign Warning Event handler?<br /> RoadSignWarningOptions roadSignWarningOptions = new RoadSignWarningOptions(); // Set a filter to get only shields relevant. // Get notification distances for road sign alerts from visual navigator. WarningNotificationDistances warningNotificationDistances = visualNavigator.getWarningNotificationDistances(WarningType.ROAD_SIGN); // The distance in meters for emitting warnings when the speed limit or current speed is fast. Defaults to 1500. warningNotificationDistances.fastSpeedDistanceInMeters = 20; // The distance in meters for emitting warnings when the speed limit or current speed is regular. Defaults to 750. warningNotificationDistances.regularSpeedDistanceInMeters = 5; // The distance in meters for emitting warnings when the speed limit or current speed is slow. Defaults to 500. warningNotificationDistances.slowSpeedDistanceInMeters = 2; // Set the warning distances for road signs. visualNavigator.setWarningNotificationDistances(WarningType.ROAD_SIGN, warningNotificationDistances); visualNavigator.setRoadSignWarningOptions(roadSignWarningOptions); // Notifies on road shields as they appear along the road. visualNavigator.setRoadSignWarningListener(new RoadSignWarningListener() { @Override public void onRoadSignWarningUpdated(@NonNull RoadSignWarning roadSignWarning) { Log.d(TAG, "Road sign distance (m): " + roadSignWarning.distanceToRoadSignInMeters); Log.d(TAG, "Road sign type: " + roadSignWarning.type.name()); if (roadSignWarning.signValue != null) { // Optional text as it is printed on the local road sign. Log.d(TAG, "Road sign text: " + roadSignWarning.signValue.text); } } });<br />
RoadSignWarning events are issued exactly two times:
When DistanceType is AHEAD and distanceToRoadSignInMeters is > 0.
When DistanceType is PASSED and distanceToRoadSignInMeters is 0.