Open florianm opened 5 years ago
The naive implementation is o(n). Need to optimise the API list view along these lines.
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.
Here's the equivalent from the Import/Export plugin: https://tsc.dbca.wa.gov.au/species/?download&is_terminal_taxon=true¤t=true&conservation_level=threatened&resource_class=0&resource_format=csv
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
: WACensus Name ID.consv_code
: 1..4 for Priority 1..4, T for anything CR, EN, VUlist_code
: conservation list code for scope "state"WA_IUCN
: conservation category for scope "state" if IUCN_*IUCN_CRITERIA
: conservation criteria if IUCN_*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