Files
tippecanoe/tests/stringid/in.json
T
Claude e7a2c6ac49 Reject negative attribute IDs and accept the largest unsigned one
--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
2026-11-11 19:44:22 +00:00

19 lines
2.6 KiB
JSON

{ "type": "Feature", "id": 12345, "properties": {}, "geometry": { "type": "Point", "coordinates": [ 1, 1 ] } }
{ "type": "Feature", "id": "12345", "properties": {}, "geometry": { "type": "Point", "coordinates": [ 2, 1 ] } }
{ "type": "Feature", "id": "12345.6789", "properties": {}, "geometry": { "type": "Point", "coordinates": [ 3, 1 ] } }
{ "type": "Feature", "id": "9837489273489273894728943728903480989080938597489274389", "properties": {}, "geometry": { "type": "Point", "coordinates": [ 4, 1 ] } }
{ "type": "Feature", "id": 9837489273489273894728943728903480989080938597489274389, "properties": {}, "geometry": { "type": "Point", "coordinates": [ 5, 1 ] } }
{ "type": "Feature", "id": "1e5", "properties": {}, "geometry": { "type": "Point", "coordinates": [ 6, 1 ] } }
{ "type": "Feature", "id": 1234, "properties": { "yes": "no", "special": 27, "something": false }, "geometry": { "type": "Point", "coordinates": [ 7, 1 ] } }
{ "type": "Feature", "id": 1234, "properties": { "yes": "no", "special": "27", "something": false }, "geometry": { "type": "Point", "coordinates": [ 8, 1 ] } }
{ "type": "Feature", "id": 1234, "properties": { "yes": "no", "special": 27.5, "something": false }, "geometry": { "type": "Point", "coordinates": [ 9, 1 ] } }
{ "type": "Feature", "id": 1234, "properties": { "yes": "no", "special": 98237489273489274389728497289472839478297489274892734892, "something": false }, "geometry": { "type": "Point", "coordinates": [ 10, 1 ] } }
{ "type": "Feature", "properties": { "yes": "no", "special": 27, "something": false }, "geometry": { "type": "Point", "coordinates": [ 11, 1 ] } }
{ "type": "Feature", "properties": { "yes": "no", "special": "01005", "something": false }, "geometry": { "type": "Point", "coordinates": [ 12, 1 ] } }
{ "type": "Feature", "properties": { "yes": "no", "special": 0, "something": false }, "geometry": { "type": "Point", "coordinates": [ 13, 1 ] } }
{ "type": "Feature", "properties": { "yes": "no", "special": "0", "something": false }, "geometry": { "type": "Point", "coordinates": [ 14, 1 ] } }
{ "type": "Feature", "properties": { "yes": "no", "special": -1, "something": false }, "geometry": { "type": "Point", "coordinates": [ 15, 1 ] } }
{ "type": "Feature", "properties": { "yes": "no", "special": "-1", "something": false }, "geometry": { "type": "Point", "coordinates": [ 16, 1 ] } }
{ "type": "Feature", "properties": { "yes": "no", "special": "", "something": false }, "geometry": { "type": "Point", "coordinates": [ 17, 1 ] } }
{ "type": "Feature", "properties": { "yes": "no", "special": 18446744073709551615, "something": false }, "geometry": { "type": "Point", "coordinates": [ 18, 1 ] } }