mirror of
https://github.com/felt/tippecanoe.git
synced 2026-10-02 08:25:40 +02:00
Better error message if the output tileset already exists
This commit is contained in:
@@ -1,3 +1,7 @@
|
|||||||
|
## 1.32.8
|
||||||
|
|
||||||
|
* Better error message if the output tileset already exists
|
||||||
|
|
||||||
## 1.32.7
|
## 1.32.7
|
||||||
|
|
||||||
* Point features may now be coalesced into MultiPoint features with --coalesce.
|
* Point features may now be coalesced into MultiPoint features with --coalesce.
|
||||||
|
|||||||
+3
-2
@@ -62,7 +62,7 @@ static bool pbfname(const char *s) {
|
|||||||
return strcmp(s, ".pbf") == 0;
|
return strcmp(s, ".pbf") == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void check_dir(const char *dir, bool force, bool forcetable) {
|
void check_dir(const char *dir, char **argv, bool force, bool forcetable) {
|
||||||
struct stat st;
|
struct stat st;
|
||||||
|
|
||||||
mkdir(dir, S_IRWXU | S_IRWXG | S_IRWXO);
|
mkdir(dir, S_IRWXU | S_IRWXG | S_IRWXO);
|
||||||
@@ -71,7 +71,8 @@ void check_dir(const char *dir, bool force, bool forcetable) {
|
|||||||
unlink(meta.c_str()); // error OK since it may not exist;
|
unlink(meta.c_str()); // error OK since it may not exist;
|
||||||
} else {
|
} else {
|
||||||
if (stat(meta.c_str(), &st) == 0) {
|
if (stat(meta.c_str(), &st) == 0) {
|
||||||
fprintf(stderr, "%s: file exists\n", meta.c_str());
|
fprintf(stderr, "%s: Tileset \"%s\" already exists. You can use --force if you want to delete the old tileset.\n", argv[0], dir);
|
||||||
|
fprintf(stderr, "%s: %s: file exists\n", argv[0], meta.c_str());
|
||||||
if (!forcetable) {
|
if (!forcetable) {
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
void dir_write_tile(const char *outdir, int z, int tx, int ty, std::string const &pbf);
|
void dir_write_tile(const char *outdir, int z, int tx, int ty, std::string const &pbf);
|
||||||
|
|
||||||
void check_dir(const char *d, bool force, bool forcetable);
|
void check_dir(const char *d, char **argv, bool force, bool forcetable);
|
||||||
|
|
||||||
struct zxy {
|
struct zxy {
|
||||||
long long z;
|
long long z;
|
||||||
|
|||||||
@@ -3130,7 +3130,7 @@ int main(int argc, char **argv) {
|
|||||||
outdb = mbtiles_open(out_mbtiles, argv, forcetable);
|
outdb = mbtiles_open(out_mbtiles, argv, forcetable);
|
||||||
}
|
}
|
||||||
if (out_dir != NULL) {
|
if (out_dir != NULL) {
|
||||||
check_dir(out_dir, force, forcetable);
|
check_dir(out_dir, argv, force, forcetable);
|
||||||
}
|
}
|
||||||
|
|
||||||
int ret = EXIT_SUCCESS;
|
int ret = EXIT_SUCCESS;
|
||||||
|
|||||||
+2
-1
@@ -45,7 +45,8 @@ sqlite3 *mbtiles_open(char *dbname, char **argv, int forcetable) {
|
|||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
if (sqlite3_exec(outdb, "CREATE TABLE metadata (name text, value text);", NULL, NULL, &err) != SQLITE_OK) {
|
if (sqlite3_exec(outdb, "CREATE TABLE metadata (name text, value text);", NULL, NULL, &err) != SQLITE_OK) {
|
||||||
fprintf(stderr, "%s: create metadata table: %s\n", argv[0], err);
|
fprintf(stderr, "%s: Tileset \"%s\" already exists. You can use --force if you want to delete the old tileset.\n", argv[0], dbname);
|
||||||
|
fprintf(stderr, "%s: %s\n", argv[0], err);
|
||||||
if (!forcetable) {
|
if (!forcetable) {
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -1049,7 +1049,7 @@ int main(int argc, char **argv) {
|
|||||||
outdb = mbtiles_open(out_mbtiles, argv, 0);
|
outdb = mbtiles_open(out_mbtiles, argv, 0);
|
||||||
}
|
}
|
||||||
if (out_dir != NULL) {
|
if (out_dir != NULL) {
|
||||||
check_dir(out_dir, force, false);
|
check_dir(out_dir, argv, force, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct stats st;
|
struct stats st;
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
#ifndef VERSION_HPP
|
#ifndef VERSION_HPP
|
||||||
#define VERSION_HPP
|
#define VERSION_HPP
|
||||||
|
|
||||||
#define VERSION "v1.32.7"
|
#define VERSION "v1.32.8"
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user