openModeller
Version 1.5.0
|
#include <OccurrencesReader.hh>
Public Member Functions | |
virtual | ~OccurrencesReader () |
virtual bool | load ()=0 |
virtual OccurrencesPtr | getPresences (const char *groupId) |
virtual OccurrencesPtr | getAbsences (const char *groupId) |
void | printOccurrences (const std::string &msg="") |
Protected Types | |
typedef std::vector < OccurrencesPtr > | LstOccurrences |
Protected Member Functions | |
int | _addOccurrence (const char *id, const char *groupId, Coord lg, Coord lt, Scalar error, Scalar abundance, int num_attributes, Scalar *attributes) |
OccurrencesReader () | |
Protected Attributes | |
LstOccurrences | _presences |
LstOccurrences | _absences |
char * | _source |
char * | _coord_system |
Private Member Functions | |
int | _addPresence (const char *id, const char *groupId, Coord lg, Coord lt, Scalar error, Scalar abundance, int num_attributes, Scalar *attributes) |
int | _addAbsence (const char *id, const char *groupId, Coord lg, Coord lt, Scalar error, int num_attributes, Scalar *attributes) |
Definition of OccurrencesReader class.
LICENSE INFORMATION
Copyright © 2006 INPE Copyright(c) 2003 by CRIA - Centro de Referencia em Informacao Ambiental
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details:
http://www.gnu.org/copyleft/gpl.html A common interface to occurrence readers. Implementations need to define a constructor with two const char * parameters: one receiving the source string and the other receiving the default coordinate system in WKT. This way, each instance can only be used for single source. The "load" method must also be defined and implemented in a way that, if called more than once, data will not be duplicated. Implementations must also define a static CreateOccurrencesReaderCallback method receiving the same constructor parameters and returning a valid instance.
Definition at line 47 of file OccurrencesReader.hh.
|
protected |
Definition at line 81 of file OccurrencesReader.hh.
|
inlinevirtual |
Destructor.
Definition at line 53 of file OccurrencesReader.hh.
|
inlineprotected |
Definition at line 111 of file OccurrencesReader.hh.
|
private |
Add a new absence. Each absence belongs to a group (usually a species name).
id | Occurrence unique identifier. |
groupId | Group identifier (usually a species name). |
lg | Longitude. |
lt | Latitude. |
error | Associated error. |
num_attributes | Number of extra attributes. |
attributes | Extra attributes. |
Definition at line 192 of file OccurrencesReader.cpp.
References _absences, _coord_system, and OccurrencesImpl::createOccurrence().
Referenced by _addOccurrence().
|
protected |
Add a new occurrence. Each occurrence belongs to a group (usually a species name).
id | Occurrence unique identifier. |
groupId | Group identifier (usually a species name). |
lg | Longitude. |
lt | Latitude. |
error | Associated error. |
abundance | Number of "individuals". |
num_attributes | Number of extra attributes. |
attributes | Extra attributes. |
Definition at line 137 of file OccurrencesReader.cpp.
References _addAbsence(), and _addPresence().
Referenced by DelimitedTextOccurrences::load(), and TeOccurrences::load().
|
private |
Add a new presence. Each presence belongs to a group (usually a species name).
id | Occurrence unique identifier. |
groupId | Group identifier (usually a species name). |
lg | Longitude. |
lt | Latitude. |
error | Associated error. |
abundance | Number of "individuals". |
num_attributes | Number of extra attributes. |
attributes | Extra attributes. |
Definition at line 156 of file OccurrencesReader.cpp.
References _coord_system, _presences, and OccurrencesImpl::createOccurrence().
Referenced by _addOccurrence().
|
virtual |
Return the absences (abundance == 0) from a specific group.
groupId | Identifier for a group of occurrences (usually a species name). |
Reimplemented in TapirOccurrences, and GbifOccurrences.
Definition at line 75 of file OccurrencesReader.cpp.
References _absences.
Referenced by RequestFile::_setOccurrences(), main(), and readOccurrences().
|
virtual |
Return the presences (abundance > 0) from a specific group.
groupId | Identifier for a group of occurrences (usually a species name). |
Reimplemented in TapirOccurrences, and GbifOccurrences.
Definition at line 43 of file OccurrencesReader.cpp.
References _presences.
Referenced by RequestFile::_setOccurrences(), main(), and readOccurrences().
|
pure virtual |
Try to load the driver given the source provided in the constructor.
Implemented in TapirOccurrences, GbifOccurrences, TeOccurrences, DelimitedTextOccurrences, and SerializedXmlOccurrences.
Referenced by OccurrencesFactory::create().
void OccurrencesReader::printOccurrences | ( | const std::string & | msg = "" | ) |
Print the occurrences to cout.
msg | Optional string to be printed before the occurrences. |
Definition at line 107 of file OccurrencesReader.cpp.
References _absences, and _presences.
|
protected |
Definition at line 102 of file OccurrencesReader.hh.
Referenced by _addAbsence(), getAbsences(), SerializedXmlOccurrences::load(), and printOccurrences().
|
protected |
Definition at line 108 of file OccurrencesReader.hh.
Referenced by _addAbsence(), _addPresence(), DelimitedTextOccurrences::DelimitedTextOccurrences(), GbifOccurrences::GbifOccurrences(), GbifOccurrences::getPresences(), TapirOccurrences::getPresences(), SerializedXmlOccurrences::SerializedXmlOccurrences(), TapirOccurrences::TapirOccurrences(), and TeOccurrences::TeOccurrences().
|
protected |
Definition at line 99 of file OccurrencesReader.hh.
Referenced by _addPresence(), getPresences(), GbifOccurrences::getPresences(), TapirOccurrences::getPresences(), SerializedXmlOccurrences::load(), and printOccurrences().
|
protected |
Definition at line 105 of file OccurrencesReader.hh.
Referenced by GbifOccurrences::_retrieveRecords(), TapirOccurrences::_retrieveRecords(), DelimitedTextOccurrences::DelimitedTextOccurrences(), GbifOccurrences::GbifOccurrences(), SerializedXmlOccurrences::load(), DelimitedTextOccurrences::load(), TeOccurrences::load(), GbifOccurrences::load(), TapirOccurrences::load(), SerializedXmlOccurrences::SerializedXmlOccurrences(), TapirOccurrences::TapirOccurrences(), and TeOccurrences::TeOccurrences().