1

Re: Grid map web service documentation update

The grid map web service documentation has been updated, for details http://www.searchnbn.net/library/webser … ridMap.jsp.

The help now has example request and response XML, PHP examples (including a link to Marlin examples) and updated element descriptions.

We've also been doing some work to improve the grid map web service. It should now work reliably for Java, PHP and .net. For Java and .net if you have created proxy classes from the WSDL you may need to update them. You can download them at http://www.searchnbn.net/library/webser … tTools.jsp.

Happier coding ;)

Richard

[b]Richard Ostler[/b]
NBN Developer

2

Re: Grid map web service documentation update

Richard, the "parameters" link on your docs page is dead...

Charles

Charles Roper
Digital Development Manager | Field Studies Council
http://www.field-studies-council.org | https://twitter.com/charlesroper | https://twitter.com/fsc_digital

3

Re: Grid map web service documentation update

Thanks Charles, I've fixed the link.

[b]Richard Ostler[/b]
NBN Developer

4

Re: Grid map web service documentation update

Hi

Not sure what happened yesterday (18th May) but the web services seemed to be down for a while. Anyway, this morning my temporary Taxon search (which only works with the full name e.g. Common Frog in the Keyword) http://www.nesbrec.org/speciessearch.php is working but the Grid Map that is being retrieved is for the whole country even though the query is specifying <ViceCounty>93</ViceCounty>.

Does anybody have any suggestions or has the NBN web service been changed?

BTW I attach my code for the Grid Map as posted on the Smartgroups

Cheers

Nick (aka Globalforester)
-------------------------------------------------------------------------------------------------------------------------

<?php
//Step 1. Set up the web service client.
require 'nusoap/nusoap.php';
$client = new soapclient('http://212.219.37.104/NBNWebServices/ws/WSDL', 'wsdl');
if($client->fault){
echo "FAULT: <p>Code: {$client->faultcode} >br />";
echo "String: {$client->faultstring} </p>";
}


//Step 2. Create a query i.e. the 'Input Parameters'
// set the parameters for the map
$query = '<GridMapRequest
xmlns="http://webservices.searchnbn.net/query"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">';
$query = $query.'<TaxonVersionKey>';
$TVK = 'NBNSYS0000005133';
$query = $query.$str2.$TVK.'</TaxonVersionKey>';
$query = $query.'<Resolution>_2km</Resolution>'; //10km
$query = $query.'<GridMapSettings>';
$query = $query.'<Width>300</Width>';
$query = $query.'<Height>300</Height>';
$query = $query.'<Background>OSMap</Background>'; //None
$query = $query.'<ViceCounty>93</ViceCounty>'; //Any 92 is south Aberdeenshire
$query = $query.'<Region>GB</Region>'; //GBIreland
$query = $query.'<FillColour>#FF0000</FillColour>';
$query = $query.'<Grid>None</Grid>'; //Grid_10km
$query = $query.'</GridMapSettings>';
$query = $query.'<Classification>';
$query = $query.'<Band border="#FF0000" fill="#FF0000" from="1900" to="1970" />';
$query = $query.'<Band border="#00FF00" fill="#00FF00" from="1971" to="1995" />';
$query = $query.'<Band border="#0000FF" fill="#0000FF" from="1996" to="2006" />';
$query = $query.'</Classification>';
$query = $query.'</GridMapRequest>';

//Step 3.Send the request.
$response = $client->call('GetGridMap', $query );

//Step 4. Display map and species name.
$Map = $response['Map'];
$Species = $response['Species'];

print '<H2>Grid map for '.$Species['Spp'].' ('.$Species['CommonName'].')</H2>';
print '<div align="center"><img src="'.$Map['Url'].'" /></div>';
echo"<br>";

//Step 5. Display the list of datasets.
print '<TABLE BORDER=3 WIDTH=100% CELLPADDING=2 CELLSPACING=3 BGCOLOR=#FFFFFF>';
print '<tr><td><H2>Data Summary -';
print '</H2></td></tr>';

$DatasetDetails = $response['DatasetSummaryList'];
$MyDatasetSummary = $DatasetDetails['DatasetSummary'];
$CountDatasetSummary = count($MyDatasetSummary);
//now loop though summaries
$i=0;
do
{
$MyDatasetSummarySubset = $MyDatasetSummary[$i];
$MyProviderMetadata = $MyDatasetSummarySubset['ProviderMetadata'];
print '<tr><td bgcolor="#FFFFFF">'.$MyProviderMetadata['DatasetTitle'].'</td>';
print '<td bgcolor="#FFFFFF">'.$MyProviderMetadata['DatasetProvider'].'</td></tr>';
$i++;
}
while ($i<$CountDatasetSummary);

print '</table>';
echo"<br>";

//Step 6. Display NBN logo and terms and conditions.
print '<TABLE BORDER=3 WIDTH=100% CELLPADDING=2 CELLSPACING=3 BGCOLOR=#FFFF99>';
print '<tr>';
print '<td align="left"><a href="'.$response['!termsAndConditions'].'">Gateway terms and conditions</a></td>';
print '<td align="right"><a href="http://www.searchnbn.net"><img
border="0" src="'.$response['!NBNLogo'].'" /></a></td>';
print '</tr>';
print '</table>';
?>
(ePlanning Project Manager) Aberdeenshire Council

5 (edited by Richard Ostler 19-05-2006 10:28:14)

Re: Grid map web service documentation update

Hi Nick,

The web services don't, as yet have a dedicated database server. Currently we have to run the web services off our data loading database. This is not ideal, but we have limited resources for testing and development work. Yesterday we were doing some work with the db causing the web services to go down. Until we get a dedicated database server this situation will happen again, although I shall try and give advanced warning in the future.

We don't run the services on the same database server as www.searchnbn.net because they are still in development - we don't want to risk a dodgy query crippling www.searchnbn.net an we still need to do more work on load testing.

The good news is we do have a dedicated database server on order, the bad news is it won't be ready for about a month.

Regards the vice county mapping, that should be working again. It looks like yesterdays work corrupted some of the map services.

Richard

[b]Richard Ostler[/b]
NBN Developer

6

Re: Grid map web service documentation update

Hi Richard

Thanks for the update. I think that the web services are brilliant as they saved me having to set up our own databases and more importantly make sure that the output is constantly updated. I am thinking about setting up some sort of caching of results (e.g. Taxon search) to speed up results and save overloading your servers. It would also allow me to add variant/local names to the search (e.g. 'Creeping Ladies tresses' for Gooyera repens).

BTW I assume there should not be a copyright issue with using local caching so long as I acknowledge the data source.

BTW I cracked the Taxon search http://www.nesbrec.org/speciessearch.php at the weekend which works the same as the example site http://212.219.37.104/NBNWebServices/ex … Search.jsp, which means that we can search our own data using the Taxon keys generated.

Cheers

Nick (aka Globalforester)

(ePlanning Project Manager) Aberdeenshire Council