mirror of
https://github.com/felt/tippecanoe.git
synced 2026-10-05 09:55:41 +02:00
Make room for a vertex count in the header of each serialized tile
This commit is contained in:
@@ -2219,6 +2219,8 @@ std::pair<int, metadata> read_input(std::vector<source> &sources, char *fname, i
|
|||||||
std::atomic<long long> geompos(0);
|
std::atomic<long long> geompos(0);
|
||||||
|
|
||||||
/* initial tile is normally 0/0/0 but can be iz/ix/iy if limited to one tile */
|
/* initial tile is normally 0/0/0 but can be iz/ix/iy if limited to one tile */
|
||||||
|
long long vertex_count = 0;
|
||||||
|
fwrite_check(&vertex_count, sizeof(vertex_count), 1, geomfile, &geompos, fname);
|
||||||
serialize_int(geomfile, iz, &geompos, fname);
|
serialize_int(geomfile, iz, &geompos, fname);
|
||||||
serialize_uint(geomfile, ix, &geompos, fname);
|
serialize_uint(geomfile, ix, &geompos, fname);
|
||||||
serialize_uint(geomfile, iy, &geompos, fname);
|
serialize_uint(geomfile, iy, &geompos, fname);
|
||||||
|
|||||||
@@ -531,6 +531,9 @@ static void rewrite(serial_feature const &osf, int z, int nextzoom, int maxzoom,
|
|||||||
if (!within[j]) {
|
if (!within[j]) {
|
||||||
within[j] = true;
|
within[j] = true;
|
||||||
start_geompos[j] = geompos[j]; // no competition between threads
|
start_geompos[j] = geompos[j]; // no competition between threads
|
||||||
|
|
||||||
|
long long vertex_count = 0;
|
||||||
|
fwrite_check(&vertex_count, sizeof(vertex_count), 1, geomfile[j]->fp, &geompos[j], fname);
|
||||||
serialize_int(geomfile[j]->fp, nextzoom, &geompos[j], fname);
|
serialize_int(geomfile[j]->fp, nextzoom, &geompos[j], fname);
|
||||||
serialize_uint(geomfile[j]->fp, tx * span + xo, &geompos[j], fname);
|
serialize_uint(geomfile[j]->fp, tx * span + xo, &geompos[j], fname);
|
||||||
serialize_uint(geomfile[j]->fp, ty * span + yo, &geompos[j], fname);
|
serialize_uint(geomfile[j]->fp, ty * span + yo, &geompos[j], fname);
|
||||||
@@ -2669,6 +2672,10 @@ void *run_thread(void *vargs) {
|
|||||||
// These z/x/y are uncompressed so we can seek to the start of the
|
// These z/x/y are uncompressed so we can seek to the start of the
|
||||||
// compressed feature data that immediately follows.
|
// compressed feature data that immediately follows.
|
||||||
|
|
||||||
|
long long vertex_count;
|
||||||
|
if (dc.fread(&vertex_count, sizeof(vertex_count), 1, &geompos) != 1) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
if (!dc.deserialize_int(&z, &geompos)) {
|
if (!dc.deserialize_int(&z, &geompos)) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user