Once you have a TMCLocationReference
, you can transform it to a LinearLocation
using LocationReferenceResolvers.tmc
method.
There should be an example in Resolving a Location Reference section.
The resolver allows you to transform the TMCLocationReference
into a LinearLocation
containing internal HERE maps ids, which can be transformed to WKT like LineString
s using for instance the PropertyMaps.geometry
method, for which you can find more details in the dev guide.
As an example, you could do something like this:
StandaloneCatalogFactory scf = new StandaloneCatalogFactory();
Catalog optimizedMap = scf.create(OptimizedMap.v2.HRN);
CacheManager cacheManager = CacheManager.withLruCache();
LocationReferenceResolver<TMCLocationReference, BidirectionalLinearLocation> tmcResolver =
LocationReferenceResolvers.tmc(optimizedMap, cacheManager);
TMCLocationReference tmcLocationReference = ...
BidirectionalLinearLocation linearLocation = tmcResolver.resolve(tmcLocationReference);
PropertyMap<Vertex, LineStringHolder<GeoCoordinate>> geometry =
PropertyMaps.geometry(optimizedMap, cacheManager);
LineStringHolder<GeoCoordinate> lineString =
geometry.get(linearLocation.getLocation().getPath().get(0));