mirror of
https://github.com/felt/tippecanoe.git
synced 2026-10-06 10:25:41 +02:00
Clean up meta naming a little
This commit is contained in:
@@ -79,25 +79,23 @@ void read_json(FILE *f) {
|
|||||||
json_object *coordinates = json_hash_get(geometry, "coordinates");
|
json_object *coordinates = json_hash_get(geometry, "coordinates");
|
||||||
|
|
||||||
if (properties != NULL && properties->type == JSON_HASH) {
|
if (properties != NULL && properties->type == JSON_HASH) {
|
||||||
int metasize[properties->length];
|
char *metakey[properties->length];
|
||||||
char *metaname[properties->length];
|
char *metaval[properties->length];
|
||||||
char *meta[properties->length];
|
|
||||||
int metatype[properties->length];
|
int metatype[properties->length];
|
||||||
int m = 0;
|
int m = 0;
|
||||||
|
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; i < properties->length; i++) {
|
for (i = 0; i < properties->length; i++) {
|
||||||
if (properties->keys[i]->type == JSON_STRING) {
|
if (properties->keys[i]->type == JSON_STRING) {
|
||||||
metasize[m] = metabits;
|
metakey[m] = properties->keys[i]->string;
|
||||||
metaname[m] = properties->keys[i]->string;
|
|
||||||
|
|
||||||
if (properties->values[i] != NULL && properties->values[i]->type == JSON_STRING) {
|
if (properties->values[i] != NULL && properties->values[i]->type == JSON_STRING) {
|
||||||
metatype[m] = META_STRING;
|
metatype[m] = META_STRING;
|
||||||
meta[m] = properties->values[i]->string;
|
metaval[m] = properties->values[i]->string;
|
||||||
m++;
|
m++;
|
||||||
} else if (properties->values[i] != NULL && properties->values[i]->type == JSON_NUMBER) {
|
} else if (properties->values[i] != NULL && properties->values[i]->type == JSON_NUMBER) {
|
||||||
metatype[m] = META_INTEGER;
|
metatype[m] = META_INTEGER;
|
||||||
meta[m] = properties->values[i]->string;
|
metaval[m] = properties->values[i]->string;
|
||||||
m++;
|
m++;
|
||||||
} else {
|
} else {
|
||||||
fprintf(stderr, "%d: Unsupported meta type\n", jp->line);
|
fprintf(stderr, "%d: Unsupported meta type\n", jp->line);
|
||||||
@@ -139,7 +137,7 @@ void read_json(FILE *f) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (ok) {
|
if (ok) {
|
||||||
// XXX encode(destdir, files, maxn, extra, xoff, pool, n, lat, lon, m, metasize, metaname, meta, metatype);
|
// XXX encode(destdir, files, maxn, extra, xoff, pool, n, lat, lon, m, metakey, metaval, metatype);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
fprintf(stderr, "%d: feature geometry with no coordinates\n", jp->line);
|
fprintf(stderr, "%d: feature geometry with no coordinates\n", jp->line);
|
||||||
|
|||||||
Reference in New Issue
Block a user