openModeller
Version 1.5.0
|
#include <GbifOccurrences.hh>
Public Member Functions | |
GbifOccurrences (const char *url, const char *coordSystem) | |
~GbifOccurrences () | |
bool | load () |
OccurrencesPtr | getPresences (const char *groupId) |
OccurrencesPtr | getAbsences (const char *groupId) |
Public Member Functions inherited from OccurrencesReader | |
virtual | ~OccurrencesReader () |
void | printOccurrences (const std::string &msg="") |
Static Public Member Functions | |
static OccurrencesReader * | CreateOccurrencesReaderCallback (const char *source, const char *coordSystem) |
Private Member Functions | |
bool | _parseServiceInfo (const std::string *xml, ServiceInfo *info) |
bool | _retrieveRecords (GbifRecordData *data, int limit) |
Static Private Member Functions | |
static size_t | _curl_header_writer (void *ptr, size_t size, size_t nmemb, void *stream) |
static size_t | _curl_body_writer (void *ptr, size_t size, size_t nmemb, void *stream) |
static void | _startServiceInfoElement (void *data, const char *el, const char **attr) |
static void | _startSearchElement (void *data, const char *el, const char **attr) |
static void | _endSearchElement (void *data, const char *el) |
static void | _ltDataHandler (void *data, const char *value, int len) |
static void | _lgDataHandler (void *data, const char *value, int len) |
Private Attributes | |
bool | _loaded |
int | _default_limit |
int | _provider_limit |
Additional Inherited Members | |
Protected Types inherited from OccurrencesReader | |
typedef std::vector < OccurrencesPtr > | LstOccurrences |
Protected Member Functions inherited from OccurrencesReader | |
int | _addOccurrence (const char *id, const char *groupId, Coord lg, Coord lt, Scalar error, Scalar abundance, int num_attributes, Scalar *attributes) |
OccurrencesReader () | |
Protected Attributes inherited from OccurrencesReader | |
LstOccurrences | _presences |
LstOccurrences | _absences |
char * | _source |
char * | _coord_system |
Read occurrences data from the GBIF REST service.
Definition at line 65 of file GbifOccurrences.hh.
GbifOccurrences::GbifOccurrences | ( | const char * | url, |
const char * | coordSystem | ||
) |
Constructor.
url | Service URL. |
coordSystem | Default coordinate system in WKT. |
Definition at line 92 of file GbifOccurrences.cpp.
References OccurrencesReader::_coord_system, _default_limit, _loaded, and OccurrencesReader::_source.
Referenced by CreateOccurrencesReaderCallback().
GbifOccurrences::~GbifOccurrences | ( | ) |
Destructor.
Definition at line 111 of file GbifOccurrences.cpp.
|
staticprivate |
Definition at line 75 of file GbifOccurrences.cpp.
Referenced by _retrieveRecords(), and load().
|
staticprivate |
Definition at line 57 of file GbifOccurrences.cpp.
Referenced by _retrieveRecords(), and load().
|
staticprivate |
Definition at line 574 of file GbifOccurrences.cpp.
References GbifRecordData::_last_guid, GbifRecordData::_last_lg, GbifRecordData::_last_lt, and GbifRecordData::_occurrences.
Referenced by _retrieveRecords().
|
staticprivate |
Definition at line 605 of file GbifOccurrences.cpp.
References GbifRecordData::_last_lg, and GbifRecordData::_parser.
Referenced by _startSearchElement().
|
staticprivate |
Definition at line 589 of file GbifOccurrences.cpp.
References GbifRecordData::_last_lt, and GbifRecordData::_parser.
Referenced by _startSearchElement().
|
private |
Definition at line 234 of file GbifOccurrences.cpp.
References ServiceInfo::_max_records, ServiceInfo::_parser, _provider_limit, _startServiceInfoElement(), Log::error(), and Log::instance().
Referenced by load().
|
private |
Definition at line 382 of file GbifOccurrences.cpp.
References _curl_body_writer(), _curl_header_writer(), _endSearchElement(), GbifRecordData::_next, GbifRecordData::_occurrences, GbifRecordData::_parser, OccurrencesReader::_source, _startSearchElement(), Log::error(), Log::info(), and Log::instance().
Referenced by getPresences().
|
staticprivate |
Definition at line 530 of file GbifOccurrences.cpp.
References GbifRecordData::_last_guid, _lgDataHandler(), _ltDataHandler(), GbifRecordData::_next, and GbifRecordData::_parser.
Referenced by _retrieveRecords().
|
staticprivate |
Definition at line 277 of file GbifOccurrences.cpp.
References ServiceInfo::_is_gbif, ServiceInfo::_max_records, and ServiceInfo::_parser.
Referenced by _parseServiceInfo().
|
static |
Return a new instance of GbifOccurrences.
Definition at line 49 of file GbifOccurrences.cpp.
References GbifOccurrences().
Referenced by OccurrencesFactory::instance().
|
inlinevirtual |
Return the absences (abundance == 0) from a specific group.
groupId | Identifier for a group of occurrences (usually a species name). |
Reimplemented from OccurrencesReader.
Definition at line 102 of file GbifOccurrences.hh.
|
virtual |
Return the presences (abundance > 0) from a specific group.
groupId | Identifier for a group of occurrences (usually a species name). |
Reimplemented from OccurrencesReader.
Definition at line 322 of file GbifOccurrences.cpp.
References OccurrencesReader::_coord_system, _default_limit, GbifRecordData::_next, GbifRecordData::_occurrences, OccurrencesReader::_presences, _provider_limit, _retrieveRecords(), Log::info(), and Log::instance().
|
virtual |
Read occurrences from the GBIF REST service.
Implements OccurrencesReader.
Definition at line 120 of file GbifOccurrences.cpp.
References _curl_body_writer(), _curl_header_writer(), ServiceInfo::_is_gbif, _loaded, _parseServiceInfo(), OccurrencesReader::_source, Log::error(), Log::info(), and Log::instance().
|
private |
Definition at line 110 of file GbifOccurrences.hh.
Referenced by GbifOccurrences(), and getPresences().
|
private |
Definition at line 107 of file GbifOccurrences.hh.
Referenced by GbifOccurrences(), and load().
|
private |
Definition at line 113 of file GbifOccurrences.hh.
Referenced by _parseServiceInfo(), and getPresences().