1

Re: Quickest way to get species list for 1km square?

Quick query,

What is the quickest (or best) way to get a species list for a 1km square with Recorder 6? Sometimes setting the north east and south west corner for a bounding box throws up some interesting results...

I know a few people have developed some xml reports to do this but still on ver 6.7 here so still need to upgrade first!

Julie

2

Re: Quickest way to get species list for 1km square?

Here are the instructions for producing an XML report for listing the taxon occurrences for a 1 km square.  The version of this report that you were probably doing uses latitude and longitude, hence the errors, but my solution uses one of the functions supplied with Recorder 6 (FormatGridRef) to work out the 1 km square from the spatial reference. I developed this when a user reported that reports for records in a 1 km square was producing different results in Recorder 3 and Recorder 6, after we had transferred their data to Recorder 6. Using the XML report below, the Recorder 3 and Recorder 6 results were the same when the associated species (related occurrences in Recorder 6) were taken into account. It was designed for version 6.7 but with the minor modification mentioned below it will also work for 6.9.

1.    Open a text file in Notepad (Start – All Programs – Accessories – Notepad in Windows XP).

2.    Copy and paste the following into it:
<?xml version="1.0" ?>
<CustomReport  description="Taxon occurrences for a 1 km square">

    <SQL>
    SELECT
        SAMPLE.SAMPLE_KEY,
        SAMPLE.SPATIAL_REF,
        SAMPLE.VAGUE_DATE_START,
        SAMPLE.VAGUE_DATE_END,
        SAMPLE.VAGUE_DATE_TYPE,
        TAXON_OCCURRENCE.TAXON_OCCURRENCE_KEY,
        TAXON_DETERMINATION.TAXON_LIST_ITEM_KEY,
        INDEX_TAXON_NAME.ACTUAL_NAME,
        INDEX_TAXON_NAME.COMMON_NAME,
        INDEX_TAXON_NAME.PREFERRED_NAME
    FROM ((SAMPLE INNER JOIN TAXON_OCCURRENCE ON SAMPLE.SAMPLE_KEY =
        TAXON_OCCURRENCE.SAMPLE_KEY)
        INNER JOIN TAXON_DETERMINATION ON TAXON_OCCURRENCE.TAXON_OCCURRENCE_KEY
        = TAXON_DETERMINATION.TAXON_OCCURRENCE_KEY)
        INNER JOIN INDEX_TAXON_NAME ON TAXON_DETERMINATION.TAXON_LIST_ITEM_KEY
        = INDEX_TAXON_NAME.TAXON_LIST_ITEM_KEY
    <Where keytype="Default">   
    WHERE
        <Condition field="dbo.FormatGridRef(SAMPLE.SPATIAL_REF,
        SAMPLE.SPATIAL_REF_SYSTEM, 1)" operator="equal" type="text" name="1 km Square"/>
        and TAXON_DETERMINATION.PREFERRED = 1
    ORDER BY TAXON_OCCURRENCE.TAXON_OCCURRENCE_KEY
    </Where>
   
    </SQL>

<Columns>
</Columns>

</CustomReport>

Take care when pasting not to accidentally add a space before <?xml. You can generally break lines, but don't accidentally put spaces in the middle of words.

3.    Save it as TOccs for 1km square.xml (or whatever you wish to call it, although the extension has to be .xml) in the \User Files\Reports folder for Recorder 6.

4.    Open Recorder 6 and from the main menu select Reports - Run then from the drop down box select your report (in version 6.9 you will be presented with a hierarchy of reports).

5.    Enter the required 1 km square and click OK.

6.    Report Output offers various options for what you can do with the results.

The report only includes the fields listed between SELECT and FROM. If you want more included you will need to amend the SELECT statement.
If you want column widths more appropriate for the size of the fields you will need to include the appropriate XML, although the column widths can be altered as in Excel.

I have included the 3 names from Index_taxon_name: Actual_name, Common_name and Preferred_name. The Actual_name and Preferred_name are used to identify synonyms: if the Actual_name is not equal to the Preferred_name, this means that the Actual_name is a synonym of the Preferred_name and that the observation was entered using the synonym. If Actual_name equals Common_name it means that the observation was entered using the common name.

This XML report was developed before the ability to arrange reports in a hierarchy was introduced in version 6.9.  If it is to be used in v6.9 the CustomReport statement will need to be modified to something like:

<CustomReport title="Taxon occurrences for a 1 km square" menupath="Observations" description="Returns the observations for a specified 1 km square. Note that it does not exclude unchecked, confidential, invalid or zero abundance data.">

Sally Rankin, JNCC Recorder Approved Expert
E-mail: s.rankin@btinternet.com
Telephone: 01491 578633
Mobile: 07941 207687