mirror of
https://github.com/mapbox/tippecanoe.git
synced 2025-01-22 04:18:01 +00:00
Write out the JSON part of the metadata
This commit is contained in:
parent
ed378681e4
commit
2e3f03172e
2
Makefile
2
Makefile
@ -33,7 +33,7 @@ enumerate: enumerate.o
|
||||
decode: decode.o vector_tile.pb.o projection.o
|
||||
g++ $(PG) $(LIBS) -O3 -g -Wall -o $@ $^ -lm -lz -lprotobuf-lite -lsqlite3
|
||||
|
||||
tile-join: tile-join.o vector_tile.pb.o projection.o pool.o
|
||||
tile-join: tile-join.o vector_tile.pb.o projection.o pool.o mbtiles.o
|
||||
g++ $(PG) $(LIBS) -O3 -g -Wall -o $@ $^ -lm -lz -lprotobuf-lite -lsqlite3
|
||||
|
||||
libjsonpull.a: jsonpull.o
|
||||
|
14
tile-join.cc
14
tile-join.cc
@ -14,6 +14,7 @@
|
||||
extern "C" {
|
||||
#include "projection.h"
|
||||
#include "pool.h"
|
||||
#include "mbtiles.h"
|
||||
}
|
||||
|
||||
// https://github.com/mapbox/mapnik-vector-tile/blob/master/src/vector_tile_compression.hpp
|
||||
@ -170,8 +171,6 @@ void handle(std::string message, int z, unsigned x, unsigned y, struct pool **fi
|
||||
|
||||
outfeature->add_tags(k->n);
|
||||
outfeature->add_tags(v->n);
|
||||
|
||||
printf("%d: %s=%s %d=%d\n", type, key, value, k->n, v->n);
|
||||
free(value);
|
||||
}
|
||||
}
|
||||
@ -205,7 +204,7 @@ void decode(char *fname, char *map, struct pool **file_keys, char ***layernames,
|
||||
int len = sqlite3_column_bytes(stmt, 3);
|
||||
const char *s = (const char *) sqlite3_column_blob(stmt, 3);
|
||||
|
||||
printf("found %lld/%lld/%lld\n", zoom, x, y);
|
||||
printf("%lld/%lld/%lld \r", zoom, x, y);
|
||||
|
||||
handle(std::string(s, len), zoom, x, y, file_keys, layernames, nlayers);
|
||||
}
|
||||
@ -250,6 +249,12 @@ int main(int argc, char **argv) {
|
||||
usage(argv);
|
||||
}
|
||||
|
||||
if (force) {
|
||||
unlink(outfile);
|
||||
}
|
||||
|
||||
sqlite3 *outdb = mbtiles_open(outfile, argv);
|
||||
|
||||
struct pool *file_keys = NULL;
|
||||
char **layernames = NULL;
|
||||
int nlayers = 0;
|
||||
@ -260,5 +265,8 @@ int main(int argc, char **argv) {
|
||||
printf("%s\n", layernames[i]);
|
||||
}
|
||||
|
||||
mbtiles_write_metadata(outdb, outfile, layernames, 0, 0, 0, 0, 0, 0, 0, 0, &file_keys, nlayers);
|
||||
mbtiles_close(outdb, argv);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user