1

Topic: SOAP MinimumResolution Filter

Appologies for yet another post...

I'm trying to get the minimum resolution filter working but it seems to have no effect on the number of results returned.

I'm placing it as a parameter on the GeographicalFilter like this:

<spat:GeographicalFilter MinimumResolution="_100m"> etc...

Is this correct? Could anyone give me any guidance here or a working example?

Thanks,
Steve

=====================================================
Steve Goddard - IT Officer
Biodiversity Information Service for Powys & Brecon Beacons National Park
T: 01874 610881 - E: steve[at]b-i-s.org - W: www.b-i-s.org

2

Re: SOAP MinimumResolution Filter

Hi Steve,

I think the issue may be that the min res option should have it's own nested tags, i have some code that i used in the past and worked but on trying to test it before i used it as an example it seems the Web Services are down...

In case it is still of use the SOAP request i used for specific datasets and species within a boundary and a minimum resolution looks like this:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tax="http://www.nbnws.net/Taxon" xmlns:spat="http://www.nbnws.net/Spatial" xmlns:sit="http://www.nbnws.net/SiteBoundary" xmlns:map="http://www.nbnws.net/Map" xmlns:tax1="http://www.nbnws.net/TaxonReportingCategory" xmlns:dat="http://www.nbnws.net/Dataset">
   <soapenv:Header/>
   <soapenv:Body>
      <tax:OneSiteDataRequest registrationKey="###" designation="NONE">
         <spat:GeographicalFilter>           
        <spat:Polygon srs="EPSG_4326">
               <spat:Boundary>
                  <spat:Ring>
            <!--User defined GoogleMap polygon -->
            <spat:v srs="EPSG_4326" x="53.409760" y="-2.876912"/>
            <spat:v srs="EPSG_4326" x="53.401676" y="-2.885939"/>
            <spat:v srs="EPSG_4326" x="53.398963" y="-2.865239"/>
        </spat:Ring>
               </spat:Boundary>
            </spat:Polygon> 
            <spat:MinimumResolution>_2km</spat:MinimumResolution>
         </spat:GeographicalFilter>
         <tax:TaxonVersionKeys>NBNSYS0000003191</tax:TaxonVersionKeys>
     <dat:DatasetList>
            <dat:DatasetKey>GA000979</dat:DatasetKey>
            <dat:DatasetKey>GA000977</dat:DatasetKey>
         </dat:DatasetList>
      </tax:OneSiteDataRequest>
   </soapenv:Body>
</soapenv:Envelope>

I haven't worked with this for a while and i think some changes at the NBN end broke it a little while ago so it will probably need updating, if the services come back online i will test/fix it and provide a working example.

Natural History & Biodiversity Data Enthusiast

3 (edited by SteveGoddard 22-10-2012 13:07:58)

Re: SOAP MinimumResolution Filter

Hi Ben,
Really appreciate the reply. I did in the end get this working - the problem was exactly as you said - I needed to put it on its own line:

<spat:MinimumResolution>_1km</spat:MinimumResolution>

I've got this all wrapped up in a nice PHP function now so that I feed in a GMaps poly array, a point or a bbox and it builds the query and sends it to NBN - before assembling the reply into a nice structured array.

The main problem I have now is that I get so little information back. For instance I don't get a spatial ref (which I would realy like so I can plot the results on a map). I think I need to be sending NBN a username and password rather than just a key but I can't seem to find any SOAP example of this. Then I guess I need to start applying for more access to datasets.

I can't believe how hard using the NBN SOAP services has proved to be!  Hey ho... :-)

For the moment I've stopped work on pulling in NBN data. Decided I'd wait till after the big upgrade in December and then see what I could do...

Steve

=====================================================
Steve Goddard - IT Officer
Biodiversity Information Service for Powys & Brecon Beacons National Park
T: 01874 610881 - E: steve[at]b-i-s.org - W: www.b-i-s.org

4 (edited by BDeed 23-10-2012 09:26:05)

Re: SOAP MinimumResolution Filter

No problem, glad you got it working! I was doing something similar in relation to a user defined polygon on an interactive Google Map using javascript.

I think using a username and password is relatively straight forward...

I agree about the difficulty, Rich has approached using the services from a different direction and instead of PHP SOAP requests is contacting the WMS, his method seems both (much) faster and simpler and if you haven't already then i would suggest taking a look. I had assumed this service was only any use in GIS but you can do a lot more with it in relation to mapping (though obviously no data is returned).

In relation to data i've just had a word with Rich as i'm sure you get spatial info back, and it turns out you do, it is just held in a weird way in the returned xml. Each record should have a unique reference number which ties it to the site/spatial reference listed earlier in the document.

Anyway, you're right to wait until the new version. It'll probable render everything so far obsolete!

Natural History & Biodiversity Data Enthusiast

5

Re: SOAP MinimumResolution Filter

Thanks Ben,
I did consider WMS but I really wanted the individual records.
That's interesting about the spatial ref / location. I'll go back over the data returned - I had ignored all the sites info! Might be a bit of a pain to link up... but NBN seem to like to give us a challenge!

Steve

=====================================================
Steve Goddard - IT Officer
Biodiversity Information Service for Powys & Brecon Beacons National Park
T: 01874 610881 - E: steve[at]b-i-s.org - W: www.b-i-s.org