BirdsCanada / NatureCountsAPI

NatureCountsAPI
0 stars 1 forks source link

SiteType filtering #21

Closed steffilazerte closed 5 years ago

steffilazerte commented 5 years ago

@pmorrill it looks like SiteType = "IBA" results in the SQL filter of SiteCode IS NOT NULL. But shouldn't that be iba_site IS NOT NULL?

For example... https://sandbox.birdscanada.org/api/data/get_data?filter={%22siteType%22:%22IBA%22,%22collection%22:%22ABATLAS1%22,%22fields%22:[%22InstitutionCode%22,%22ScientificName%22,%22StateProvince%22,%22SiteCode%22],%22bmdeVersion%22:%22minimum%22,}&lastRecord=0&numRecords=300&debug=1


@denislepage Most of the iba_site values I've come across either either a proper iba site code, or "N/A", which I don't think is a recognized NA/NULL value for either SQL or R. This will interfere with the filter (above). Can we fix that?

denislepage commented 5 years ago

Yes, the correct query should be something along those lines when SiteType=”IBA”:

select top 10 iba_site from bmde_data where collection = 'EBIRD-CA-ON' and iba_site <> 'N/A'

This will exclude both N/A and null values.

pmorrill commented 5 years ago

This has been corrected: next deployment should be tested.

denislepage commented 5 years ago

I just posted the latest changes on sandbox.

steffilazerte commented 5 years ago

Looks good!