mirror of
https://github.com/felt/tippecanoe.git
synced 2026-10-02 08:25:40 +02:00
Delete --single-precision
This commit is contained in:
@@ -417,7 +417,6 @@ be reduced to the maximum that can be used with the specified _maxzoom_.
|
|||||||
* `-pe` or `--empty-csv-columns-are-null`: Treat empty CSV columns as nulls rather than as empty strings.
|
* `-pe` or `--empty-csv-columns-are-null`: Treat empty CSV columns as nulls rather than as empty strings.
|
||||||
* `-aI` or `--convert-stringified-ids-to-numbers`: If a feature ID is the string representation of a number, convert it to a plain number to use as the feature ID.
|
* `-aI` or `--convert-stringified-ids-to-numbers`: If a feature ID is the string representation of a number, convert it to a plain number to use as the feature ID.
|
||||||
* `--use-attribute-for-id=`*name*: Use the attribute with the specified *name* as if it were specified as the feature ID. (If this attribute is a stringified number, you must also use `-aI` to convert it to a number.)
|
* `--use-attribute-for-id=`*name*: Use the attribute with the specified *name* as if it were specified as the feature ID. (If this attribute is a stringified number, you must also use `-aI` to convert it to a number.)
|
||||||
* `-pN` or `--single-precision`: Write double-precision numeric attribute values to tiles as single-precision to reduce tile size.
|
|
||||||
|
|
||||||
### Filtering features by attributes
|
### Filtering features by attributes
|
||||||
|
|
||||||
|
|||||||
@@ -3014,7 +3014,6 @@ int main(int argc, char **argv) {
|
|||||||
{"empty-csv-columns-are-null", no_argument, &prevent[P_EMPTY_CSV_COLUMNS], 1},
|
{"empty-csv-columns-are-null", no_argument, &prevent[P_EMPTY_CSV_COLUMNS], 1},
|
||||||
{"convert-stringified-ids-to-numbers", no_argument, &additional[A_CONVERT_NUMERIC_IDS], 1},
|
{"convert-stringified-ids-to-numbers", no_argument, &additional[A_CONVERT_NUMERIC_IDS], 1},
|
||||||
{"use-attribute-for-id", required_argument, 0, '~'},
|
{"use-attribute-for-id", required_argument, 0, '~'},
|
||||||
{"single-precision", no_argument, &prevent[P_SINGLE_PRECISION], 1},
|
|
||||||
{"set-attribute", required_argument, 0, '~'},
|
{"set-attribute", required_argument, 0, '~'},
|
||||||
|
|
||||||
{"Filtering features by attributes", 0, 0, 0},
|
{"Filtering features by attributes", 0, 0, 0},
|
||||||
|
|||||||
@@ -520,8 +520,6 @@ The attributes and values may also be specified as JSON keys and values: \fB\fC\
|
|||||||
\fB\fC\-aI\fR or \fB\fC\-\-convert\-stringified\-ids\-to\-numbers\fR: If a feature ID is the string representation of a number, convert it to a plain number to use as the feature ID.
|
\fB\fC\-aI\fR or \fB\fC\-\-convert\-stringified\-ids\-to\-numbers\fR: If a feature ID is the string representation of a number, convert it to a plain number to use as the feature ID.
|
||||||
.IP \(bu 2
|
.IP \(bu 2
|
||||||
\fB\fC\-\-use\-attribute\-for\-id=\fR\fIname\fP: Use the attribute with the specified \fIname\fP as if it were specified as the feature ID. (If this attribute is a stringified number, you must also use \fB\fC\-aI\fR to convert it to a number.)
|
\fB\fC\-\-use\-attribute\-for\-id=\fR\fIname\fP: Use the attribute with the specified \fIname\fP as if it were specified as the feature ID. (If this attribute is a stringified number, you must also use \fB\fC\-aI\fR to convert it to a number.)
|
||||||
.IP \(bu 2
|
|
||||||
\fB\fC\-pN\fR or \fB\fC\-\-single\-precision\fR: Write double\-precision numeric attribute values to tiles as single\-precision to reduce tile size.
|
|
||||||
.RE
|
.RE
|
||||||
.SS Filtering features by attributes
|
.SS Filtering features by attributes
|
||||||
.RS
|
.RS
|
||||||
|
|||||||
@@ -29,7 +29,6 @@
|
|||||||
#define P_SIMPLIFY ((int) 's')
|
#define P_SIMPLIFY ((int) 's')
|
||||||
#define P_SIMPLIFY_LOW ((int) 'S')
|
#define P_SIMPLIFY_LOW ((int) 'S')
|
||||||
#define P_SIMPLIFY_SHARED_NODES ((int) 'n')
|
#define P_SIMPLIFY_SHARED_NODES ((int) 'n')
|
||||||
#define P_SINGLE_PRECISION ((int) 'N')
|
|
||||||
#define P_FEATURE_LIMIT ((int) 'f')
|
#define P_FEATURE_LIMIT ((int) 'f')
|
||||||
#define P_KILOBYTE_LIMIT ((int) 'k')
|
#define P_KILOBYTE_LIMIT ((int) 'k')
|
||||||
#define P_DYNAMIC_DROP ((int) 'd')
|
#define P_DYNAMIC_DROP ((int) 'd')
|
||||||
|
|||||||
@@ -766,15 +766,6 @@ int serialize_feature(struct serialization_state *sst, serial_feature &sf) {
|
|||||||
for (ssize_t i = (ssize_t) sf.full_keys.size() - 1; i >= 0; i--) {
|
for (ssize_t i = (ssize_t) sf.full_keys.size() - 1; i >= 0; i--) {
|
||||||
coerce_value(sf.full_keys[i], sf.full_values[i].type, sf.full_values[i].s, sst->attribute_types);
|
coerce_value(sf.full_keys[i], sf.full_values[i].type, sf.full_values[i].s, sst->attribute_types);
|
||||||
|
|
||||||
if (prevent[P_SINGLE_PRECISION]) {
|
|
||||||
if (sf.full_values[i].type == mvt_double) {
|
|
||||||
// don't coerce integers to floats, since that is counterproductive
|
|
||||||
if (sf.full_values[i].s.find('.') != std::string::npos) {
|
|
||||||
sf.full_values[i].s = milo::dtoa_milo((float) atof(sf.full_values[i].s.c_str()));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (sf.full_keys[i] == attribute_for_id) {
|
if (sf.full_keys[i] == attribute_for_id) {
|
||||||
if (sf.full_values[i].type != mvt_double && !additional[A_CONVERT_NUMERIC_IDS]) {
|
if (sf.full_values[i].type != mvt_double && !additional[A_CONVERT_NUMERIC_IDS]) {
|
||||||
static bool warned = false;
|
static bool warned = false;
|
||||||
|
|||||||
@@ -1,96 +0,0 @@
|
|||||||
{ "type": "FeatureCollection", "properties": {
|
|
||||||
"antimeridian_adjusted_bounds": "0.000000,0.000000,0.000000,0.000000",
|
|
||||||
"bounds": "0.000000,0.000000,0.000000,0.000000",
|
|
||||||
"center": "0.000000,0.000000,0",
|
|
||||||
"description": "tests/attribute-type/out/-z0_-pN.json.check.mbtiles",
|
|
||||||
"format": "pbf",
|
|
||||||
"generator_options": "./tippecanoe -q -a@ -f -o tests/attribute-type/out/-z0_-pN.json.check.mbtiles -z0 -pN tests/attribute-type/in.json",
|
|
||||||
"json": "{\"vector_layers\":[{\"id\":\"in\",\"description\":\"\",\"minzoom\":0,\"maxzoom\":0,\"fields\":{\"booltype\":\"Mixed\",\"expect\":\"Mixed\",\"floattype\":\"Mixed\",\"inttype\":\"Mixed\",\"stringtype\":\"Mixed\"}}],\"tilestats\":{\"layerCount\":1,\"layers\":[{\"layer\":\"in\",\"count\":39,\"geometry\":\"Point\",\"attributeCount\":5,\"attributes\":[{\"attribute\":\"booltype\",\"count\":10,\"type\":\"mixed\",\"values\":[\"\",\"0\",0,1,\"[2,3]\",\"false\",false,\"null\",true,\"yes\"],\"min\":0,\"max\":1},{\"attribute\":\"expect\",\"count\":14,\"type\":\"mixed\",\"values\":[0,\"2\",\"2.5\",3,5,5.599999904632568,6,\"[2,3]\",\"false\",false,\"null\",\"something\",\"true\",true],\"min\":0,\"max\":6},{\"attribute\":\"floattype\",\"count\":9,\"type\":\"mixed\",\"values\":[\"\",\" 3\",\"5\",5.599999904632568,\"5.6\",\"[2,3]\",false,true,\"yes\"],\"min\":5.599999904632568,\"max\":5.599999904632568},{\"attribute\":\"inttype\",\"count\":9,\"type\":\"mixed\",\"values\":[\"\",\" 3\",\"5\",5.599999904632568,\"5.6\",\"[2,3]\",false,true,\"yes\"],\"min\":5.599999904632568,\"max\":5.599999904632568},{\"attribute\":\"stringtype\",\"count\":6,\"type\":\"mixed\",\"values\":[2,2.5,\"[2,3]\",false,\"something\",true],\"min\":2,\"max\":2.5}]}]}}",
|
|
||||||
"maxzoom": "0",
|
|
||||||
"minzoom": "0",
|
|
||||||
"name": "tests/attribute-type/out/-z0_-pN.json.check.mbtiles",
|
|
||||||
"type": "overlay",
|
|
||||||
"version": "2"
|
|
||||||
}, "features": [
|
|
||||||
{ "type": "FeatureCollection", "properties": { "zoom": 0, "x": 0, "y": 0 }, "features": [
|
|
||||||
{ "type": "FeatureCollection", "properties": { "layer": "in", "version": 2, "extent": 4096 }, "features": [
|
|
||||||
{ "type": "Feature", "properties": { "expect": false }, "geometry": { "type": "Point", "coordinates": [ 0.000000, 0.000000 ] } }
|
|
||||||
,
|
|
||||||
{ "type": "Feature", "properties": { "booltype": "null", "expect": false }, "geometry": { "type": "Point", "coordinates": [ 0.000000, 0.000000 ] } }
|
|
||||||
,
|
|
||||||
{ "type": "Feature", "properties": { "booltype": "", "expect": false }, "geometry": { "type": "Point", "coordinates": [ 0.000000, 0.000000 ] } }
|
|
||||||
,
|
|
||||||
{ "type": "Feature", "properties": { "booltype": 0, "expect": false }, "geometry": { "type": "Point", "coordinates": [ 0.000000, 0.000000 ] } }
|
|
||||||
,
|
|
||||||
{ "type": "Feature", "properties": { "booltype": "0", "expect": false }, "geometry": { "type": "Point", "coordinates": [ 0.000000, 0.000000 ] } }
|
|
||||||
,
|
|
||||||
{ "type": "Feature", "properties": { "booltype": false, "expect": false }, "geometry": { "type": "Point", "coordinates": [ 0.000000, 0.000000 ] } }
|
|
||||||
,
|
|
||||||
{ "type": "Feature", "properties": { "booltype": "false", "expect": false }, "geometry": { "type": "Point", "coordinates": [ 0.000000, 0.000000 ] } }
|
|
||||||
,
|
|
||||||
{ "type": "Feature", "properties": { "booltype": true, "expect": true }, "geometry": { "type": "Point", "coordinates": [ 0.000000, 0.000000 ] } }
|
|
||||||
,
|
|
||||||
{ "type": "Feature", "properties": { "booltype": 1, "expect": true }, "geometry": { "type": "Point", "coordinates": [ 0.000000, 0.000000 ] } }
|
|
||||||
,
|
|
||||||
{ "type": "Feature", "properties": { "booltype": 0, "expect": false }, "geometry": { "type": "Point", "coordinates": [ 0.000000, 0.000000 ] } }
|
|
||||||
,
|
|
||||||
{ "type": "Feature", "properties": { "booltype": "yes", "expect": true }, "geometry": { "type": "Point", "coordinates": [ 0.000000, 0.000000 ] } }
|
|
||||||
,
|
|
||||||
{ "type": "Feature", "properties": { "booltype": "[2,3]", "expect": true }, "geometry": { "type": "Point", "coordinates": [ 0.000000, 0.000000 ] } }
|
|
||||||
,
|
|
||||||
{ "type": "Feature", "properties": { "expect": "null" }, "geometry": { "type": "Point", "coordinates": [ 0.000000, 0.000000 ] } }
|
|
||||||
,
|
|
||||||
{ "type": "Feature", "properties": { "stringtype": 2, "expect": "2" }, "geometry": { "type": "Point", "coordinates": [ 0.000000, 0.000000 ] } }
|
|
||||||
,
|
|
||||||
{ "type": "Feature", "properties": { "stringtype": 2.5, "expect": "2.5" }, "geometry": { "type": "Point", "coordinates": [ 0.000000, 0.000000 ] } }
|
|
||||||
,
|
|
||||||
{ "type": "Feature", "properties": { "stringtype": true, "expect": "true" }, "geometry": { "type": "Point", "coordinates": [ 0.000000, 0.000000 ] } }
|
|
||||||
,
|
|
||||||
{ "type": "Feature", "properties": { "stringtype": false, "expect": "false" }, "geometry": { "type": "Point", "coordinates": [ 0.000000, 0.000000 ] } }
|
|
||||||
,
|
|
||||||
{ "type": "Feature", "properties": { "stringtype": "something", "expect": "something" }, "geometry": { "type": "Point", "coordinates": [ 0.000000, 0.000000 ] } }
|
|
||||||
,
|
|
||||||
{ "type": "Feature", "properties": { "stringtype": "[2,3]", "expect": "[2,3]" }, "geometry": { "type": "Point", "coordinates": [ 0.000000, 0.000000 ] } }
|
|
||||||
,
|
|
||||||
{ "type": "Feature", "properties": { "expect": 0 }, "geometry": { "type": "Point", "coordinates": [ 0.000000, 0.000000 ] } }
|
|
||||||
,
|
|
||||||
{ "type": "Feature", "properties": { "inttype": "5", "expect": 5 }, "geometry": { "type": "Point", "coordinates": [ 0.000000, 0.000000 ] } }
|
|
||||||
,
|
|
||||||
{ "type": "Feature", "properties": { "inttype": "5.6", "expect": 6 }, "geometry": { "type": "Point", "coordinates": [ 0.000000, 0.000000 ] } }
|
|
||||||
,
|
|
||||||
{ "type": "Feature", "properties": { "inttype": 5.599999904632568, "expect": 6 }, "geometry": { "type": "Point", "coordinates": [ 0.000000, 0.000000 ] } }
|
|
||||||
,
|
|
||||||
{ "type": "Feature", "properties": { "inttype": true, "expect": 0 }, "geometry": { "type": "Point", "coordinates": [ 0.000000, 0.000000 ] } }
|
|
||||||
,
|
|
||||||
{ "type": "Feature", "properties": { "inttype": false, "expect": 0 }, "geometry": { "type": "Point", "coordinates": [ 0.000000, 0.000000 ] } }
|
|
||||||
,
|
|
||||||
{ "type": "Feature", "properties": { "inttype": "", "expect": 0 }, "geometry": { "type": "Point", "coordinates": [ 0.000000, 0.000000 ] } }
|
|
||||||
,
|
|
||||||
{ "type": "Feature", "properties": { "inttype": "yes", "expect": 0 }, "geometry": { "type": "Point", "coordinates": [ 0.000000, 0.000000 ] } }
|
|
||||||
,
|
|
||||||
{ "type": "Feature", "properties": { "inttype": " 3", "expect": 3 }, "geometry": { "type": "Point", "coordinates": [ 0.000000, 0.000000 ] } }
|
|
||||||
,
|
|
||||||
{ "type": "Feature", "properties": { "inttype": "[2,3]", "expect": 0 }, "geometry": { "type": "Point", "coordinates": [ 0.000000, 0.000000 ] } }
|
|
||||||
,
|
|
||||||
{ "type": "Feature", "properties": { "expect": 0 }, "geometry": { "type": "Point", "coordinates": [ 0.000000, 0.000000 ] } }
|
|
||||||
,
|
|
||||||
{ "type": "Feature", "properties": { "floattype": "5", "expect": 5 }, "geometry": { "type": "Point", "coordinates": [ 0.000000, 0.000000 ] } }
|
|
||||||
,
|
|
||||||
{ "type": "Feature", "properties": { "floattype": "5.6", "expect": 5.599999904632568 }, "geometry": { "type": "Point", "coordinates": [ 0.000000, 0.000000 ] } }
|
|
||||||
,
|
|
||||||
{ "type": "Feature", "properties": { "floattype": 5.599999904632568, "expect": 5.599999904632568 }, "geometry": { "type": "Point", "coordinates": [ 0.000000, 0.000000 ] } }
|
|
||||||
,
|
|
||||||
{ "type": "Feature", "properties": { "floattype": true, "expect": 0 }, "geometry": { "type": "Point", "coordinates": [ 0.000000, 0.000000 ] } }
|
|
||||||
,
|
|
||||||
{ "type": "Feature", "properties": { "floattype": false, "expect": 0 }, "geometry": { "type": "Point", "coordinates": [ 0.000000, 0.000000 ] } }
|
|
||||||
,
|
|
||||||
{ "type": "Feature", "properties": { "floattype": "", "expect": 0 }, "geometry": { "type": "Point", "coordinates": [ 0.000000, 0.000000 ] } }
|
|
||||||
,
|
|
||||||
{ "type": "Feature", "properties": { "floattype": "yes", "expect": 0 }, "geometry": { "type": "Point", "coordinates": [ 0.000000, 0.000000 ] } }
|
|
||||||
,
|
|
||||||
{ "type": "Feature", "properties": { "floattype": " 3", "expect": 3 }, "geometry": { "type": "Point", "coordinates": [ 0.000000, 0.000000 ] } }
|
|
||||||
,
|
|
||||||
{ "type": "Feature", "properties": { "floattype": "[2,3]", "expect": 0 }, "geometry": { "type": "Point", "coordinates": [ 0.000000, 0.000000 ] } }
|
|
||||||
] }
|
|
||||||
] }
|
|
||||||
] }
|
|
||||||
Reference in New Issue
Block a user