1

Topic: Quick species map

Hi there,

For some reason, I can't get this page to work. I setted up the geoserver as described in the docs 'http://indicia-docs.readthedocs.org/en/ … setup.html', I tried both detail_occurence and cache_occurences and pointed to the namespace:cache_occurences or namespace:detail_occurence in the form with as feature type the external key taxa_taxon_list_external_key but neither of them seems to work. It gives me a blank grid with a note No information available. What did I forget?

Dieter

2

Re: Quick species map

Hi Dieter

I'm guessing that the population of the grid is completely independent of GeoServer. Once we get something in the grid then there may still be things to fix with GeoServer.

Look in the warehouse log for the report query.

The default report selected in Drupal has the title "Record counts by taxon external key" which is in the file reports/library/taxa/occurrence_counts_summary_by_external_key.xml

Copy the query from the log in to an SQL editor window in pgAdmin and execute it there. Does it return any rows? If yes, then there is a problem with the client side getting and showing the results. If no, you have no data matching the query.

I see the query is only going to return verified records (record_status = 'V') or those recorded as certain by the observer (certainty = 'C'). You may have no such records in your cache_occurrences table... Have a look.

Jim.

3

Re: Quick species map

Strange, I checked the cache occurences table and there is a record with record_status = V but when i run the query in pgadmin it doesn't return a result.

This is the query:

SELECT cttl.external_key as external_key,
cttl.preferred_taxon as taxon,
cttl.default_common_name as common_name,
cttl.taxon_group as taxon_group,
count(*) as value
      FROM cache_occurrences o
      JOIN cache_taxa_taxon_lists cttl 
          ON cttl.external_key=o.taxa_taxon_list_external_key
          AND cttl.preferred=true
      JOIN users privacyusers ON privacyusers.id=o.created_by_id 
      

      WHERE  (o.training=false OR o.training IS NULL) AND (o.website_id in (2) OR privacyusers.allow_share_for_reporting=true OR privacyusers.allow_share_for_reporting IS NULL)
AND o.website_id in (2) 
      AND (o.zero_abundance='f')
      AND (o.record_status = 'V' 
          or ('C'='C' and o.certainty='C' and o.record_status='C')
          or ('C'='!D' and o.record_status ='C'))
      
GROUP BY cttl.external_key, cttl.preferred_taxon, cttl.default_common_name, cttl.taxon_group ORDER BY 
        count(*) desc
       LIMIT 21

4

Re: Quick species map

Great! You almost have the problem solved then.

There are two possibilities now.

One is that none of your records satisfy all of the criteria in the WHERE clause. You could have a verified record but, if it was entered in training mode (o.training=true) it would not show up. By removing the elements of the WHERE one by one until your records appear you can determine what the condition is.

The other possibility is that the joins eliminate your records. For example, if you have not entered an external key for the taxa in your taxon lists then the taxa_taxon_lists_external_key field in cache_occurrences will be null and that record will not be returned.

Jim Bacon.

5

Re: Quick species map

Thanks, I dind't had external keys for my taxa. I use mycobank numbers now since they are unique anyway. =)

6

Re: Quick species map

Well done! That was solved more easily than I expected.

I thought about the logic of the query and it must be designed to pull in records from across multiple surveys/websites with all sorts of different species lists. If you only had one species list it would be much simpler and wouldn't need to depend upon the unifying power of the external key.

We use National Biodiversity Network Taxon Version Keys in our warehouse since our focus is on recording within the British Isles. I bet there are pre-built forms / reports for exporting data in NBN format which will depend upon the NBN TVK being in the external key field. I don't know if that is a factor you need to take in to account.

Jim Bacon.

7

Re: Quick species map

Well, what I noticed is that the record count is the double of what it should be. If I have for example 2 records, in the grid it states there are 4. What could cause this?

8

Re: Quick species map

Hi Dieter,

That could be caused by the joins; for example it there are two entries in the cache_taxa_taxon_lists table which are both capable of joining on to one record in the cache occurrence table. This might arise with your query if you had two similar species lists using the same external keys.

Now that is a perfectly likely, indeed probable, situation for us where we have a shared warehouse with multiple users creating multiple overlapping species lists. This has been overcome by using a definitive master species list and filtering so that we only match against that one species list. (For this to work it does depend on all collaborating species lists to include consistent external keys. Another good reason for us to use NBN TVKs.)

Since that master species list will vary from one warehouse to another, the id of the list is supplied as a report parameter in the Drupal configuration of the page, under 'Preset parameter values'.

Our presets are

date_from=
date_to=
survey_id=
quality=C
location_id={profile_location}
taxon_groups={profile_taxon_groups}
currentUser={profile_indicia_user_id}
taxon_list_id=15

15 is the id of our master species list.

This may, of course, not be the cause of your problem at all! However it seems a likely place to look.

Jim Bacon.