function varargout=regionid(stro) % [af,foundit]=regionid(stro) % % Queries databases of geologic regions from the USGS. % % INPUT: % % stro Some string, e.g. 'Canar', if empty, lists % % EXAMPLE: % % [a,b]=regionid('Ocean'); % plot([a(:).X],[a(:).Y]) % % Last modified by fjsimons-at-alum.mit.edu, 3/2/2011 % Where is the data kept or stored? worldir=fullfile(getenv('IFILES'),'GEOLOGY','WORLD'); % What is the Matlab version of this? allfname=fullfile(worldir,'WORLDGeol1.mat'); defval('stro',[]) defval('foundit',[]) defval('af',[]) % If the world doesn't exist you'll need to make that if exist(allfname,'file')~=2 error('Run REGIONALIZE') else load(allfname) a={WORLDGeol1(:).GEOLPROV}; if ~isempty(stro) for in=1:length(a) if strfind(a{in},stro); foundit=[foundit in]; end end else for in=1:length(a) disp(sprintf('%4i %s',in,a{in})) end end end % Return output if ~isempty(foundit) af=WORLDGeol1(foundit); end vars={af,foundit}; varargout=vars(1:nargout);