ebird

package
v0.0.0-...-fe2c94f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 3, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package ebird provides helper functions for working with eBird data.

Index

Constants

View Source
const PositionalAccuracy = 1000 // meters

PositionalAccuracy is the default positional accuracy in meters that we use for eBird observations. This is intended to serve as an approximation of the radius of a typical eBird hotspot.

Variables

This section is empty.

Functions

func DownloadMLAsset

func DownloadMLAsset(mlAssetID string) (string, bool, error)

DownloadMLAsset downloads the photo or sound with the provided ML asset ID (numbers only) and returns the local filename and whether it's a photo. This file is temporary and may be deleted at any time.

Since the ML asset ID doesn't indicate whether this is a photo or sound file, we try downloading the photo file first, and if it's not there, we try downloading the sound file.

func Records

func Records(filename string) (iter.Seq[Record], error)

Types

type ObservationID

type ObservationID struct {
	// Submission ID is the eBird checklist ID, including leading "S".
	// Example: "S193523301"
	SubmissionID string

	// ScientificName examples:
	// - "Struthio camelus"
	// - "Cairina moschata (Domestic type)"
	// - "Anas platyrhynchos x rubripes"
	// - "Aythya marila/affinis"
	// - "Melanitta sp."
	ScientificName string
}

ObservationID identifies a unique eBird observation as a submission ID and eBird's scientific name. EBird's scientific names may differ from iNaturalist's taxa in various ways, notably for "slashes" and "spuhs".

func (ObservationID) String

func (o ObservationID) String() string

func (ObservationID) Valid

func (o ObservationID) Valid() bool

Valid returns whether this observation ID has all fields set.

type Record

type Record struct {
	Line               int // line in the CSV file
	SubmissionID       string
	CommonName         string
	ScientificName     string
	TaxonomicOrder     string
	Count              string // "X" or integer
	StateProvince      string
	County             string
	LocationID         string
	Location           string
	Latitude           string
	Longitude          string
	Date               string // YYYY-MM-DD
	Time               string // 07:00 AM
	Protocol           string
	DurationMin        string
	AllObsReported     string // "1" means yes
	DistanceTraveledKm string
	AreaCoveredHa      string
	NumberOfObservers  string
	BreedingCode       string
	ObservationDetails string
	ChecklistComments  string
	MLCatalogNumbers   string
}

Record contains the fields in MyEBirdData.csv records.

func (Record) ObservationID

func (r Record) ObservationID() ObservationID

func (Record) Observed

func (r Record) Observed() (time.Time, error)

Observed returns the observation time for this record. The record always includes the date but might not include the time. The date and time formats vary between users for reasons I don't understand.

func (Record) URL

func (r Record) URL() string

func (Record) URLWithSpecies

func (r Record) URLWithSpecies() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL