%QRYDEMO  Demo:  Demonstration of linked map queries
%
%  Synposis:     qrydemo

%  Copyright 1996-1998 by Systems Planning and Analysis, Inc. and The MathWorks, Inc.
%  Written by:  E. Byrns, E. Brown
%   $Revision: 1.8 $    $Date: 1998/08/10 17:51:06 $


%  This function will create linked maps and associated query
%  functions using MapTools.  Specifically, the world topography
%  and country data will be linked together.

%  Create a map axes for sinusoidal projection.

figure;
axesm sinusoid

%  First, load and display the topographic map

load topo

meshm(topo,topolegend);
demcmap(topo)

% disable uimaptbx interactions in demos

huimaptbx = findobj(gcf,'buttondownfcn','uimaptbx'); 
set(huimaptbx,'buttondownfcn','')

%  Load in the partitioned world matrix map for
%  establishing the query

load worldmtx

%  Set the desired query data with this map.
%  Permute the topo data so that is aligns with the world data.

qrydata(gca,'World Data',...
        {'Country:','mapvector',map,maplegend,strvcat(nations(:).name)},...
        {'Topo Data:','mapmatrix',topo(:,[181:360 1:180]),maplegend} );
