1

Re: Links to exsting GIF distribution maps

I would like to have a link to some existing GIF format distribution maps that are held in the following folder http://data.nbn.org.uk/output/.  These are used in the Butterfly Conservation Moths Count web site currently.  The GIF filename has the following format gridGBv4_nbnims-2116451001430.gif, but the filename is generated rather than having anything to do with species numbers.  Will there be an index of these somewhere that I can look up?

Thanks, Mark

2

Re: Links to exsting GIF distribution maps

The files in http://data.nbn.org.uk/output/ are transitory and are generated on request. The Moths website uses the GridMap webservice to request these images. Please do not try to link to them directly, they don't live for long.

The webservices are documented at http://www.nbn.org.uk/getdoc/de60e783-3f47-43c7-83fd-628b3a7eadf6/web-services-documentation.aspx

Paul Gilbertson,
NBN Gateway Developer

3

Re: Links to exsting GIF distribution maps

Thanks Paul.  That's helpful and I've now looked at some php examples.  I've downloaded one of the examples and am trying to get it working.

The top fragment of the example php script is below.  I've added some print lines to see how far I'm getting.  I downloaded nusoap from sourceforge which got me as far as the T2 print line, but the newsoap function doesn't appear to be working as I don't get to the T2.1 print line.  class.newsoap.php is in the same folder as nusoap.php, but perhaps it isn't being found?  All of the php files are 644 in the lib/ folder.

Any advice on how to progress?

Thanks
Mark

<H1>GetGridMapExample</H1>

<?php
/*
*    NBN Gateway SOAP Client Sample:
*    Author: James Perrins,
*    exeGesIS SDM
*    3rd March 2006
*/
print '<h2>T0</h2>';
require_once('lib/nusoap.php');
print '<h2>T1</h2>';

//pass in details of any proxy server
$proxyhost = isset($_POST['proxyhost']) ? $_POST['proxyhost'] : '';
$proxyport = isset($_POST['proxyport']) ? $_POST['proxyport'] : '';
$proxyusername = isset($_POST['proxyusername']) ? $_POST['proxyusername'] : '';
$proxypassword = isset($_POST['proxypassword']) ? $_POST['proxypassword'] : '';

print '<h2>T2</h2>';

$client = new soapclient("http://www.nbnws.net/ws/WSDL", 'true', $proxyhost, $proxyport, $proxyusername, $proxypassword);
print '<h2>T2.1</h2>';
// Set timeouts, nusoap default is 30
$client->timeout = 500;
$client->response_timeout = 500;

4

Re: Links to exsting GIF distribution maps

bump!

Any help gratefully received.

Mark

PS I managed to get banned from the forum by posting the previous reply and wonder whether the posting didn't appear as the forum thouhgt is was spam?

5

Re: Links to exsting GIF distribution maps

I've found this stack trace in the server log which might help?

#0 /home/sites/eastscotland-butterflies.org.uk/public_html/GetGridMap.php(22): SoapClient->SoapClient('http://www.nbnw...', 'true', '', '', '', '')

#1 {main}

thrown in /home/sites/eastscotland-butterflies.org.uk/public_html/GetGridMap.php on line 22

PHP Warning:  SoapClient::SoapClient() expects at most 2 parameters, 6 given in /home/sites/eastscotland-butterflies.org.uk/public_html/GetGridMap.php on line 23

PHP Fatal error:  SoapClient::SoapClient() [<a href='soapclient.soapclient'>soapclient.soapclient</a>]: Invalid parameters in /home/sites/eastscotland-butterflies.org.uk/public_html/GetGridMap.php on line 23

PHP Fatal error:  Uncaught SoapFault exception: [Client] SoapClient::SoapClient() [<a href='soapclient.soapclient'>soapclient.soapclient</a>]: Invalid parameters in /home/sites/eastscotland-butterflies.org.uk/public_html/GetGridMap.php:23

6

Re: Links to exsting GIF distribution maps

Sorry, have found that nusoap isn't being found and that the php built in soapclient is bieng used.  I don't know how to stop this.

Using the php soapclient I do at least get to nbn, but had to put the $query string into an array.  However the web service is responding with an error "[SOAP-ENV:Server] No taxon version key was supplied. You must supply a taxon version key"

Here's the code fragment.

$query1 = '<GridMapRequest
xmlns="http://webservices.searchnbn.net/query"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<TaxonVersionKey>NHMSYS0000309499</TaxonVersionKey>
<Resolution>_2km</Resolution>
<GridMapSettings>
  <Width>500</Width>
  <Height>500</Height>
  <Grid>Grid_10km</Grid>
  <Background>OSMap</Background>
  <ViceCounty>59</ViceCounty>
  <Region>GBIreland</Region>
</GridMapSettings>
<Classification>
  <Band border="#FF0000" fill="#FF0000" from="1900" to="1970" />
  <Band border="#00FF00" fill="#00FF00" from="1971" to="1995" />
  <Band border="#0000FF" fill="#0000FF" from="1996" to="2006" />
</Classification>
    <DatasetList>
  <DatasetKey>GA000144</DatasetKey>
</DatasetList>
</GridMapRequest>';

$response = $client->__soapCall("GetGridMap", array($query1));

7

Re: Links to exsting GIF distribution maps

OK, thanks.  Sorted by using nusoap_client class.

Mark