mirror of
https://github.com/felt/tippecanoe.git
synced 2026-10-04 17:35:42 +02:00
Serialize geometry before tags
To make it easier to skip the tags if the geometry is optimized away
This commit is contained in:
@@ -301,19 +301,6 @@ void check_range(struct index *start, struct index *end, char *metabase, unsigne
|
|||||||
|
|
||||||
char *meta = metabase + i->fpos;
|
char *meta = metabase + i->fpos;
|
||||||
|
|
||||||
int m;
|
|
||||||
deserialize_int(&meta, &m);
|
|
||||||
|
|
||||||
int i;
|
|
||||||
for (i = 0; i < m; i++) {
|
|
||||||
int t;
|
|
||||||
deserialize_int(&meta, &t);
|
|
||||||
struct pool_val *key = deserialize_string(&meta, &keys, VT_STRING);
|
|
||||||
struct pool_val *value = deserialize_string(&meta, &keys, t);
|
|
||||||
|
|
||||||
printf("%s (%d) = %s (%d)\n", key->s, key->n, value->s, value->n);
|
|
||||||
}
|
|
||||||
|
|
||||||
int t;
|
int t;
|
||||||
deserialize_int(&meta, &t);
|
deserialize_int(&meta, &t);
|
||||||
printf("(%d) ", t);
|
printf("(%d) ", t);
|
||||||
@@ -338,6 +325,19 @@ void check_range(struct index *start, struct index *end, char *metabase, unsigne
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int m;
|
||||||
|
deserialize_int(&meta, &m);
|
||||||
|
|
||||||
|
int i;
|
||||||
|
for (i = 0; i < m; i++) {
|
||||||
|
int t;
|
||||||
|
deserialize_int(&meta, &t);
|
||||||
|
struct pool_val *key = deserialize_string(&meta, &keys, VT_STRING);
|
||||||
|
struct pool_val *value = deserialize_string(&meta, &keys, t);
|
||||||
|
|
||||||
|
printf("%s (%d) = %s (%d)\n", key->s, key->n, value->s, value->n);
|
||||||
|
}
|
||||||
|
|
||||||
printf("\n");
|
printf("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -446,6 +446,12 @@ void read_json(FILE *f) {
|
|||||||
{
|
{
|
||||||
long long start = fpos;
|
long long start = fpos;
|
||||||
|
|
||||||
|
unsigned bbox[] = { UINT_MAX, UINT_MAX, 0, 0 };
|
||||||
|
|
||||||
|
serialize_int(metafile, t, &fpos);
|
||||||
|
parse_geometry(t, coordinates, bbox, &fpos, metafile, VT_MOVETO);
|
||||||
|
serialize_int(metafile, VT_END, &fpos);
|
||||||
|
|
||||||
char *metakey[properties->length];
|
char *metakey[properties->length];
|
||||||
char *metaval[properties->length];
|
char *metaval[properties->length];
|
||||||
int metatype[properties->length];
|
int metatype[properties->length];
|
||||||
@@ -482,12 +488,6 @@ void read_json(FILE *f) {
|
|||||||
serialize_string(metafile, metaval[i], &fpos);
|
serialize_string(metafile, metaval[i], &fpos);
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned bbox[] = { UINT_MAX, UINT_MAX, 0, 0 };
|
|
||||||
|
|
||||||
serialize_int(metafile, t, &fpos);
|
|
||||||
parse_geometry(t, coordinates, bbox, &fpos, metafile, VT_MOVETO);
|
|
||||||
serialize_int(metafile, VT_END, &fpos);
|
|
||||||
|
|
||||||
int z = 14;
|
int z = 14;
|
||||||
|
|
||||||
/* XXX do proper overlap instead of whole bounding box */
|
/* XXX do proper overlap instead of whole bounding box */
|
||||||
|
|||||||
Reference in New Issue
Block a user