mirror of
https://github.com/felt/tippecanoe.git
synced 2026-10-05 01:45:41 +02:00
Use float instead of double in tiles if the value comes out the same
This commit is contained in:
@@ -146,8 +146,15 @@ mvt_value retrieve_string(long long off, char *stringpool, int *otype) {
|
|||||||
tv.numeric_value.sint_value = v;
|
tv.numeric_value.sint_value = v;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
tv.type = mvt_double;
|
double d = atof(s);
|
||||||
tv.numeric_value.double_value = atof(s);
|
|
||||||
|
if (d == (float) d) {
|
||||||
|
tv.type = mvt_float;
|
||||||
|
tv.numeric_value.float_value = d;
|
||||||
|
} else {
|
||||||
|
tv.type = mvt_double;
|
||||||
|
tv.numeric_value.double_value = d;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else if (type == VT_BOOLEAN) {
|
} else if (type == VT_BOOLEAN) {
|
||||||
tv.type = mvt_bool;
|
tv.type = mvt_bool;
|
||||||
|
|||||||
Reference in New Issue
Block a user