mirror of
https://github.com/felt/tippecanoe.git
synced 2026-10-02 08:25:40 +02:00
Add the ability to tippecanoe-decode into EPSG:3857 instead of WGS84
This commit is contained in:
+12
-5
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user