38 #include <TeDatabase.h>
53 #define strcasecmp _stricmp
116 if ( !
_db->isConnected() ) {
118 Log::instance()->
error(
"TeOccurrences::load - Cannot connect to database: %s.",
_db->errorMessage().c_str() );
133 TeTable speciesTable;
137 TeAttrTableVector attr;
138 layer->getAttrTables(attr);
139 speciesTable = attr[0];
153 string tablePoints = layer->tableName(TePOINTS);
162 string object_id = speciesTable.linkName();
166 sql+=
" = " + tablePoints +
".object_id";
169 TeDatabasePortal* portal =
_db->getPortal();
170 if ( !portal || !portal->query(sql) ) {
181 int num_attributes = 0;
187 while ( portal->fetchRow() ) {
190 sp = portal->getData(2);
195 _addOccurrence( Te2String(sequence).c_str(), sp.c_str(), lg, lt,
error, abundance, num_attributes, attributes );
TeStringParser * _te_str_parser
double Scalar
Type of map values.
static Log * instance()
Returns the instance pointer, creating the object on the first call.
int _addOccurrence(const char *id, const char *groupId, Coord lg, Coord lt, Scalar error, Scalar abundance, int num_attributes, Scalar *attributes)
TeOccurrences(const char *source, const char *coordSystem)
void error(const char *format,...)
'Error' level.
string columnName_
Column Name (Species)
bool parse()
Parser the url.
TeDatabase * create(const TeDatabaseFactoryParams ¶ms)
Return a TeDatabase pointer if it exists or create a new one.
static OccurrencesReader * CreateOccurrencesReaderCallback(const char *source, const char *coordSystem)
static TeDatabaseManager & instance()
Singleton pattern.
string str_
Terralib string.
string tableName_
Table Name (Species)
double Coord
Type of map coordinates.
string layerName_
Layer in Database.