%% Create Configuration for Specific Catalog Version
% Create a HERE HD Live Map (HERE HDLM) configuration object for the previous version of a catalog.
% Load a sequence of latitude and longitude coordinates for a driving route in Los Altos, California, USA.

data = load('geoSequence.mat')

%
% Create a HERE HDLM configuration object for the latest version of a catalog that roughly corresponds to North America. If you have not previously set up HERE HDLM credentials, a dialog box prompts you to enter them. Your catalog version might differ from the one shown here.

catalog = 'hrn:here:data::olp-here-had:here-hdlm-protobuf-na-2';
configLatest = hereHDLMConfiguration(catalog)

%
% Create a configuration object for the previous version of the catalog.

previousVersion = configLatest.CatalogVersion - 1;
config = hereHDLMConfiguration(catalog,previousVersion)

%
% Create a HERE HDLM reader using the specified configuration object. The reader is configured to read data from only the previous version of the North America catalog.

reader = hereHDLMReader(data.latitude,data.longitude,'Configuration',config);

% Copyright 2018 The MathWorks, Inc.