I am working on the custom tileset.json, and I have the valid gltf files now, I want to embed the metadata to the corresponding gltf files.
Description: I am working on the powerlines network, there are many of the powerlines more than 10,000 of them. A powerline is a curved line. I want to embed the metadata to each of the gltf, so I could use the 3D style condition to dynamically apply style to it like this:
const voltageStyle = new Cesium.Cesium3DTileStyle({
color: {
conditions: [
["${Voltage} === 240", "color('yellow')"], // Show tiles where Voltage is 240 or higher
["${Voltage} > 0", "color('red')"], // Show tiles where Voltage is 240 or higher
["true", "color('blue')"], // Hide all other tiles
],
},
});
and here is the sample sandcastle example to describe the powerline loaded as tileset, I am still updating my latest one on sandcastle.
Task: The expected feature for now is:
- style with different color based on voltage
- mouse event to show info box for its corresponding data for each single powerline
Method tried: I have tried the tileset metadata method MetadataGranularities, but a grouped tileset can only apply one style to that tileset, I mean it couldn’t change a single part style inside that tileset. I successfully used this method to show corresponding metadata to the parts of the grouped tileset.
Difficulties/issue:
I had multiple tries with the gltf but still cannot figure out how to use extensions, and I followed EXT_structural_metadata/FeatureIdAttributeAndPropertyTable this when I tried. Here is one of my gltf file, it is a powerline like a curved line made of 11 cartesian points, the coordinate system is using Cesium when converting. When I created those powerline, it is grouped based on its tiles coordinate.
To be more specific, I think my issue would be assigning feature id and assigning feature id to property table.
{
"asset": {
"version": "2.0"
},
"scenes": [
{
"nodes": [0]
}
],
"nodes": [
{
"matrix": [1, 0, 0, 0, 0, 0, -1, 0, 0, 1, 0, 0, 0, 0, 0, 1],
"children": [1]
},
{
"mesh": 0
}
],
"meshes": [
{
"primitives": [
{
"mode": 3,
"attributes": {
"POSITION": 0
}
}
]
}
],
"buffers": [
{
"uri": "data:application/octet-stream;base64,JLKZwnlUUkI2QO3C0EebwuMlU0IR4erC6PmcwskbVEJIoejCPciewu81VUKlgObCvbKgwj50VkIVf+TCcrmiwsLWV0KinOLCg9ykwq1dWUJ42eDCMRynwlQJW0LgNd/C33ipwjPaXEJEst3CCPOrwuzQXkIuT9zCR4uuwkTuYEJKDdvC",
"byteLength": 132
}
],
"bufferViews": [
{
"buffer": 0,
"byteOffset": 0,
"byteLength": 132,
"target": 34962
}
],
"accessors": [
{
"bufferView": 0,
"byteOffset": 0,
"componentType": 5126,
"count": 11,
"type": "VEC3",
"max": [-76.8479318455793, 56.23268031002954, -109.52595210261643],
"min": [-87.27202824316919, 52.58249282790348, -118.62541104014963]
}
]
}
here is the data to this gltf
[
{
"Bay_Id": "173840",
"ConductorId": "514490",
"Conductor_Length": "14.537233",
"Coordinates": [
{
"longitude": 2.570975183209337,
"latitude": -0.7482747440108009,
"height": 148.9212520894381
},
{
"longitude": 2.570975237863152,
"latitude": -0.7482745243966467,
"height": 148.68407230428997
},
{
"longitude": 2.570975292516946,
"latitude": -0.7482743047824905,
"height": 148.53690032648962
},
{
"longitude": 2.5709753471707173,
"latitude": -0.7482740851683327,
"height": 148.47915607742527
},
{
"longitude": 2.570975401824467,
"latitude": -0.7482738655541729,
"height": 148.51061195803672
},
{
"longitude": 2.570975456478194,
"latitude": -0.748273645940011,
"height": 148.63139195173324
},
{
"longitude": 2.5709755111318997,
"latitude": -0.7482734263258474,
"height": 148.84197211307438
},
{
"longitude": 2.5709755657855835,
"latitude": -0.7482732067116817,
"height": 149.14318244413997
},
{
"longitude": 2.5709756204392455,
"latitude": -0.7482729870975143,
"height": 149.53621016598464
},
{
"longitude": 2.5709756750928854,
"latitude": -0.7482727674833449,
"height": 150.02260439807182
},
{
"longitude": 2.570975729746503,
"latitude": -0.7482725478691736,
"height": 150.6042822641308
}
],
"Voltage": "1245.0",
"Tile": { "x": 119168, "y": 48377, "level": 16 }
}
]
and here is the tileset.json that I loaded to the scene
{
"asset": {
"version": "1.1"
},
"geometricError": 4096,
"root": {
"boundingVolume": {
"box": [
-82.05997848510742,
114.07568359375,
54.4075870513916,
5.212047576904297,
0,
0,
0,
-4.5497283935546875,
0,
0,
0,
1.825094223022461
]
},
"geometricError": 512,
"content": {
"uri": "514490.glb"
},
"refine": "ADD"
}
}
please leave any ideas to my question or leave a correct gltf if it is possible, many thanks. If need more info regarding to this, please leave any comments as well.