mirror of
https://github.com/felt/tippecanoe.git
synced 2026-11-21 16:01:18 +01:00
--use-attribute-for-id parsed the attribute with strtoull() into a signed long long. strtoull() wraps "-1" around to ULLONG_MAX, which std::to_string() then printed back as "-1", so the round-trip check passed and the feature got the ID 18446744073709551615. The same signedness made the genuine value 18446744073709551615 print as "-1" and be rejected as too large. Store the ID as unsigned long long, and reject values that start with '-' with the same "negative feature ID" warning used for top-level IDs. Also require the value to start with a digit, so an empty string (or one with leading whitespace or '+') is reported as not a number instead of as a too-large ID. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CQ6vQTWcgZdZ5kwoNa4bxA
55 lines
4.1 KiB
JSON
55 lines
4.1 KiB
JSON
{ "type": "FeatureCollection", "properties": {
|
|
"antimeridian_adjusted_bounds": "1.000000,1.000000,18.000000,1.000000",
|
|
"bounds": "1.000000,1.000000,18.000000,1.000000",
|
|
"center": "1.000000,1.000000,0",
|
|
"description": "tests/stringid/out/-z0.json.check.mbtiles",
|
|
"format": "pbf",
|
|
"generator_options": "./tippecanoe -q -a@ -f -o tests/stringid/out/-z0.json.check.mbtiles -z0 tests/stringid/in.json",
|
|
"json": "{\"vector_layers\":[{\"id\":\"in\",\"description\":\"\",\"minzoom\":0,\"maxzoom\":0,\"fields\":{\"something\":\"Boolean\",\"special\":\"Mixed\",\"yes\":\"String\"}}],\"tilestats\":{\"layerCount\":1,\"layers\":[{\"layer\":\"in\",\"count\":18,\"geometry\":\"Point\",\"attributeCount\":3,\"attributes\":[{\"attribute\":\"something\",\"count\":1,\"type\":\"boolean\",\"values\":[false]},{\"attribute\":\"special\",\"count\":11,\"type\":\"mixed\",\"values\":[\"\",\"-1\",-1,\"0\",0,\"01005\",18446744073709551615,\"27\",27,27.5,9.823748927348929e+55],\"min\":-1,\"max\":9.823748927348929e+55},{\"attribute\":\"yes\",\"count\":1,\"type\":\"string\",\"values\":[\"no\"]}]}]}}",
|
|
"maxzoom": "0",
|
|
"minzoom": "0",
|
|
"name": "tests/stringid/out/-z0.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", "id": 12345, "properties": { }, "geometry": { "type": "Point", "coordinates": [ 0.966797, 0.966751 ] } }
|
|
,
|
|
{ "type": "Feature", "properties": { }, "geometry": { "type": "Point", "coordinates": [ 2.021484, 0.966751 ] } }
|
|
,
|
|
{ "type": "Feature", "properties": { }, "geometry": { "type": "Point", "coordinates": [ 2.988281, 0.966751 ] } }
|
|
,
|
|
{ "type": "Feature", "properties": { }, "geometry": { "type": "Point", "coordinates": [ 4.042969, 0.966751 ] } }
|
|
,
|
|
{ "type": "Feature", "properties": { }, "geometry": { "type": "Point", "coordinates": [ 5.009766, 0.966751 ] } }
|
|
,
|
|
{ "type": "Feature", "properties": { }, "geometry": { "type": "Point", "coordinates": [ 5.976562, 0.966751 ] } }
|
|
,
|
|
{ "type": "Feature", "id": 1234, "properties": { "yes": "no", "special": 27, "something": false }, "geometry": { "type": "Point", "coordinates": [ 7.031250, 0.966751 ] } }
|
|
,
|
|
{ "type": "Feature", "id": 1234, "properties": { "yes": "no", "special": "27", "something": false }, "geometry": { "type": "Point", "coordinates": [ 7.998047, 0.966751 ] } }
|
|
,
|
|
{ "type": "Feature", "id": 1234, "properties": { "yes": "no", "special": 27.5, "something": false }, "geometry": { "type": "Point", "coordinates": [ 8.964844, 0.966751 ] } }
|
|
,
|
|
{ "type": "Feature", "id": 1234, "properties": { "yes": "no", "special": 9.823748927348929e+55, "something": false }, "geometry": { "type": "Point", "coordinates": [ 10.019531, 0.966751 ] } }
|
|
,
|
|
{ "type": "Feature", "properties": { "yes": "no", "special": 27, "something": false }, "geometry": { "type": "Point", "coordinates": [ 10.986328, 0.966751 ] } }
|
|
,
|
|
{ "type": "Feature", "properties": { "yes": "no", "special": "01005", "something": false }, "geometry": { "type": "Point", "coordinates": [ 12.041016, 0.966751 ] } }
|
|
,
|
|
{ "type": "Feature", "properties": { "yes": "no", "special": 0, "something": false }, "geometry": { "type": "Point", "coordinates": [ 13.007812, 0.966751 ] } }
|
|
,
|
|
{ "type": "Feature", "properties": { "yes": "no", "special": "0", "something": false }, "geometry": { "type": "Point", "coordinates": [ 13.974609, 0.966751 ] } }
|
|
,
|
|
{ "type": "Feature", "properties": { "yes": "no", "special": -1, "something": false }, "geometry": { "type": "Point", "coordinates": [ 15.029297, 0.966751 ] } }
|
|
,
|
|
{ "type": "Feature", "properties": { "yes": "no", "special": "-1", "something": false }, "geometry": { "type": "Point", "coordinates": [ 15.996094, 0.966751 ] } }
|
|
,
|
|
{ "type": "Feature", "properties": { "yes": "no", "special": "", "something": false }, "geometry": { "type": "Point", "coordinates": [ 16.962891, 0.966751 ] } }
|
|
,
|
|
{ "type": "Feature", "properties": { "yes": "no", "special": 18446744073709551615, "something": false }, "geometry": { "type": "Point", "coordinates": [ 18.017578, 0.966751 ] } }
|
|
] }
|
|
] }
|
|
] }
|