digiKam
DigikamGenericINatPlugin Namespace Reference

Classes

class  ComputerVisionScore
 
class  INatBrowserDlg
 
class  INatPlugin
 
class  INatTalker
 
class  INatWidget
 
class  INatWindow
 
class  SuggestTaxonCompletion
 
class  Taxon
 
class  TaxonEdit
 

Typedefs

typedef QPair< QString, QList< Taxon > > AutoCompletions
 
typedef QPair< QString, QList< ComputerVisionScore > > ImageScores
 
typedef QPair< QString, QString > Parameter
 

Enumerations

enum  { ITEM_PHOTO_IDX = 0 , ITEM_NAME_IDX = 1 }
 
enum  {
  INAT_API_TOKEN_EXPIRATION = 86000 , GEOLOCATION_PRECISION = 8 , RADIUS_PRECISION = 6 , EARTH_RADIUS_KM = 6371 ,
  TIMEOUT_TIMER_RESOLUTION_SECS = 30 , RESPONSE_TIMEOUT_SECS = 300 , MAX_RETRIES = 5
}
 
enum  { MAX_OBSERVATION_PHOTOS = 20 , MAX_DIMENSION = 2048 , MAX_EDITED_PLACES = 5 }
 

Functions

double distanceBetween (double latitude1, double longitude1, double latitude2, double longitude2)
 
QHttpMultiPart * getMultiPart (const QList< Parameter > &parameters, const QString &imageName, const QString &imageNameArg, const QString &imagePath)
 
QString localizedDistance (double distMeters, char format, int precision)
 
QString localizedLocation (double latitude, double longitude, int precision)
 
QString localizedTaxonomicRank (const QString &rank)
 
QString localizedTimeDifference (quint64 diffSeconds)
 

Variables

const bool isEnglish
 
const DItemsListView::ColumnType ItemDate = DItemsListView::ColumnType::User1
 
const DItemsListView::ColumnType ItemLocation = DItemsListView::ColumnType::User2
 
const QLocale locale = QLocale()
 
const double meterInFeet = 3.28084
 
const double meterInMiles = 0.00062137
 

Typedef Documentation

◆ AutoCompletions

◆ ImageScores

◆ Parameter

typedef QPair<QString, QString> DigikamGenericINatPlugin::Parameter

multi-part message, used to upload pictures

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
ITEM_PHOTO_IDX 
ITEM_NAME_IDX 

◆ anonymous enum

anonymous enum
Enumerator
INAT_API_TOKEN_EXPIRATION 

api tokens are valid for 24 hours

GEOLOCATION_PRECISION 

digits after decimal point

RADIUS_PRECISION 

digits after decimal point

EARTH_RADIUS_KM 

Earth radius in kilometers.

TIMEOUT_TIMER_RESOLUTION_SECS 

timeout check every 30 seconds

RESPONSE_TIMEOUT_SECS 

network timeout after this many seconds

MAX_RETRIES 

retry network requests this many times

◆ anonymous enum

anonymous enum

iNaturalist.org allows up to 20 photos for each observation and scales down photos to 2048 pixels.

Enumerator
MAX_OBSERVATION_PHOTOS 
MAX_DIMENSION 
MAX_EDITED_PLACES 

Function Documentation

◆ distanceBetween()

double DigikamGenericINatPlugin::distanceBetween ( double  latitude1,
double  longitude1,
double  latitude2,
double  longitude2 
)

returns distance in meters between two coordinates, Haversine formula

distance in meters between two geolocations

◆ getMultiPart()

QHttpMultiPart * DigikamGenericINatPlugin::getMultiPart ( const QList< Parameter > &  parameters,
const QString &  imageName,
const QString &  imageNameArg,
const QString &  imagePath 
)

◆ localizedDistance()

QString DigikamGenericINatPlugin::localizedDistance ( double  distMeters,
char  format,
int  precision 
)

distance in local language; for US returns feet or miles instead of meters

References locale, meterInFeet, and meterInMiles.

◆ localizedLocation()

QString DigikamGenericINatPlugin::localizedLocation ( double  latitude,
double  longitude,
int  precision 
)

geolocation in local language

References locale.

◆ localizedTaxonomicRank()

QString DigikamGenericINatPlugin::localizedTaxonomicRank ( const QString &  rank)

taxonomic rank (e.g. kingdom, order, genus, species) in local language

Referenced by DigikamGenericINatPlugin::Taxon::htmlName().

◆ localizedTimeDifference()

QString DigikamGenericINatPlugin::localizedTimeDifference ( quint64  diffSeconds)

time difference (e.g. "5 hours, 7 minutes") in local language

Variable Documentation

◆ isEnglish

const bool DigikamGenericINatPlugin::isEnglish
Initial value:
= (locale.language() == QLocale::English) ||
(locale.language() == QLocale::C) ||
(locale.language() == QLocale::AnyLanguage)
const QLocale locale
Definition: inatutils.cpp:45

◆ ItemDate

const DItemsListView::ColumnType DigikamGenericINatPlugin::ItemDate = DItemsListView::ColumnType::User1

◆ ItemLocation

const DItemsListView::ColumnType DigikamGenericINatPlugin::ItemLocation = DItemsListView::ColumnType::User2

◆ locale

◆ meterInFeet

const double DigikamGenericINatPlugin::meterInFeet = 3.28084

conversion factors for the US, one meter in feet and miles

Referenced by localizedDistance().

◆ meterInMiles

const double DigikamGenericINatPlugin::meterInMiles = 0.00062137

Referenced by localizedDistance().