As MVT spec does not allow passing arrays or objects as features property, the shortcut is to pass them serialized as string, and parse it later if needed.
The problem here is when trying to use one specific element of that specific property for filtering or styling, it looks back to the original info in the tile and it will find a string. So, no way.
Adding new casts to expresions
["to-object", my_object_like_value <string>]javascript
fill-opacity:["get", "myopacity", ["to-object", ["get", "myproperty"]]]
["to-array", separator <string>, my_array_like_value <string>]javascript
fill-opacity: ["number", ["at", 23, ["to-array", ",", ["get", "myproperty"]]]]
Any movement on this? With commit #8876, it really feels as though there should be some mechanism for converting strings to arrays as there is currently no way to do this in the Mapbox Vector Tile spec. Nor is there a way in Tippecanoe to do this.
It could be possible to do this with strings, but this introduces some tricky conditions (specfically for the first or last item in the array).
Anything new on this?
A to-array would be very useful with the new slice available in 1.10.
The use case I am thinking of is storing a timeserie of data (array of numbers) as attribute in tiles from tippecanoe and then be able get the number at a specific index in that array.
If I am not wrong tippecanoe can only store the array as a string so to be able to use slice-expression on the attribute we need an array again.
Most helpful comment
Any movement on this? With commit #8876, it really feels as though there should be some mechanism for converting strings to arrays as there is currently no way to do this in the Mapbox Vector Tile spec. Nor is there a way in Tippecanoe to do this.
It could be possible to do this with strings, but this introduces some tricky conditions (specfically for the first or last item in the array).