Knowing what species inhabit an area is important for conservation and ecosystem management. In particular, it can help us find out how many known species are in a given area, whether each species is common or rare, and whether any species are threatened or endangered.
In this post, we will use the galah-python
, geopandas
, matplotlib
and pywaffle
packages to show you how to download a list of species within the Yass Valley in 2023, cross-reference this list with state-wide conservation status lists, and visualise the number of threatened and sensitive species in the region.
Download a list of species
There are two ways to narrow a download query to return information for a specific region:
- Using fields available in
galah-python
(downloaded from the ALA) - Using a shapefile
The method you choose depends on whether the region you wish to return species for is already within galah-python
, or whether you require a list for a more specific area defined by a shapefile.
Search for fields in galah
To find which fields and layers exist within galah-python
to help us narrow our query, we can use the search_all()
function. Let’s do a text search to find what fields contain information on “Local Government Areas”.
import galah
import geopandas as gpd
="Local Government Areas") galah.search_all(fields
id description type link
0 cl23 Local Government Areas 2012 deprecated LGA Bou... layers
1 cl959 Local Government Areas 2011 Local Government A... layers
2 cl2012 NSW Local Land Services Regions NSW Local Land... layers
3 cl10923 Local Government Areas PSMA 2018 Local Governm... layers
The field cl10923
1 appears to contain the most recent data (from 2018). We can preview what values are within the field cl10923
using show_values()
.
="cl10923") galah.show_values(field
field category
0 cl10923 BRISBANE CITY
1 cl10923 EAST GIPPSLAND SHIRE
2 cl10923 GREATER GEELONG CITY
3 cl10923 PASTORAL UNINCORPORATED AREA
4 cl10923 MORETON BAY REGIONAL
.. ... ...
555 cl10923 WAGAIT SHIRE
556 cl10923 WOORABINDA ABORIGINAL SHIRE
557 cl10923 WUJAL WUJAL ABORIGINAL SHIRE
558 cl10923 CHERBOURG ABORIGINAL SHIRE
559 cl10923 BELYUEN SHIRE
[560 rows x 2 columns]
There are lots Local Government Areas! To check that Yass Valley is included, we can do another text search for values that match “YASS VALLEY”.
="cl10923", value = "YASS VALLEY") galah.search_values(field
field category
0 cl10923 YASS VALLEY COUNCIL
Download data
Using the field
and category
above, we can now build our query. We can use atlas_species()
to return a species list, and use the filters
argument to narrow our query. To add the observation count for each species, add counts=True
.
= galah.atlas_species(
species_yass =["cl10923=YASS VALLEY COUNCIL", "year=2023"],
filters=True
counts
) species_yass
Species Species Name Scientific Name Authorship Taxon Rank Kingdom Phylum Class Order Family Genus Vernacular Name Number of records
0 https://biodiversity.org.au/afd/taxa/5291343e-... Gymnorhina tibicen (Latham, 1801) species Animalia Chordata Aves Passeriformes Artamidae Gymnorhina Australian Magpie 334
1 https://biodiversity.org.au/afd/taxa/97a59c84-... Rhipidura (Rhipidura) albiscapa Gould, 1840 species Animalia Chordata Aves Passeriformes Rhipiduridae Rhipidura Grey Fantail 253
2 https://biodiversity.org.au/afd/taxa/760401df-... Malurus (Malurus) cyaneus (Ellis, 1782) species Animalia Chordata Aves Passeriformes Maluridae Malurus Superb Fairy-wren 251
3 https://biodiversity.org.au/afd/taxa/2c33a1fd-... Cacatua (Cacatua) galerita (Latham, 1790) species Animalia Chordata Aves Psittaciformes Cacatuidae Cacatua Sulphur-crested Cockatoo 239
4 https://biodiversity.org.au/afd/taxa/5e0f496f-... Platycercus (Platycercus) elegans (Gmelin, 1788) species Animalia Chordata Aves Psittaciformes Psittacidae Platycercus Crimson Rosella 204
... ... ... ... ... ... ... ... ... ... ... ... ...
1107 https://id.biodiversity.org.au/taxon/apni/5141... Pterostylis jonesii G.N.Backh. species Plantae Charophyta Equisetopsida Asparagales Orchidaceae Pterostylis NaN 1
1108 https://id.biodiversity.org.au/taxon/apni/5141... Pterostylis multiflora (D.L.Jones) G.N.Backh. species Plantae Charophyta Equisetopsida Asparagales Orchidaceae Pterostylis Mountain Brown-tip Greenhood 1
1109 https://id.biodiversity.org.au/taxon/apni/5141... Pterostylis pedunculata R.Br. species Plantae Charophyta Equisetopsida Asparagales Orchidaceae Pterostylis Maroonhood 1
1110 https://id.biodiversity.org.au/taxon/apni/5141... Thelymitra ixioides Sw. species Plantae Charophyta Equisetopsida Asparagales Orchidaceae Thelymitra Dotted Sun Orchid 1
1111 https://id.biodiversity.org.au/taxon/ausmoss/1... Thuidiopsis sparsa (Hook.f. & Wilson) Broth. species Plantae Bryophyta Bryopsida Hypnales Thuidiaceae Thuidiopsis NaN 1
[1112 rows x 12 columns]
Download shapefile
To retrieve the spatial outline of Yass Valley, let’s download the latest Local Government Areas data from the Australian Bureau of Statistics Digital Boundary files page. Find “Local Government Areas - 2023 - Shapefile” and click “Download ZIP”. Save the zip folder in your current directory and unzip it.
We’ll use read_file()
from geopandas
to load our shapefile.
= gpd.read_file("LGA_2023_AUST_GDA2020.shp")
LGAs_2023 LGAs_2023
LGA_CODE23 LGA_NAME23 STE_CODE21 STE_NAME21 AUS_CODE21 AUS_NAME21 AREASQKM LOCI_URI21 geometry
0 10050 Albury 1 New South Wales AUS Australia 305.6386 https://linked.data.gov.au/dataset/asgsed3/LGA... POLYGON ((146.86566 -36.07292, 146.86512 -36.0...
1 10180 Armidale 1 New South Wales AUS Australia 7809.4406 https://linked.data.gov.au/dataset/asgsed3/LGA... POLYGON ((152.38816 -30.52639, 152.38812 -30.5...
2 10250 Ballina 1 New South Wales AUS Australia 484.9692 https://linked.data.gov.au/dataset/asgsed3/LGA... MULTIPOLYGON (((153.57106 -28.87381, 153.57106...
3 10300 Balranald 1 New South Wales AUS Australia 21690.7493 https://linked.data.gov.au/dataset/asgsed3/LGA... POLYGON ((143.00433 -33.78164, 143.01538 -33.7...
4 10470 Bathurst 1 New South Wales AUS Australia 3817.8645 https://linked.data.gov.au/dataset/asgsed3/LGA... POLYGON ((149.84877 -33.52784, 149.84864 -33.5...
.. ... ... ... ... ... ... ... ... ...
561 89799 Migratory - Offshore - Shipping (ACT) 8 Australian Capital Territory AUS Australia NaN https://linked.data.gov.au/dataset/asgsed3/LGA... None
562 99399 Unincorp. Other Territories 9 Other Territories AUS Australia 105.8806 https://linked.data.gov.au/dataset/asgsed3/LGA... MULTIPOLYGON (((167.94747 -29.12757, 167.94748...
563 99499 No usual address (OT) 9 Other Territories AUS Australia NaN https://linked.data.gov.au/dataset/asgsed3/LGA... None
564 99799 Migratory - Offshore - Shipping (OT) 9 Other Territories AUS Australia NaN https://linked.data.gov.au/dataset/asgsed3/LGA... None
565 ZZZZZ Outside Australia Z Outside Australia ZZZ Outside Australia NaN https://linked.data.gov.au/dataset/asgsed3/LGA... None
[566 rows x 9 columns]
Now let’s use to_crs()
to set the Coordinate Reference System (CRS) of our shapefile to EPSG:4326 (the standard used in cartography and GPS, also known as WGS84) so that it matches the projection of our data from the ALA 2.
= LGAs_2023.to_crs(4326) LGAs_2023
Next we can filter our shapefile to only Yass Valley. The column LGA_NAME23
contains area names, and we can filter our Dataframe
to only rows where LGA_NAME23
is equal to Yass Valley
. We are left with a single polygon shape of Yass Valley.
= LGAs_2023[LGAs_2023['LGA_NAME23'] == "Yass Valley"]
yass_valley "geometry"] yass_valley[
127 POLYGON ((148.58152 -34.80679, 148.58153 -34.8...
Name: geometry, dtype: geometry
Download data
Now that yass_valley
contains our LGA shape, we can build our query. We can use atlas_species()
to return a species list, passing our shape to the polygon
argument of atlas_species()
and specifying the year to filters
. To add the observation count for each species, add counts=True
.
= galah.atlas_species(
species_yass =yass_valley["geometry"][127],
polygon="year=2023",
filters=True
counts
) species_yass
Species Species Name Scientific Name Authorship Taxon Rank Kingdom Phylum Class Order Family Genus Vernacular Name Number of records
0 https://biodiversity.org.au/afd/taxa/5291343e-... Gymnorhina tibicen (Latham, 1801) species Animalia Chordata Aves Passeriformes Artamidae Gymnorhina Australian Magpie 440
1 https://biodiversity.org.au/afd/taxa/760401df-... Malurus (Malurus) cyaneus (Ellis, 1782) species Animalia Chordata Aves Passeriformes Maluridae Malurus Superb Fairy-wren 361
2 https://biodiversity.org.au/afd/taxa/2c33a1fd-... Cacatua (Cacatua) galerita (Latham, 1790) species Animalia Chordata Aves Psittaciformes Cacatuidae Cacatua Sulphur-crested Cockatoo 304
3 https://biodiversity.org.au/afd/taxa/97a59c84-... Rhipidura (Rhipidura) albiscapa Gould, 1840 species Animalia Chordata Aves Passeriformes Rhipiduridae Rhipidura Grey Fantail 296
4 https://biodiversity.org.au/afd/taxa/5e0f496f-... Platycercus (Platycercus) elegans (Gmelin, 1788) species Animalia Chordata Aves Psittaciformes Psittacidae Platycercus Crimson Rosella 258
... ... ... ... ... ... ... ... ... ... ... ... ...
1177 https://id.biodiversity.org.au/taxon/apni/5141... Pterostylis jonesii G.N.Backh. species Plantae Charophyta Equisetopsida Asparagales Orchidaceae Pterostylis NaN 1
1178 https://id.biodiversity.org.au/taxon/apni/5141... Pterostylis multiflora (D.L.Jones) G.N.Backh. species Plantae Charophyta Equisetopsida Asparagales Orchidaceae Pterostylis Mountain Brown-tip Greenhood 1
1179 https://id.biodiversity.org.au/taxon/apni/5141... Pterostylis pedunculata R.Br. species Plantae Charophyta Equisetopsida Asparagales Orchidaceae Pterostylis Maroonhood 1
1180 https://id.biodiversity.org.au/taxon/apni/5141... Thelymitra ixioides Sw. species Plantae Charophyta Equisetopsida Asparagales Orchidaceae Thelymitra Dotted Sun Orchid 1
1181 https://id.biodiversity.org.au/taxon/ausmoss/1... Thuidiopsis sparsa (Hook.f. & Wilson) Broth. species Plantae Bryophyta Bryopsida Hypnales Thuidiaceae Thuidiopsis NaN 1
[1182 rows x 12 columns]
Cross-reference with threatened and sensitive species lists
Next we will compare our Yass valley species list with several state-wide conservation status lists of threatened and sensitive species. We can retrieve lists of threatened and sensitive species in one of two ways:
- Use the lists available in the Atlas of Living Australia
- Use your own list
Both use the same method of matching species names in our Yass Valley list to species names in official conservation status lists. However, there is a slightly different workflow between using galah-python
and using an externally downloaded list. Choose from the options below to use either method.
We can use galah-python
to access lists that are available on the Atlas of Living Australia to compare to our Yass Valley species list.
Yass Valley is within the state of New South Wales, so let’s do a text search for “New South Wales” to see what state-specific lists are available.
="New South Wales") galah.search_all(lists
species_list_uid listName listType dateCreated lastUpdated lastUploaded lastMatched username fullName itemCount region category generalisation authority sdsType isAuthoritative isInvasive isThreatened looseSearch wkt
0 dr650 New South Wales : Conservation Status CONSERVATION_LIST 2015-04-04T13:00:00Z 2023-06-07T23:12:20Z 2023-06-07T23:12:20Z 2023-06-07T23:12:20Z rosemary.oconnor@csiro.au None 1026 New South Wales None None None None True False True None None
1 dr487 New South Wales Sensitive Species List SENSITIVE_LIST 2013-06-20T14:00:00Z 2023-08-30T01:54:47Z 2023-08-30T01:54:46Z 2023-08-30T01:54:46Z rosemary.oconnor@csiro.au None 203 NSW NSW OEH CONSERVATION True False False None
Two lists are returned, and both appear relevant. With the help of some additional columns returned by search_all()
—listType
, isAuthoritative
and isThreatened
—we can learn more about which list suits our needs best. Although both lists are authoritative, only one list (dr650
) contains threatened species whereas the other dr487
contains sensitive species.
="New South Wales")[["species_list_uid", "listType", "isAuthoritative", "isThreatened"]] galah.search_all(lists
species_list_uid listType isAuthoritative isThreatened
0 dr650 CONSERVATION_LIST True True
1 dr487 SENSITIVE_LIST True False
We can return only species in Yass Valley on the New South Wales Conservation Status List (dr650
) by adding the list ID species_list_uid=dr650
to filters
. Our query returns 22 species.
= galah.atlas_species(
yass_threatened =yass_valley["geometry"][127],
polygon=["year=2023", "species_list_uid=dr650"],
filters=True
counts
) yass_threatened
Species Species Name Scientific Name Authorship Taxon Rank Kingdom Phylum Class Order Family Genus Vernacular Name Number of records
0 https://biodiversity.org.au/afd/taxa/a3e5376b-... Petroica (Petroica) boodang (Lesson, 1838) species Animalia Chordata Aves Passeriformes Petroicidae Petroica Scarlet Robin 35
1 https://biodiversity.org.au/afd/taxa/6c646af8-... Callocephalon fimbriatum (Grant, 1803) species Animalia Chordata Aves Psittaciformes Cacatuidae Callocephalon Gang-gang Cockatoo 29
2 https://biodiversity.org.au/afd/taxa/6e872b58-... Stagonopleura (Stagonopleura) guttata (Shaw, 1796) species Animalia Chordata Aves Passeriformes Estrildidae Stagonopleura Diamond Firetail 20
3 https://biodiversity.org.au/afd/taxa/b47a4ecd-... Hieraaetus (Hieraaetus) morphnoides (Gould, 1841) species Animalia Chordata Aves Accipitriformes Accipitridae Hieraaetus Little Eagle 13
4 https://biodiversity.org.au/afd/taxa/8bf4b8b0-... Daphoenositta (Neositta) chrysoptera (Latham, 1801) species Animalia Chordata Aves Passeriformes Neosittidae Daphoenositta Varied Sittella 12
5 https://biodiversity.org.au/afd/taxa/fe74e658-... Petroica (Littlera) phoenicea Gould, 1837 species Animalia Chordata Aves Passeriformes Petroicidae Petroica Flame Robin 12
6 https://id.biodiversity.org.au/node/apni/2910323 Ammobium craspedioides Benth. species Plantae Charophyta Equisetopsida Asterales Asteraceae Ammobium Yass Daisy 6
7 https://biodiversity.org.au/afd/taxa/46fca72f-... Polytelis swainsonii (Desmarest, 1826) species Animalia Chordata Aves Psittaciformes Psittacidae Polytelis Superb Parrot 5
8 https://biodiversity.org.au/afd/taxa/d1c5dee0-... Ninox (Rhabdoglaux) strenua (Gould, 1838) species Animalia Chordata Aves Strigiformes Strigidae Ninox Powerful Owl 5
9 https://id.biodiversity.org.au/taxon/apni/5129... Eucalyptus radiata Sieber ex DC. species Plantae Charophyta Equisetopsida Myrtales Myrtaceae Eucalyptus Narrow-leaved Peppermint 5
10 https://biodiversity.org.au/afd/taxa/0aa4d63d-... Keyacris scurra (Rehn, 1952) species Animalia Arthropoda Insecta Orthoptera Morabidae Keyacris Key's Matchstick Grasshopper 4
11 https://biodiversity.org.au/afd/taxa/2063bf6d-... Pachycephala (Timixos) olivacea Vigors & Horsfield, 1827 species Animalia Chordata Aves Passeriformes Pachycephalidae Pachycephala Olive Whistler 3
12 https://biodiversity.org.au/afd/taxa/23c951c0-... Stictonetta naevosa (Gould, 1841) species Animalia Chordata Aves Anseriformes Anatidae Stictonetta Freckled Duck 2
13 https://biodiversity.org.au/afd/taxa/32f9229c-... Oxyura australis Gould, 1837 species Animalia Chordata Aves Anseriformes Anatidae Oxyura Blue-billed Duck 2
14 https://biodiversity.org.au/afd/taxa/c95af018-... Epthianura (Epthianura) albifrons (Jardine & Selby, 1828) species Animalia Chordata Aves Passeriformes Meliphagidae Epthianura White-fronted Chat 2
15 https://biodiversity.org.au/afd/taxa/dc420306-... Haliaeetus (Pontoaetus) leucogaster (Gmelin, 1788) species Animalia Chordata Aves Accipitriformes Accipitridae Haliaeetus White-bellied Sea-eagle 2
16 https://id.biodiversity.org.au/taxon/apni/5128... Leucochrysum albicans (A.Cunn.) Paul G.Wilson species Plantae Charophyta Equisetopsida Asterales Asteraceae Leucochrysum NaN 2
17 https://biodiversity.org.au/afd/taxa/0d74fa05-... Aprasia parapulchella Kluge, 1974 species Animalia Chordata Reptilia Squamata Pygopodidae Aprasia Pink-tailed Worm-lizard 1
18 https://biodiversity.org.au/afd/taxa/4cb195fd-... Lathamus discolor (Shaw, 1790) species Animalia Chordata Aves Psittaciformes Psittacidae Lathamus Swift Parrot 1
19 https://biodiversity.org.au/afd/taxa/5557cf29-... Litoria verreauxii (Duméril, 1853) species Animalia Chordata Amphibia Anura Hylidae Litoria Verreaux's Frog 1
20 https://biodiversity.org.au/afd/taxa/7e891f26-... Petauroides volans (Kerr, 1792) species Animalia Chordata Mammalia Diprotodontia Pseudocheiridae Petauroides Greater Glider 1
21 https://biodiversity.org.au/afd/taxa/a51dca29-... Synemon plana Walker, 1854 species Animalia Arthropoda Insecta Lepidoptera Castniidae Synemon Golden Sun Moth 1
22 https://biodiversity.org.au/afd/taxa/e9d6fbbd-... Phascolarctos cinereus (Goldfuss, 1817) species Animalia Chordata Mammalia Diprotodontia Phascolarctidae Phascolarctos Koala 1
We can do the same using the New South Wales Sensitive Species (dr487
). Our query returns 3 species.
= galah.atlas_species(
yass_sensitive =yass_valley["geometry"][127],
polygon=["year=2023", "species_list_uid=dr487"],
filters=True
counts
) yass_sensitive
Species Species Name Scientific Name Authorship Taxon Rank Kingdom Phylum Class Order Family Genus Vernacular Name Number of records
0 https://biodiversity.org.au/afd/taxa/6c646af8-... Callocephalon fimbriatum (Grant, 1803) species Animalia Chordata Aves Psittaciformes Cacatuidae Callocephalon Gang-gang Cockatoo 29
1 https://biodiversity.org.au/afd/taxa/46fca72f-... Polytelis swainsonii (Desmarest, 1826) species Animalia Chordata Aves Psittaciformes Psittacidae Polytelis Superb Parrot 5
2 https://biodiversity.org.au/afd/taxa/d1c5dee0-... Ninox (Rhabdoglaux) strenua (Gould, 1838) species Animalia Chordata Aves Strigiformes Strigidae Ninox Powerful Owl 5
We can use our own conservation status lists from an external source to compare to our Yass Valley species list.
As an example, we are using the the New South Wales Conservation Status List and the New South Wales Sensitive Species List3.
First, let’s read in both lists and see what each list looks like.
import pandas as pd
= pd.read_csv("example_TSL.csv")
threatened_list = pd.read_csv("example_SSL.csv") sensitive_list
We can use the isin()
to return the names in species_yass
that match names in threatened_list
. We return 22 species.
= species_yass[species_yass['Species Name'].isin(list(threatened_list['species name']))].reset_index(drop=True)
yass_threatened yass_threatened
Species Species Name Scientific Name Authorship Taxon Rank Kingdom Phylum Class Order Family Genus Vernacular Name Number of records
0 https://biodiversity.org.au/afd/taxa/a3e5376b-... Petroica (Petroica) boodang (Lesson, 1838) species Animalia Chordata Aves Passeriformes Petroicidae Petroica Scarlet Robin 35
1 https://biodiversity.org.au/afd/taxa/6c646af8-... Callocephalon fimbriatum (Grant, 1803) species Animalia Chordata Aves Psittaciformes Cacatuidae Callocephalon Gang-gang Cockatoo 29
2 https://biodiversity.org.au/afd/taxa/5557cf29-... Litoria verreauxii (Duméril, 1853) species Animalia Chordata Amphibia Anura Hylidae Litoria Verreaux's Frog 27
3 https://biodiversity.org.au/afd/taxa/6e872b58-... Stagonopleura (Stagonopleura) guttata (Shaw, 1796) species Animalia Chordata Aves Passeriformes Estrildidae Stagonopleura Diamond Firetail 20
4 https://biodiversity.org.au/afd/taxa/b47a4ecd-... Hieraaetus (Hieraaetus) morphnoides (Gould, 1841) species Animalia Chordata Aves Accipitriformes Accipitridae Hieraaetus Little Eagle 13
5 https://biodiversity.org.au/afd/taxa/8bf4b8b0-... Daphoenositta (Neositta) chrysoptera (Latham, 1801) species Animalia Chordata Aves Passeriformes Neosittidae Daphoenositta Varied Sittella 12
6 https://biodiversity.org.au/afd/taxa/fe74e658-... Petroica (Littlera) phoenicea Gould, 1837 species Animalia Chordata Aves Passeriformes Petroicidae Petroica Flame Robin 12
7 https://id.biodiversity.org.au/node/apni/2910323 Ammobium craspedioides Benth. species Plantae Charophyta Equisetopsida Asterales Asteraceae Ammobium Yass Daisy 6
8 https://biodiversity.org.au/afd/taxa/46fca72f-... Polytelis swainsonii (Desmarest, 1826) species Animalia Chordata Aves Psittaciformes Psittacidae Polytelis Superb Parrot 5
9 https://biodiversity.org.au/afd/taxa/d1c5dee0-... Ninox (Rhabdoglaux) strenua (Gould, 1838) species Animalia Chordata Aves Strigiformes Strigidae Ninox Powerful Owl 5
10 https://id.biodiversity.org.au/taxon/apni/5129... Eucalyptus radiata Sieber ex DC. species Plantae Charophyta Equisetopsida Myrtales Myrtaceae Eucalyptus Narrow-leaved Peppermint 5
11 https://id.biodiversity.org.au/taxon/apni/5128... Leucochrysum albicans (A.Cunn.) Paul G.Wilson species Plantae Charophyta Equisetopsida Asterales Asteraceae Leucochrysum NaN 4
12 https://biodiversity.org.au/afd/taxa/2063bf6d-... Pachycephala (Timixos) olivacea Vigors & Horsfield, 1827 species Animalia Chordata Aves Passeriformes Pachycephalidae Pachycephala Olive Whistler 3
13 https://biodiversity.org.au/afd/taxa/23c951c0-... Stictonetta naevosa (Gould, 1841) species Animalia Chordata Aves Anseriformes Anatidae Stictonetta Freckled Duck 2
14 https://biodiversity.org.au/afd/taxa/32f9229c-... Oxyura australis Gould, 1837 species Animalia Chordata Aves Anseriformes Anatidae Oxyura Blue-billed Duck 2
15 https://biodiversity.org.au/afd/taxa/c95af018-... Epthianura (Epthianura) albifrons (Jardine & Selby, 1828) species Animalia Chordata Aves Passeriformes Meliphagidae Epthianura White-fronted Chat 2
16 https://biodiversity.org.au/afd/taxa/dc420306-... Haliaeetus (Pontoaetus) leucogaster (Gmelin, 1788) species Animalia Chordata Aves Accipitriformes Accipitridae Haliaeetus White-bellied Sea-eagle 2
17 https://biodiversity.org.au/afd/taxa/0d74fa05-... Aprasia parapulchella Kluge, 1974 species Animalia Chordata Reptilia Squamata Pygopodidae Aprasia Pink-tailed Worm-lizard 1
18 https://biodiversity.org.au/afd/taxa/4cb195fd-... Lathamus discolor (Shaw, 1790) species Animalia Chordata Aves Psittaciformes Psittacidae Lathamus Swift Parrot 1
19 https://biodiversity.org.au/afd/taxa/7e891f26-... Petauroides volans (Kerr, 1792) species Animalia Chordata Mammalia Diprotodontia Pseudocheiridae Petauroides Greater Glider 1
20 https://biodiversity.org.au/afd/taxa/a51dca29-... Synemon plana Walker, 1854 species Animalia Arthropoda Insecta Lepidoptera Castniidae Synemon Golden Sun Moth 1
21 https://biodiversity.org.au/afd/taxa/e9d6fbbd-... Phascolarctos cinereus (Goldfuss, 1817) species Animalia Chordata Mammalia Diprotodontia Phascolarctidae Phascolarctos Koala 1
We can do the same with sensitive_list
, which returns 3 species.
= species_yass[species_yass['Species Name'].isin(list(sensitive_list['species name']))].reset_index(drop=True)
yass_sensitive yass_sensitive
Species Species Name Scientific Name Authorship Taxon Rank Kingdom Phylum Class Order Family Genus Vernacular Name Number of records
0 https://biodiversity.org.au/afd/taxa/6c646af8-... Callocephalon fimbriatum (Grant, 1803) species Animalia Chordata Aves Psittaciformes Cacatuidae Callocephalon Gang-gang Cockatoo 29
1 https://biodiversity.org.au/afd/taxa/46fca72f-... Polytelis swainsonii (Desmarest, 1826) species Animalia Chordata Aves Psittaciformes Psittacidae Polytelis Superb Parrot 5
2 https://biodiversity.org.au/afd/taxa/d1c5dee0-... Ninox (Rhabdoglaux) strenua (Gould, 1838) species Animalia Chordata Aves Strigiformes Strigidae Ninox Powerful Owl 5
Visualise species conservation status
One useful way to visualise the number of threatened and sensitive species in an area is using a waffle chart. Waffle charts are useful because they can show the total number of species (represented as individual square units) and proportions of different groups (represented by colours).
For example, we can visualse the number and proportion of species with different conservation status, along with a taxonomic breakdown of threatened/sensitive species 4.
Code
# add packages
import matplotlib
import matplotlib.pyplot as plt
from pywaffle import Waffle
# initialise figure
= plt.figure(figsize=(10,6))
fig 211) # Top Long Waffle Chart #211
fig.add_subplot(212) # Bottom Left Sensitive/Threatened # 223
fig.add_subplot(
# set the axes for separate plotting
= fig.axes
ax1, ax2
# # Modify existing axis and set aspect to equal
="equal")
ax1.set_aspect(aspect="equal")
ax2.set_aspect(aspect
# make sure there are unique colours for each species
= species_yass.shape[0] - (yass_sensitive.shape[0] + yass_threatened.shape[0])
remaining_species = [yass_sensitive.shape[0],yass_threatened.shape[0],remaining_species]
all_species
# add title over all plots
"Species in Yass Valley in 2023",fontsize=20)
plt.suptitle(
# add extra text
= round(float(yass_sensitive.shape[0] + yass_threatened.shape[0]) / species_yass.shape[0], 4)*100
percentage 0.56,0.44,"*1 square = 1 species",fontsize=12)
fig.text(0.56,0.22,"{}%".format(percentage),fontsize=56)
fig.text(0.56,0.18,"Threatened/Sensitive Species",fontsize=12)
fig.text(0.13,0.50,"Taxonomic Breakdown",fontsize=13)
fig.text(
# waffle chart
Waffle.make_waffle(=ax1,
ax=15,
rows=all_species,
values= ["#FFC547","#A12B58","#E1E1E1"],
colors ={
legend'labels': ["Sensitive","Threatened","Remaining"],
'loc': 'upper left',
'bbox_to_anchor': (0.23, 1.2),
'ncol': 3,
'framealpha': 0,
'fontsize': 10
}
)
# separate into birds, mammals, reptiles, plants and other
= yass_sensitive[yass_sensitive["Class"] == "Aves"].shape[0] + yass_threatened[yass_threatened["Class"] == "Aves"].shape[0]
birds = yass_sensitive[yass_sensitive["Class"] == "Mammalia"].shape[0] + yass_threatened[yass_threatened["Class"] == "Mammalia"].shape[0]
mammals = yass_sensitive[yass_sensitive["Class"] == "Reptilia"].shape[0] + yass_threatened[yass_threatened["Class"] == "Reptilia"].shape[0]
reptiles = yass_sensitive[yass_sensitive["Kingdom"] == "Plantae"].shape[0] + yass_threatened[yass_threatened["Kingdom"] == "Plantae"].shape[0]
plants = (yass_sensitive.shape[0] + yass_threatened.shape[0]) - (birds + mammals + reptiles + plants)
other
# get counts and add them to labels
= [birds,mammals,reptiles,plants,other]
group_count
# make the labels with number of unique species in label
= ["Birds","Mammals","Reptiles","Plants","Other"]
group_labels
# Make types breakdown waffle chart
Waffle.make_waffle(=ax2,
ax=5,
rows=group_count,
values= ["#68116A","#A72566","#CA3F51","#DE9568","#F2D0A6"],
colors ={
legend'labels': group_labels,
'loc': 'upper right',
'bbox_to_anchor': (1.7, 1.02),
'ncol': 1,
'framealpha': 0,
'fontsize': 10
} )
Final thoughts
We hope this post has helped you understand how to download a species list for a specific area and compare it to conservation lists. It’s also possible to compare species with other information like lists of migratory species or seasonal species.
For other Python posts, check out our beginner’s guide to map species observations or see how to map distributions of invasive species.
Expand for session info
-----
galah 0.8.2
geopandas 0.14.1
matplotlib 3.8.2
natsort 8.4.0
pandas 2.1.3
pywaffle NA
session_info 1.0.0
-----
Python 3.12.0 (tags/v3.12.0:0fb18b0, Oct 2 2023, 13:03:39) [MSC v.1935 64 bit (AMD64)]
Windows-10-10.0.19045-SP0
-----
Session information updated at 2024-02-16 12:28
Footnotes
Each spatial layer has a two letter code, along with a number to identify it. The abbreviations are as follows: *
cl
= contextual layer (i.e. boundaries of LGAs, Indigenous Protected Areas, States/Territories etc.)
*10923
= number associated with the spatial layer in the atlas↩︎Check out this post for a better explanation of what CRS is and how it affects maps.↩︎
These are the same two lists that you can access in
galah-python
, available from the Atlas of Living Australia. Keep in mind that if you use an external list, data cleaning may be required before matching species names.↩︎To create our colour palette, we used David Nichol’s website to help colours that are colour-blind friendly, the ColorHexa website create a gradient between 2 colours, and Coolors to adjust the colours & shades.↩︎