%% define source
ncs = opendap_catalog('http://dtvirt5.deltares.nl:8080/thredds/catalog/opendap/rijkswaterstaat/kustlidar/catalog.html')

%% plot coast as reference
close all
L.x = nc_varget('http://opendap.deltares.nl/thredds/dodsC/opendap/deltares/landboundaries/holland.nc','x');
L.y = nc_varget('http://opendap.deltares.nl/thredds/dodsC/opendap/deltares/landboundaries/holland.nc','y');
plot(L.x,L.y,'k')
hold on

%% loop all tiles and plot bounding box
for inc=1:length(ncs)
    
   x = nc_attget(ncs{inc},'x','actual_range');
   y = nc_attget(ncs{inc},'y','actual_range');

   bb.x = [x(1) x(2) x(2) x(1) x(1)];
   bb.y = [y(1) y(1) y(2) y(2) y(1)];

   plot(bb.x,bb.y,'r');
   hold on
   
   if mod(inc,10)==0
   pausedisp
   end
   
end


