2016-04-28 14:43:04 -07:00
|
|
|
struct type_and_string {
|
2016-04-28 15:11:57 -07:00
|
|
|
int type;
|
|
|
|
std::string string;
|
2016-04-28 14:43:04 -07:00
|
|
|
|
2016-04-28 15:11:57 -07:00
|
|
|
bool operator<(const type_and_string &o) const;
|
2016-04-28 14:43:04 -07:00
|
|
|
};
|
|
|
|
|
2016-08-29 14:59:28 -07:00
|
|
|
struct layermap_entry {
|
|
|
|
size_t id;
|
|
|
|
std::set<type_and_string> file_keys;
|
2016-09-19 17:53:31 -07:00
|
|
|
int minzoom;
|
|
|
|
int maxzoom;
|
2016-08-29 14:59:28 -07:00
|
|
|
|
|
|
|
layermap_entry(size_t _id) {
|
|
|
|
id = _id;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2016-01-28 14:18:31 -08:00
|
|
|
sqlite3 *mbtiles_open(char *dbname, char **argv, int forcetable);
|
2014-09-29 12:48:58 -07:00
|
|
|
|
|
|
|
void mbtiles_write_tile(sqlite3 *outdb, int z, int tx, int ty, const char *data, int size);
|
|
|
|
|
2016-08-30 14:17:28 -07:00
|
|
|
void mbtiles_write_metadata(sqlite3 *outdb, const char *fname, int minzoom, int maxzoom, double minlat, double minlon, double maxlat, double maxlon, double midlat, double midlon, int forcetable, const char *attribution, std::map<std::string, layermap_entry> const &layermap);
|
2014-09-29 12:48:58 -07:00
|
|
|
|
|
|
|
void mbtiles_close(sqlite3 *outdb, char **argv);
|
2016-05-03 11:14:09 -07:00
|
|
|
|
|
|
|
void aprintf(std::string *buf, const char *format, ...);
|