dbca-wa / tsc

Threatened Species and Communities
https://dbca-wa.github.io/tsc/
MIT License
1 stars 0 forks source link

Provide conservation status via API to WACensus #58

Open florianm opened 5 years ago

florianm commented 5 years ago

WACensus currently hosts a view of TPFL's conservation status and a local, temporary, implementation of fauna conservation. This information is disseminated to a wide variety of downstream systems, including NatureMap, PubSys (from there to FloraBase), Max (distributed to external companies) and Wildlife Licensing.

With the sunsetting of TFL, conservation status must be available to WACensus through TSC's API.

The data required is as follows:

NAME_ID | CONSV_CODE | LIST_CODE | EPBC | WA_IUCN | IUCN_CRITERIA
228 | 3 | Priority |   |   |  
297 | T | WCA_1991 | EN | VU | D1+2
436 | T | WCA_1991 | EN | EN | B1+2c
473 | 3 | Priority |   |   |  
474 | 1 | Priority |   |   |  

Only current conservation listings for scope WA are to be included. The API can be built before all data is loaded. The integration with WACensus must be ready for production before TEC goes live and TFL goes down.

If there's a conservation code, print conservation code (T/X/1..5) else if there's no conservation code but an international agreement (EPBC MI, MA or CT https://tsc.dbca.wa.gov.au/admin/conservation/conservationlist/7/change/), print "IA" else print nothing

So the levels of consv_code are:

X T IA 1 2 3 4 5

florianm commented 5 years ago

The naive implementation is o(n). Need to optimise the API list view along these lines.

florianm commented 5 years ago

Added properties to Taxon for various conservation listing attributes. /api/1/taxon/?format=csv&limit=40000 runs quite long. Approach: optimise queryset, failing that: cache lookups. Need API filters for taxonomic status.

florianm commented 5 years ago

Here's the equivalent from the Import/Export plugin: https://tsc.dbca.wa.gov.au/species/?download&is_terminal_taxon=true&current=true&conservation_level=threatened&resource_class=0&resource_format=csv