[HSDK] Update OCM to the latest to resolve Routing issues
Issue - The customer sees incorrect routing with HERE SDK as follows
The calculated route is off the road at an intersection when turning to the left, and this issue exists with all SDK platforms.
Implementing the latest SDK does not resolve it but updating the OCM helps.
Reference: Upgrade from previous versions > Update automatically
Resolution - Update OCM to the latest version<br /> private void initializeHERESDK() { // Set your credentials for the HERE SDK. String accessKeyID = "your_access_key_ID"; String accessKeySecret = "your_access_key_secret"; AuthenticationMode authenticationMode = AuthenticationMode.withKeySecret(accessKeyID, accessKeySecret); SDKOptions options = new SDKOptions(authenticationMode); // Specify one or more custom catalog configurations. options.catalogConfigurations = getCustomCatalogConfiguration(); try { Context context = this; SDKNativeEngine.makeSharedInstance(context, options); } catch (InstantiationErrorException e) { throw new RuntimeException("Initialization of HERE SDK failed: " + e.error.name()); } } private List getCustomCatalogConfiguration() { List catalogConfigurations = new ArrayList<>(); // OPTION 1: with the latest catalog version. boolean ignoreCachedData = true; CatalogVersionHint versionHint = CatalogVersionHint.latest(ignoreCachedData); // OPTION 2: with a previous catalog version CatalogVersionHint versionHint = CatalogVersionHint.specific(153); String customHRN = "hrn:here:data::olp-here:ocm"; DesiredCatalog customOCMCatalog = new DesiredCatalog(customHRN, versionHint); catalogConfigurations.add(new CatalogConfiguration(customOCMCatalog)); return catalogConfigurations; }<br />
The above method customizes catalog configuration with two options (you can only have one applied):
The latest catalog version - the version 158 at the time of drafting this article
A specified catalog version - version 153 that can replicate the issue
Updating the OCM from version 153 to 158 and resolved the issue as follows:
Note: after changing the catalog configuration with a different catalog version, you may need to uninstall the app to have the new config applied.