1

Re: Polygons in XML reports

Is there anyway to pull out information on polygons when using them in a XML report (in particular I'm after the file code of the associated location).

I'm guessing not, as %s returns a list of sample keys rather than anything to do with the polygon?

If I'm right, is there anyway to use the information in LOCATION_BOUNDARY to do polygon searches?

Charlie Barnes
Information Officer
Greater Lincolnshire Nature Partnership

2 (edited by MikeWeideli 14-01-2011 11:10:23)

Re: Polygons in XML reports

There is a LocationinPolygon  type, which will return all the Location in a polygon, but I can't  see a way of directly getting the linked location for a polygon.   You might be able to do something  by finding the location within the polygon (assuming that the Location you have linked to is within the polygon) then linking this to Location boundary on the assumption that there is only likley to be one linked polygon within the boundary. This might work in a simple set up where polygon boundaries don't overlap.

<Condition field= "Location_key" operator="equal" type="LocationsinPolygon"  name="Select Polygon" includepartialoverlap='yes'/>

Mike Weideli

3

Re: Polygons in XML reports

Hmm, the only way I can see it working is rather convuluted - by extracting the grid squares of the associated polygon and using the grid squares of the location.

Charlie Barnes
Information Officer
Greater Lincolnshire Nature Partnership

4

Re: Polygons in XML reports

I'm not quite clear exactly what you are after Charlie, but it seems to me it should be easy enough to identify from the sample keys, which samples are associated with locations (i.e. have values for SAMPLE.LOCATION_KEY and then to join with the LOCATION TABLE to extract the filecode.

Of course this will return the file code of any site for which there is occurrence data and where the spatial_ref of the location falls within the search polygon and it's easy to see situations where it might return multiple sites.

I have said before that i see it as a major failing of Recorder that it is able to hold records of occurrences at a site (location) and also of associating locations with a polygon, but it seems to be incapable of querying to return records associated with a polygon which lies within or intersects a search polygon. Of maybe I have missed something?

Rob Large
Wildlife Sites Officer
Wiltshire & Swindon Biological Records Centre

5

Re: Polygons in XML reports

Hi Rob, I'm not quite clear myself, but I'll try to explain!

I have a number of locations in Recorder with associated polygons. What I want to be able to do is run a report on a polygon, pulling out all records within that polygon, along with the file code of the associated location (as a precursor to an automated system).

The clintcher being that I want all records, i.e. those not associated with any location and not just those linked to the location of the polygon I'm performing the search.

Charlie Barnes
Information Officer
Greater Lincolnshire Nature Partnership

6

Re: Polygons in XML reports

Hi Charlie
If you have a location with a polygon, you can do a Report Wizard report to get all the records from the location's polygon. Select Report wizard, then Restrict to one or more polygons, choose the location's polygon on the next step then select All Taxa on the taxon selection page. This gives you the list of occurrences, but I guess you will have to add the location's file code manually after export.

This should give you all records that fall inside or clip the polygon of the location, including those which are linked directly to the location. Rob - I am not sure what you mean in your last statement - does this not cover it?

Best Wishes

John van Breda
Biodiverse IT

7

Re: Polygons in XML reports

johnvanbreda wrote:

If you have a location with a polygon, you can do a Report Wizard report to get all the records from the location's polygon.

I know I can use the report wizard, but I want to be able to automate it with XML reports.

Charlie Barnes
Information Officer
Greater Lincolnshire Nature Partnership

8

Re: Polygons in XML reports

John, no it doesn't quite cover it (although it should cover most of Charlie's question). I envisage a situation which is common to all LRCs, where we are doing a datasearch let us say for all records within 1km of a planning application site. The process you describe will return all records where the spatial reference falls within or clips our search polygon (a 1km buffer around the site). That means it will also return all records associated with a location which has a spatial reference which falls within the search polygon, where those records have no unique spatial reference but use that inherited from the parent location.

However there is a third class of records which should be returned and which as far as I see are not. Records of taxa associated with locations, the boundary polygons of which intersect the seach polygon, but where the spatial ref of the parent site is actually outside the search polygon will not be returned.

It is my understanding that when occurences are recorded against a site (location), but no additional spatial reference is  supplied (I personally have collected in excess of 50,000 such records in the last five years of my employment), it is implied that those ocurrences may lie anywhere within the area defined as that site. They may be widespread or ubiquitous within the site, or they may be rare but lacking any more detailed spatial information. Either way if we ask for all occurences within 1km of a development site, we should receive all such occurrences which may fall within the area where the search polygon intersects the site boundary polygon.

If Recorder was able to return such data we would be able to use it for all area-based data searches in one single query. Of course it would be useful to recieve also an indication that these records are rather less certain than those which we know were definately recorded within the search area, but that is mere refinement.

It may be that I have missed something in the documentation and that Recorder actually does precisely what I describe, but this has not been my understanding so far.

Rob Large
Wildlife Sites Officer
Wiltshire & Swindon Biological Records Centre

9

Re: Polygons in XML reports

And Charlie, if you do the query using the wizard and then save it, the .wzd file saved will contain most of the xml needed, you should then be able to modify the contents to make it do exactly what you wish, by comparison with other xml reports which work in a similar way.

Rob Large
Wildlife Sites Officer
Wiltshire & Swindon Biological Records Centre

10 (edited by MikeWeideli 24-01-2011 10:26:39)

Re: Polygons in XML reports

You can get the Locations within a polygon from XML reports, but  I thought you were trying to get information about the Location linked to the polygon.  This is not held in any tables, but in the Map Files which are not accessible. In a very simple situation where you do not have any overlapping polygons and where the Location linked to the polygon is within the selected polygon, then you might be able to get the information  by bringing in the Location Boundary table.  I can expand on this idea if it helps. If you do have overlapping polygons then you should be able get the files codes for all linked polygons within the selected polygon, but this may not help much.



Mike

Mike Weideli

11

Re: Polygons in XML reports

Yes - it's the file code of the location associated with polygon I'm after, rather than the file code of the location of the record.

Considering Recorders just wiped one of my maps, I think using the location grid squares and ignoring polygons once I've extracted the grid refs, is probably the best way to go?

Charlie Barnes
Information Officer
Greater Lincolnshire Nature Partnership

12

Re: Polygons in XML reports

HI Charlie
I don't think there are any standard ways of getting records out against the grid square list - the problem here is that you may have grid squares of different precisions against your records so it is not a simple join (though probably fairly easy to do in an XML report). The other thing to bear in mind is that this method would not be entirely accurate, plus it would not cope with non OSGB records (at least not without a lot of work).
If one of your recorders was able to wipe out a map, it sounds like there is a requirement to prevent users other than admin (or something similar) from wiping polygons/sheets off the map? Better still, the polygon data should really be stored in the db with the location record, though of course that would be much easier if we could all move over to SQL Server 2008 which supports spatial data properly.
Best Wishes

John van Breda
Biodiverse IT

13

Re: Polygons in XML reports

johnvanbreda wrote:

The other thing to bear in mind is that this method would not be entirely accurate

In what way?

johnvanbreda wrote:

If one of your recorders was able to wipe out a map, it sounds like there is a requirement to prevent users other than admin (or something similar) from wiping polygons/sheets off the map?

Recorder - capital 'R' (apologies for poor grammar!)

Charlie Barnes
Information Officer
Greater Lincolnshire Nature Partnership