Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Extracting data from the WPS server is a three step process

  1. Get information about available processes (GetCapabilities)
  2. Get information about a specific process (DescribeProcess)
  3. Execute the process (Execute)

GetCapabilities

...

Code Block
% Server URL
url = 'http://dtvirt5.deltares.nl/wps';

% Pass the required paramters
xml = urlread(url,'get',{'request','GetCapabilities','service','wps','version','1.0.0'});

% Now we have to save the XML file otherwise we can't use xmlread
fid = fopen('file.xml','w');
fwrite(fid, xml);
fclose(fid);

% Read the XML file we just saved
xmldoc = xmlread('file.xml');

% Look up the intersting elements (Processes)
offerings = xmldoc.getElementsByTagName('wps:Process');

% Look up all process Identifiers
for i = 0:offerings.getLength-1
    process = offerings.item(i);
    identifier = process.getElementsByTagName('ows:Identifier').item(0).getFirstChild.getData
end

...