Visualizing OGC 3D Tiles data on a map requires few steps:
-
Decode the data into an
ITileSet3DModel
ITileSet3DModel
ITileSet3DModel
by using theOgc3DTilesModelDecoder
Ogc3DTilesModelDecoder
Ogc3DTilesModelDecoder
. -
Use a
TileSet3DLayer
TileSet3DLayer
TileSet3DLayer
to visualize the model. -
Optionally, adjust the layer settings to provide a better viewing experience.
Decoding and visualizing the data
// First create the model for the OGC 3D Tile data
auto tileSet3DModel = Ogc3DTilesModelDecoder::decode(source);
if (!tileSet3DModel) {
openMessageBox(tileSet3DModel.error().getMessage());
return nullptr;
}
// Create a layer for the model using the layer builder
auto tileSet3DLayer = TileSet3DLayer::newBuilder().model(*tileSet3DModel).build();
// Add the layer to the map
map.getLayerList()->add(tileSet3DLayer);
try
{
// First create the model for the OGC 3D Tile data
var tileSet3DModel = Ogc3DTilesModelDecoder.Decode(source);
// Create a layer for the model using the layer builder
var tileSet3DLayer = TileSet3DLayer.NewBuilder().Model(tileSet3DModel).Build();
// Add the layer to the map
map.LayerList.Add(tileSet3DLayer);
return tileSet3DLayer;
}
catch (Exception e)
{
MessageBox.Show($"Could not load data [{source}]: {e.Message}");
return null;
}
// First create the model for the OGC 3D Tile data
val tileSet3DModel = Ogc3DTilesModelDecoder.decode(source)
// Create a layer for the model using the layer builder
val tileSet3DLayer = TileSet3DLayer.newBuilder()
.model(tileSet3DModel)
.build()
// Add the layer to the map
map.layerList.add(tileSet3DLayer)
Adjusting layer settings
Quality factor
Each dataset is configured by default to load a given number of tiles at a certain detail level. Sometimes, that default configuration doesn’t offer the best loading experience. If the dataset tries to load too many tiles, it causes longer wait times. If it loads too few tiles, the result may be low visual fidelity.
You can change the loading experience by adjusting the quality factor
quality factor
quality factor
of the TileSet3DLayer
TileSet3DLayer
TileSet3DLayer
. A quality factor of 1.0 loads the number of tiles set by the dataset itself.
To load more tiles, set a higher quality factor. To load fewer tiles, choose a lower quality factor.
Fading time
As the camera moves, new tiles are loaded to provide more details of areas closer to the camera. The new tiles sometimes replace
previously loaded tiles.
It’s more visually pleasing if this change doesn’t happen instantaneously, and the previous tiles fade out while the new ones
fade in.
To adjust the visual transition, use the fading time
fading time
fading time
of the TileSet3DLayer
TileSet3DLayer
TileSet3DLayer
. By default, the fading time is 200 ms.
Mesh style
By setting the mesh style, you can choose how to style the mesh data in your layer. Using style expressions, you can set the color, displacement, and visibility of your meshes. You can also set the type of facet culling that you prefer. If the layer doesn’t have mesh data, LuciadCPillar ignores this setting.
See Styling mesh data for more information.
Point cloud style
By setting the point cloud style, you can choose how to style the point cloud data in your layer. Using style expressions, you can set the color, scale, and visibility of your points. You can also decide to scale the points according to the pixel size or the world size. If the layer doesn’t have point cloud data, LuciadCPillar ignores this setting.
See Styling and filtering point clouds for more information.