mirror of
https://github.com/felt/tippecanoe.git
synced 2026-10-05 18:05:42 +02:00
Move feature type to index so point skipping can avoid looking up geometry
Which should avoid having to page the geometry in if there is more data than will fit in memory
This commit is contained in:
@@ -381,7 +381,6 @@ void read_json(FILE *f, char *fname, char *layername, int maxzoom, int minzoom,
|
|||||||
|
|
||||||
unsigned bbox[] = { UINT_MAX, UINT_MAX, 0, 0 };
|
unsigned bbox[] = { UINT_MAX, UINT_MAX, 0, 0 };
|
||||||
|
|
||||||
serialize_int(metafile, mb_geometry[t], &fpos, fname, jp);
|
|
||||||
parse_geometry(t, coordinates, bbox, &fpos, metafile, VT_MOVETO, fname, jp);
|
parse_geometry(t, coordinates, bbox, &fpos, metafile, VT_MOVETO, fname, jp);
|
||||||
serialize_int(metafile, VT_END, &fpos, fname, jp);
|
serialize_int(metafile, VT_END, &fpos, fname, jp);
|
||||||
|
|
||||||
@@ -467,6 +466,7 @@ void read_json(FILE *f, char *fname, char *layername, int maxzoom, int minzoom,
|
|||||||
ix.index = encode(x << (32 - z), y << (32 - z));
|
ix.index = encode(x << (32 - z), y << (32 - z));
|
||||||
}
|
}
|
||||||
ix.fpos = start;
|
ix.fpos = start;
|
||||||
|
ix.type = mb_geometry[t];
|
||||||
ix.maxzoom = z;
|
ix.maxzoom = z;
|
||||||
fwrite_check(&ix, sizeof(struct index), 1, indexfile, fname, jp);
|
fwrite_check(&ix, sizeof(struct index), 1, indexfile, fname, jp);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -376,10 +376,7 @@ long long write_tile(struct index *start, struct index *end, char *metabase, uns
|
|||||||
}
|
}
|
||||||
dup.insert(std::pair<long long, int>(i->fpos, 1));
|
dup.insert(std::pair<long long, int>(i->fpos, 1));
|
||||||
|
|
||||||
int t;
|
int t = i->type;
|
||||||
char *meta = metabase + i->fpos;
|
|
||||||
deserialize_int(&meta, &t);
|
|
||||||
|
|
||||||
if (t == VT_POINT) {
|
if (t == VT_POINT) {
|
||||||
seq++;
|
seq++;
|
||||||
|
|
||||||
@@ -390,6 +387,7 @@ long long write_tile(struct index *start, struct index *end, char *metabase, uns
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
char *meta = metabase + i->fpos;
|
||||||
drawvec geom = decode_geometry(&meta, z, tx, ty, line_detail);
|
drawvec geom = decode_geometry(&meta, z, tx, ty, line_detail);
|
||||||
|
|
||||||
bool reduced = false;
|
bool reduced = false;
|
||||||
|
|||||||
@@ -19,8 +19,9 @@ struct pool_val *deserialize_string(char **f, struct pool *p, int type);
|
|||||||
|
|
||||||
struct index {
|
struct index {
|
||||||
unsigned long long index;
|
unsigned long long index;
|
||||||
long long fpos : 56;
|
long long fpos : 48;
|
||||||
int maxzoom : 8;
|
int maxzoom : 8;
|
||||||
|
int type : 8;
|
||||||
};
|
};
|
||||||
|
|
||||||
long long write_tile(struct index *start, struct index *end, char *metabase, unsigned *file_bbox, int z, unsigned x, unsigned y, int detail, int basezoom, struct pool *file_keys, char *layername, sqlite3 *outdb, double droprate, int buffer);
|
long long write_tile(struct index *start, struct index *end, char *metabase, unsigned *file_bbox, int z, unsigned x, unsigned y, int detail, int basezoom, struct pool *file_keys, char *layername, sqlite3 *outdb, double droprate, int buffer);
|
||||||
|
|||||||
Reference in New Issue
Block a user