mirror of
https://github.com/felt/tippecanoe.git
synced 2026-10-05 18:05:42 +02:00
Write out the JSON part of the metadata
This commit is contained in:
@@ -33,7 +33,7 @@ enumerate: enumerate.o
|
|||||||
decode: decode.o vector_tile.pb.o projection.o
|
decode: decode.o vector_tile.pb.o projection.o
|
||||||
g++ $(PG) $(LIBS) -O3 -g -Wall -o $@ $^ -lm -lz -lprotobuf-lite -lsqlite3
|
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
|
g++ $(PG) $(LIBS) -O3 -g -Wall -o $@ $^ -lm -lz -lprotobuf-lite -lsqlite3
|
||||||
|
|
||||||
libjsonpull.a: jsonpull.o
|
libjsonpull.a: jsonpull.o
|
||||||
|
|||||||
+11
-3
@@ -14,6 +14,7 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#include "projection.h"
|
#include "projection.h"
|
||||||
#include "pool.h"
|
#include "pool.h"
|
||||||
|
#include "mbtiles.h"
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://github.com/mapbox/mapnik-vector-tile/blob/master/src/vector_tile_compression.hpp
|
// 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(k->n);
|
||||||
outfeature->add_tags(v->n);
|
outfeature->add_tags(v->n);
|
||||||
|
|
||||||
printf("%d: %s=%s %d=%d\n", type, key, value, k->n, v->n);
|
|
||||||
free(value);
|
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);
|
int len = sqlite3_column_bytes(stmt, 3);
|
||||||
const char *s = (const char *) sqlite3_column_blob(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);
|
handle(std::string(s, len), zoom, x, y, file_keys, layernames, nlayers);
|
||||||
}
|
}
|
||||||
@@ -250,6 +249,12 @@ int main(int argc, char **argv) {
|
|||||||
usage(argv);
|
usage(argv);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (force) {
|
||||||
|
unlink(outfile);
|
||||||
|
}
|
||||||
|
|
||||||
|
sqlite3 *outdb = mbtiles_open(outfile, argv);
|
||||||
|
|
||||||
struct pool *file_keys = NULL;
|
struct pool *file_keys = NULL;
|
||||||
char **layernames = NULL;
|
char **layernames = NULL;
|
||||||
int nlayers = 0;
|
int nlayers = 0;
|
||||||
@@ -260,5 +265,8 @@ int main(int argc, char **argv) {
|
|||||||
printf("%s\n", layernames[i]);
|
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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user