elapid icon indicating copy to clipboard operation
elapid copied to clipboard

Add a function to retrieve GBIF species and convert formats.

Open osgeokr opened this issue 2 years ago • 0 comments

My suggestion is to utilize the GBIF API to directly use the SDM (Species Distribution Model) of elapid. By searching for the desired species and downloading it as a CSV or converting it to the GeoPackage format, the elapid would become more user-friendly.

import elapid as ela

# Download GBIF Data
species_name = "Pitta nympha"
country_code = "KR"
output_file = "pitta_nympha_data.csv"
ela.utils.download_gbif_data(species_name, country_code, output_file)

# Convert Format from CSV to GeoPackage
input_csv = "pitta_nympha_data.csv"
output_gpkg = "pitta_nympha_data.gpkg"
ela.utils.csv_to_gpkg(input_csv, output_gpkg)

osgeokr avatar Aug 13 '23 14:08 osgeokr