Add the ability to tippecanoe-decode into EPSG:3857 instead of WGS84

This commit is contained in:
Eric Fischer
2016-06-28 15:18:27 -07:00
parent e48e2152cc
commit 5d06f01e28
8 changed files with 136 additions and 30 deletions
+12 -5
View File
@@ -165,7 +165,7 @@ void handle(std::string message, int z, unsigned x, unsigned y, int describe) {
long long wy = scale * y + (scale / extent) * py;
double lat, lon;
tile2lonlat(wx, wy, 32, &lon, &lat);
projection->unproject(wx, wy, 32, &lon, &lat);
ops.push_back(lonlat(op, lon, lat, px, py));
} else {
@@ -455,17 +455,24 @@ void decode(char *fname, int z, unsigned x, unsigned y) {
}
void usage(char **argv) {
fprintf(stderr, "Usage: %s file.mbtiles zoom x y\n", argv[0]);
fprintf(stderr, "Usage: %s [-t projection] file.mbtiles zoom x y\n", argv[0]);
exit(EXIT_FAILURE);
}
int main(int argc, char **argv) {
extern int optind;
// extern char *optarg;
extern char *optarg;
int i;
while ((i = getopt(argc, argv, "")) != -1) {
usage(argv);
while ((i = getopt(argc, argv, "t:")) != -1) {
switch (i) {
case 't':
set_projection_or_exit(optarg);
break;
default:
usage(argv);
}
}
if (argc == optind + 4) {