Class: Phoebe::Resources::Data::Observations::Nearest::GeoSpecies
- Inherits:
-
Object
- Object
- Phoebe::Resources::Data::Observations::Nearest::GeoSpecies
- Defined in:
- lib/phoebe/resources/data/observations/nearest/geo_species.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
-
#initialize(client:) ⇒ GeoSpecies
constructor
private
A new instance of GeoSpecies.
-
#list(species_code, lat:, lng:, back: nil, dist: nil, hotspot: nil, include_provisional: nil, max_results: nil, spp_locale: nil, request_options: {}) ⇒ Array<Phoebe::Models::Data::Observation>
Find the nearest locations where a species has been seen recently.
Constructor Details
#initialize(client:) ⇒ GeoSpecies
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 GeoSpecies.
62 63 64 |
# File 'lib/phoebe/resources/data/observations/nearest/geo_species.rb', line 62 def initialize(client:) @client = client end |
Instance Method Details
#list(species_code, lat:, lng:, back: nil, dist: nil, hotspot: nil, include_provisional: nil, max_results: nil, spp_locale: nil, request_options: {}) ⇒ Array<Phoebe::Models::Data::Observation>
Find the nearest locations where a species has been seen recently. #### Notes The species code is typically a 6-letter code, e.g. barswa for Barn Swallow. You can get complete set of species code from the GET eBird Taxonomy end-point.
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/phoebe/resources/data/observations/nearest/geo_species.rb', line 43 def list(species_code, params) parsed, = Phoebe::Data::Observations::Nearest::GeoSpecieListParams.dump_request(params) query = Phoebe::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: ["data/nearest/geo/recent/%1$s", species_code], query: query.transform_keys( include_provisional: "includeProvisional", max_results: "maxResults", spp_locale: "sppLocale" ), model: Phoebe::Internal::Type::ArrayOf[Phoebe::Data::Observation], options: ) end |