From 594d038ef1b4c81eba53cdbae2eeb7a0ab7bdb16 Mon Sep 17 00:00:00 2001 From: Erica Fischer Date: Fri, 26 Jan 2024 16:12:51 -0800 Subject: [PATCH] Delete --single-precision --- README.md | 1 - main.cpp | 1 - man/tippecanoe.1 | 2 - options.hpp | 1 - serial.cpp | 9 --- tests/attribute-type/out/-z0_-pN.json | 96 --------------------------- 6 files changed, 110 deletions(-) delete mode 100644 tests/attribute-type/out/-z0_-pN.json diff --git a/README.md b/README.md index bf099b23..00522766 100644 --- a/README.md +++ b/README.md @@ -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. * `-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.) - * `-pN` or `--single-precision`: Write double-precision numeric attribute values to tiles as single-precision to reduce tile size. ### Filtering features by attributes diff --git a/main.cpp b/main.cpp index 606c5c0e..5782597e 100644 --- a/main.cpp +++ b/main.cpp @@ -3014,7 +3014,6 @@ int main(int argc, char **argv) { {"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}, {"use-attribute-for-id", required_argument, 0, '~'}, - {"single-precision", no_argument, &prevent[P_SINGLE_PRECISION], 1}, {"set-attribute", required_argument, 0, '~'}, {"Filtering features by attributes", 0, 0, 0}, diff --git a/man/tippecanoe.1 b/man/tippecanoe.1 index 4b5c1fbd..1923d1ba 100644 --- a/man/tippecanoe.1 +++ b/man/tippecanoe.1 @@ -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. .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.) -.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 .SS Filtering features by attributes .RS diff --git a/options.hpp b/options.hpp index e9808c88..3798fce0 100644 --- a/options.hpp +++ b/options.hpp @@ -29,7 +29,6 @@ #define P_SIMPLIFY ((int) 's') #define P_SIMPLIFY_LOW ((int) 'S') #define P_SIMPLIFY_SHARED_NODES ((int) 'n') -#define P_SINGLE_PRECISION ((int) 'N') #define P_FEATURE_LIMIT ((int) 'f') #define P_KILOBYTE_LIMIT ((int) 'k') #define P_DYNAMIC_DROP ((int) 'd') diff --git a/serial.cpp b/serial.cpp index 551c0438..47d19948 100644 --- a/serial.cpp +++ b/serial.cpp @@ -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--) { 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_values[i].type != mvt_double && !additional[A_CONVERT_NUMERIC_IDS]) { static bool warned = false; diff --git a/tests/attribute-type/out/-z0_-pN.json b/tests/attribute-type/out/-z0_-pN.json deleted file mode 100644 index 1cacc104..00000000 --- a/tests/attribute-type/out/-z0_-pN.json +++ /dev/null @@ -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 ] } } -] } -] } -] }