30 m_copy_tile_flag(
true)
37 m_zoom_level(obj.m_zoom_level),
38 m_tile_column(obj.m_tile_column),
39 m_tile_row(obj.m_tile_row),
40 m_tile_data(obj.m_tile_data),
41 m_copy_tile_flag(obj.m_copy_tile_flag)
66 static const char M[] =
"ossimGpkgTileRecord::init";
75 if ( nCol != EXPECTED_COLUMNS )
78 << M <<
" WARNING:\nUnexpected number of columns: " << nCol
79 <<
"Expected column count: " << EXPECTED_COLUMNS
83 if ( nCol >= EXPECTED_COLUMNS )
91 colName = sqlite3_column_name(pStmt, i);
92 type = sqlite3_column_type(pStmt, i);
96 if ( ( colName ==
"id" ) && ( type == SQLITE_INTEGER ) )
98 m_id = sqlite3_column_int(pStmt, i);
101 else if ( ( colName ==
"zoom_level" ) && ( type == SQLITE_INTEGER ) )
106 else if ( ( colName ==
"tile_column" ) && ( type == SQLITE_INTEGER ) )
111 else if ( ( colName ==
"tile_row" ) && ( type == SQLITE_INTEGER ) )
116 else if ( ( colName ==
"tile_data" ) && ( type == SQLITE_BLOB ) )
122 ossim_int32 bytes = sqlite3_column_bytes( pStmt, i );
131 sqlite3_column_blob( pStmt, i ), bytes );
138 << M <<
" Unexpected column type[" << i <<
"]: " << type << std::endl;
143 if ( columnsFound == EXPECTED_COLUMNS )
155 static bool tracedTile =
false;
156 if (
status && !tracedTile )
160 std::string file =
"debug-tile.";
177 os.open( file.c_str(), ios::out | ios::binary);
199 sql <<
"CREATE TABLE " << tableName <<
" ( " 200 <<
"id INTEGER PRIMARY KEY AUTOINCREMENT, " 201 <<
"zoom_level INTEGER NOT NULL, " 202 <<
"tile_column INTEGER NOT NULL, " 203 <<
"tile_row INTEGER NOT NULL, " 204 <<
"tile_data BLOB NOT NULL, " 205 <<
"UNIQUE (zoom_level, tile_column, tile_row) " 224 out <<
"id: " <<
m_id 228 <<
"\nsignature_block: ";
233 for (
int i = 0; i < 8; ++i )
251 return obj.
print( out );
290 static bool traced =
false;
295 for (
int i = 0; i < 8; ++i )
297 std::cout << std::hex << int(
m_tile_data[i]) <<
" ";
299 std::cout << std::dec <<
"\n";
317 result =
"image/jpeg";
322 result =
"image/png";
static bool createTable(sqlite3 *db, const std::string &tableName)
Creates table in database.
std::basic_ostringstream< char > ostringstream
Class for char output memory streams.
std::vector< ossim_uint8 > m_tile_data
std::string getTileMediaType() const
bool init(sqlite3_stmt *pStmt)
Initialize from database.
int exec(sqlite3 *db, const std::string &sql)
Preforms sqlite3_prepare_v2, sqlite3_step and sqlite3_finalize.
bool tableExists(sqlite3 *db, const std::string &tableName)
Checks for existance of table.
const ossimGpkgTileRecord & operator=(const ossimGpkgTileRecord &obj)
ossim_int32 m_tile_column
std::ostream & print(std::ostream &out) const
Print method.
std::ostream & operator<<(std::ostream &out, const ossimGpkgTileRecord &obj)
void getTileIndex(ossimIpt &index) const
Get tile index.
~ossimGpkgTileRecord()
destructor
ossimGpkgTileType getTileType() const
std::basic_ofstream< char > ofstream
Class for char output file streams.
void setCopyTileFlag(bool flag)
ossimGpkgTileRecord()
default constructor
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
std::basic_ostream< char > ostream
Base class for char output streams.