%% Add and Remove Catalog
% Add a HERE HD Live Map (HDLM) catalog to the list of catalogs available for configuring a HERE HDLM reader. Read data from the new catalog, and then remove the catalog from the list.
% The catalog used in this example contains data about landmarks in North America, such as roadside obstacles and other objects on or around the road. This catalog is in the alpha development stage. For more details on this catalog, see the HERE HD Live Map documentation.
% Specify the region name that you want to associate to the catalog.

region = 'North America Landmarks (Alpha)';

%
% Specify the catalog name.

catalog = 'here-hdlm-alpha-landmarks-na-1';

%
% Associate the catalog to the region name. If you have not previously set up HERE HDLM credentials, a dialog box prompts you to enter them. The catalog is added to list of catalogs that are associated with regions in hereHDLMConfiguration objects.

hereHDLMConfiguration.addCatalog(region,catalog)

%
% Create a HERE HDLM configuration using the specified region name.

config = hereHDLMConfiguration(region);

%
% Define a HERE tile ID for an area of Boston, Massachusetts, USA. Create a HERE HDLM reader, and read map data for that tile from the new catalog. Map data and catalog version might vary.

tileID = uint32(321884539);
reader = hereHDLMReader(tileID,'Configuration',config);
data = read(reader,'AlphaLandmarkObstacles')

%
% Remove the catalog. If you try to configure a reader using this region name again, the hereHDLMConfiguration object returns an error message.

hereHDLMConfiguration.removeCatalog(region)

% Copyright 2018 The MathWorks, Inc.