Class: Phoebe::Resources::Data::Observations::Geo::Recent::Notable

Inherits:
Object
  • Object
show all
Defined in:
lib/phoebe/resources/data/observations/geo/recent/notable.rb

Overview

The data/obs end-points are used to fetch observations submitted to eBird in checklists. There are two categories of end-point: 1. Fetch observations for a specific country, region or location. 2. Fetch observations for nearby locations - up to a distance of 50km. Each end-point supports optional query parameters which allow you to filter the list of observations returned.

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Notable

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Notable.

Parameters:



59
60
61
# File 'lib/phoebe/resources/data/observations/geo/recent/notable.rb', line 59

def initialize(client:)
  @client = client
end

Instance Method Details

#list(lat:, lng:, back: nil, detail: nil, dist: nil, hotspot: nil, max_results: nil, spp_locale: nil, request_options: {}) ⇒ Array<Phoebe::Models::Data::Observation>

Get the list of notable observations (up to 30 days ago) of birds seen at locations within a radius of up to 50 kilometers, from a given set of coordinates. Notable observations can be for locally or nationally rare species or are otherwise unusual, for example over-wintering birds in a species which is normally only a summer visitor.

Parameters:

  • lat (Float)
  • lng (Float)
  • back (Integer)

    The number of days back to fetch observations.

  • detail (Symbol, Phoebe::Models::Data::Observations::Geo::Recent::NotableListParams::Detail)

    Include a subset (simple), or all (full), of the fields available.

  • dist (Integer)

    The search radius from the given position, in kilometers.

  • hotspot (Boolean)

    Only fetch observations from hotspots

  • max_results (Integer)

    Only fetch this number of observations

  • spp_locale (String)

    Use this language for species common names

  • request_options (Phoebe::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



44
45
46
47
48
49
50
51
52
53
54
# File 'lib/phoebe/resources/data/observations/geo/recent/notable.rb', line 44

def list(params)
  parsed, options = Phoebe::Data::Observations::Geo::Recent::NotableListParams.dump_request(params)
  query = Phoebe::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: "data/obs/geo/recent/notable",
    query: query.transform_keys(max_results: "maxResults", spp_locale: "sppLocale"),
    model: Phoebe::Internal::Type::ArrayOf[Phoebe::Data::Observation],
    options: options
  )
end