Class ObservationSearch
An ObservationSearch is a set of parameters for searching iNaturalist Observations. Usage: myINatManager.SearchObservations(myObservationSearch)
Inherited Members
Namespace: JoshAaronMiller.INaturalist
Assembly: cs.temp.dll.dll
Syntax
public class ObservationSearch : SearchObject
Fields
GeoprivacyToString
Declaration
public static Dictionary<ObservationSearch.Geoprivacy, string> GeoprivacyToString
Field Value
Type | Description |
---|---|
Dictionary<ObservationSearch.Geoprivacy, String> |
IdentAgreementToString
Declaration
public static Dictionary<ObservationSearch.IdentificationAgreement, string> IdentAgreementToString
Field Value
Type | Description |
---|---|
Dictionary<ObservationSearch.IdentificationAgreement, String> |
LicenseToString
Declaration
public static Dictionary<ObservationSearch.License, string> LicenseToString
Field Value
Type | Description |
---|---|
Dictionary<ObservationSearch.License, String> |
Methods
ApplyProjectRulesFor(Int32)
Limit the search to the project restrictions of the given project ID.
Declaration
public void ApplyProjectRulesFor(int projectId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | projectId | The project ID to base this restriction on. |
ExcludeIds(List<Int32>)
Require the search to exclude these IDs.
Declaration
public void ExcludeIds(List<int> ids)
Parameters
Type | Name | Description |
---|---|---|
List<Int32> | ids | IDs to exclude |
ExcludeProjectId(Int32)
Require the observations to be not in this project ID.
Declaration
public void ExcludeProjectId(int id)
Parameters
Type | Name | Description |
---|---|---|
Int32 | id | Project ID to exclude |
ExcludeProjectRulesFor(Int32)
Limit the search to observations that don't match the rules of the given project ID.
Declaration
public void ExcludeProjectRulesFor(int projectId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | projectId | The project ID to base this restriction on. |
ExcludeTaxonIds(List<Int32>)
Limit the search to exclude these taxa IDs and their descendents.
Declaration
public void ExcludeTaxonIds(List<int> ids)
Parameters
Type | Name | Description |
---|---|---|
List<Int32> | ids | Taxa IDs to exclude |
IncludeDays(List<Int32>)
Limit the search to observations on these days of the month.
Declaration
public void IncludeDays(List<int> days)
Parameters
Type | Name | Description |
---|---|---|
List<Int32> | days | Days to match. |
IncludeIds(List<Int32>)
Require the search to include these IDs.
Declaration
public void IncludeIds(List<int> ids)
Parameters
Type | Name | Description |
---|---|---|
List<Int32> | ids | IDs to include |
IncludeIUCNConservationStatuses(List<ObservationSearch.IucnConservationStatus>)
Limit the search to taxa with these IUCN conservation statuses. If PlaceId is also set, only consider statuses specific to those places.
Declaration
public void IncludeIUCNConservationStatuses(List<ObservationSearch.IucnConservationStatus> statuses)
Parameters
Type | Name | Description |
---|---|---|
List<ObservationSearch.IucnConservationStatus> | statuses |
IncludeMonths(List<Int32>)
Limit the search to observations on these months.
Declaration
public void IncludeMonths(List<int> months)
Parameters
Type | Name | Description |
---|---|---|
List<Int32> | months | Months to match. |
IncludePlaceIds(List<Int32>)
Require the observations to be within these place IDs.
Declaration
public void IncludePlaceIds(List<int> ids)
Parameters
Type | Name | Description |
---|---|---|
List<Int32> | ids | Place IDs to require |
IncludeProjectIds(List<Int32>)
Require the observations to be included in these project IDs.
Declaration
public void IncludeProjectIds(List<int> ids)
Parameters
Type | Name | Description |
---|---|---|
List<Int32> | ids | Project IDs to search |
IncludeTaxonGeoprivacy(List<ObservationSearch.Geoprivacy>)
Filter observations by the most conservative geoprivacy applied by a conservation status associated with one of the taxa proposed in the current identifications.
Declaration
public void IncludeTaxonGeoprivacy(List<ObservationSearch.Geoprivacy> geos)
Parameters
Type | Name | Description |
---|---|---|
List<ObservationSearch.Geoprivacy> | geos | The geoprivacy settings. |
IncludeTaxonIds(List<Int32>)
Limit the search to these taxa IDs and their descendents.
Declaration
public void IncludeTaxonIds(List<int> ids)
Parameters
Type | Name | Description |
---|---|---|
List<Int32> | ids | Taxa IDs to include |
IncludeTaxonNames(List<String>)
Limit the search to these scientific or common taxa names.
Declaration
public void IncludeTaxonNames(List<string> names)
Parameters
Type | Name | Description |
---|---|---|
List<String> | names | Taxa names to match |
IncludeTermIds()
Declaration
public void IncludeTermIds()
IncludeTermValueIds()
Declaration
public void IncludeTermValueIds()
IncludeUserIds()
Declaration
public void IncludeUserIds()
IncludeUserLogins()
Declaration
public void IncludeUserLogins()
IncludeYears(List<Int32>)
Limit the search to observations on these years.
Declaration
public void IncludeYears(List<int> years)
Parameters
Type | Name | Description |
---|---|---|
List<Int32> | years | Years to match. |
SearchOnProperties(ObservationSearch.SearchProperty, String)
Search observation properties matching the query.
Declaration
public void SearchOnProperties(ObservationSearch.SearchProperty property, string query)
Parameters
Type | Name | Description |
---|---|---|
ObservationSearch.SearchProperty | property | The search property to apply the query to. |
String | query | The search query. |
SetAccuracyMaximum(Int32, Boolean)
Limit the search to observations with a positional accuracy below this value.
Declaration
public void SetAccuracyMaximum(int max, bool canBeUnknown = false)
Parameters
Type | Name | Description |
---|---|---|
Int32 | max | The positional accuracy in meters. |
Boolean | canBeUnknown | Whether the positional accuracy can be unknown. |
SetAccuracyMinimum(Int32)
Limit the search to observations with a positional accuracy above this value.
Declaration
public void SetAccuracyMinimum(int min)
Parameters
Type | Name | Description |
---|---|---|
Int32 | min | The positional accuracy in meters. |
SetBoundingBox(Double, Double, Double, Double)
Limit the search within a bounding box specified by northeast and southwest corners given in latitude and longitude.
Declaration
public void SetBoundingBox(double nelat, double nelng, double swlat, double swlng)
Parameters
Type | Name | Description |
---|---|---|
Double | nelat | The northeast latitude. |
Double | nelng | The northeast longitude. |
Double | swlat | The southwest latitude. |
Double | swlng | The southwest longitude. |
SetBoundingCircle(Double, Double, Double)
Limit the search to a circle of [radius] kilometers around the specified latitude and longitude.
Declaration
public void SetBoundingCircle(double lat, double lng, double radius)
Parameters
Type | Name | Description |
---|---|---|
Double | lat | The latitude of the search's center. |
Double | lng | The longitude of the search's center. |
Double | radius | The radius of search in kilometers. |
SetCacheControl(Int32)
Set the Cache-Control HTTP header with this value as max-age, in seconds.This means subsequent identical requests will be cached on iNaturalist servers, and commonly within web browsers
Declaration
public void SetCacheControl(int timeToLive)
Parameters
Type | Name | Description |
---|---|---|
Int32 | timeToLive | The max-age of the request, in seconds. |
SetConservationStatusAuthority(String)
Limit the search to taxa with a conservation status from this authority. If PlaceId is also set, only consider statuses specific to those places.
Declaration
public void SetConservationStatusAuthority(string auth)
Parameters
Type | Name | Description |
---|---|---|
String | auth | The conservation status authority. |
SetConservationStatusCode(String)
Limit the search to taxa of this conservation status code. If PlaceId is also set, only consider statuses specific to those places.
Declaration
public void SetConservationStatusCode(string code)
Parameters
Type | Name | Description |
---|---|---|
String | code | The conservation status code. |
SetCreatedOnDateTimeLimits(String, String)
Limit the search to observations created within a timeframe. Both start and end dates are optional.
Declaration
public void SetCreatedOnDateTimeLimits(string start = "", string end = "")
Parameters
Type | Name | Description |
---|---|---|
String | start | The start datetime, formatted as ISO-8601 datetime format: YYYY-MM-DDTHH:MMSS.mmmZ. Limit observations to created on or after this date. |
String | end | The end datetime, formatted as ISO-8601 datetime format: YYYY-MM-DDTHH:MMSS.mmmZ. Limit observations to created on or before this date. |
SetGeoprivacy(List<ObservationSearch.Geoprivacy>)
Limit the search to observations with these geoprivacy settings.
Declaration
public void SetGeoprivacy(List<ObservationSearch.Geoprivacy> geos)
Parameters
Type | Name | Description |
---|---|---|
List<ObservationSearch.Geoprivacy> | geos |
SetIconicTaxa(List<ObservationSearch.IconicTaxon>)
Limit the search to observations with these iconic taxa.
Declaration
public void SetIconicTaxa(List<ObservationSearch.IconicTaxon> iconicTaxa)
Parameters
Type | Name | Description |
---|---|---|
List<ObservationSearch.IconicTaxon> | iconicTaxa | The iconic taxa to include. |
SetIdentificationAgreement(ObservationSearch.IdentificationAgreement)
Declaration
public void SetIdentificationAgreement(ObservationSearch.IdentificationAgreement agreement)
Parameters
Type | Name | Description |
---|---|---|
ObservationSearch.IdentificationAgreement | agreement |
SetIdentifiedByUserId(Int32)
Limit the search to observations with identifications by the user with this ID.
Declaration
public void SetIdentifiedByUserId(int userId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | userId | The user's ID to restrict the search to. |
SetLicense(ObservationSearch.License)
Require the observations returned to have this license.
Declaration
public void SetLicense(ObservationSearch.License license)
Parameters
Type | Name | Description |
---|---|---|
ObservationSearch.License | license | Required license |
SetListId()
Declaration
public void SetListId()
SetLocalePreference()
Declaration
public void SetLocalePreference()
SetObservationIdLimits(Int32, Int32)
Limit the search to observations with IDs within this range. Both min and max are optional.
Declaration
public void SetObservationIdLimits(int min = -1, int max = -1)
Parameters
Type | Name | Description |
---|---|---|
Int32 | min | Include this ID and higher. |
Int32 | max | Include this ID and lower. |
SetObservedOnDateLimits(String, String)
Limit the search to observations observed within a timeframe. Both start and end dates are optional.
Declaration
public void SetObservedOnDateLimits(string start = "", string end = "")
Parameters
Type | Name | Description |
---|---|---|
String | start | The start date, formatted as YYYY-MM-DD. Limit observations to on or after this date. |
String | end | The end date, formatted as YYYY-MM-DD. Limit observations to on or before this date. |
SetOfvDataType()
Declaration
public void SetOfvDataType()
SetOrder(OrderBy, SortOrder)
Set how the results are ordered. Defaults to created at date, descending.
Declaration
public void SetOrder(OrderBy orderBy, SortOrder sortOrder)
Parameters
Type | Name | Description |
---|---|---|
OrderBy | orderBy | The parameter to sort the order by. |
SortOrder | sortOrder | Whether to sort ascending or descending. |
SetPagination(Int32, Int32)
Set the number of search results per page and which page to receive. For example, SetPagination(50,2) would return results 51-100.
Declaration
public void SetPagination(int resultsPerPage = 30, int page = 1)
Parameters
Type | Name | Description |
---|---|---|
Int32 | resultsPerPage | How many results to return per page (default 30). |
Int32 | page | Which page of results to return (default 1). |
SetPhotoLicense(ObservationSearch.License)
Require the observations to have at least one photo with this license.
Declaration
public void SetPhotoLicense(ObservationSearch.License license)
Parameters
Type | Name | Description |
---|---|---|
ObservationSearch.License | license | Required license |
SetPreferredPlaceId()
Declaration
public void SetPreferredPlaceId()
SetQualityGrade(QualityGrade)
Limit the search to observations of this quality grade.
Declaration
public void SetQualityGrade(QualityGrade quality)
Parameters
Type | Name | Description |
---|---|---|
QualityGrade | quality | The quality grade to search for. |
SetReviewedByUser(Int32, Boolean)
Limit the search to observations that [have / have not] been reviewed by a given user.
Declaration
public void SetReviewedByUser(int userId, bool hasReviewed)
Parameters
Type | Name | Description |
---|---|---|
Int32 | userId | The user ID to consider their review. |
Boolean | hasReviewed | If true, only include observations they have reviewed. If false, only include observations they have not reviewed. |
SetSiteId()
Declaration
public void SetSiteId()
SetSoundLicense(ObservationSearch.License)
Require the observations to have at least one sound with this license.
Declaration
public void SetSoundLicense(ObservationSearch.License license)
Parameters
Type | Name | Description |
---|---|---|
ObservationSearch.License | license | Required license |
SetTaxonRank(TaxonRank)
Require the observations returned to have this taxon rank.
Declaration
public void SetTaxonRank(TaxonRank rank)
Parameters
Type | Name | Description |
---|---|---|
TaxonRank | rank | Required taxonomic rank. |
SetTaxonRankLimits(TaxonRank, TaxonRank)
Limit the search to taxa between these limits.
Declaration
public void SetTaxonRankLimits(TaxonRank lowest = TaxonRank.None, TaxonRank highest = TaxonRank.None)
Parameters
Type | Name | Description |
---|---|---|
TaxonRank | lowest | The lowest taxon rank to include in the search (include this and higher). |
TaxonRank | highest | The highest taxon rank to include in the search (include this and lower). |
SetUnobservedByUserId(Int32)
Limit the search to taxa that this user has not previously observed.
Declaration
public void SetUnobservedByUserId(int userId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | userId | The user ID to base this restriction on. |
SetUpdatedSince()
Declaration
public void SetUpdatedSince()