Skip to content

Commit

Permalink
Optimise sqlite inserts (#598)
Browse files Browse the repository at this point in the history
  • Loading branch information
systemed authored Dec 1, 2023
1 parent 1c2037f commit 1da4be9
Show file tree
Hide file tree
Showing 6 changed files with 619 additions and 488 deletions.
7 changes: 4 additions & 3 deletions include/mbtiles.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,19 @@
*/
class MBTiles {
sqlite::database db;
std::vector<sqlite::database_binder> preparedStatements;
std::mutex m;
bool inTransaction;

public:
MBTiles();
virtual ~MBTiles();
void openForWriting(std::string *filename);
void openForWriting(std::string &filename);
void writeMetadata(std::string key, std::string value);
void saveTile(int zoom, int x, int y, std::string *data);
void saveTile(int zoom, int x, int y, std::string *data, bool isMerge);
void closeForWriting();

void openForReading(std::string *filename);
void openForReading(std::string &filename);
void readBoundingBox(double &minLon, double &maxLon, double &minLat, double &maxLat);
void readTileList(std::vector<std::tuple<int,int,int>> &tileList);
std::vector<char> readTile(int zoom, int col, int row);
Expand Down
Loading

0 comments on commit 1da4be9

Please sign in to comment.