Select to view content in your preferred language

PointCloudLayer not showing in WPF

580
4
06-03-2022 06:35 AM
francoisfaucher
Emerging Contributor

I am using ArcGISRuntime WPF 100.13.0.

I am trying to import a scene layer package (.slpk) that I created in ArcGis Pro from a LAS file.

Everything load, no error message. The scene move to the extend of the layer but nothing show up.

Here is the code I use (mostly taken from the exemple appart that I'm am trying to load a local file.)

SceneMapView is my scene create in xaml.

 

private const string ElevationServiceUrl = "https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer";
async void loadPointCloud()
{
// Create a surface and add the elevation service to it.

Surface groundSurface = new Surface();
groundSurface.ElevationSources.Add(new ArcGISTiledElevationSource(new Uri(ElevationServiceUrl)));

// Add the surface to the scene.
SceneMapView.Scene.BaseSurface = groundSurface;

string pointCloudPath = "D:\\LAS\\Run2_1_right.slpk";
PointCloudLayer test = new PointCloudLayer(new Uri(pointCloudPath));
SceneMapView.Scene.OperationalLayers.Add(test);
await test.LoadAsync();
await SceneMapView.SetViewpointAsync(new Viewpoint(test.FullExtent));
}

Tags (1)
0 Kudos
4 Replies
MichaelBranscomb
Esri Frequent Contributor

When you say there are no error messages, I see that you await the LoadAsync (and hopefully you have a try/catch around that too), but are you also handling the SceneView.LayerViewStateChanged event?

For reference see https://developers.arcgis.com/net/api-reference/api/netwin/wpf/Esri.ArcGISRuntime.UI.Controls.GeoVie...

0 Kudos
francoisfaucher
Emerging Contributor

Adding try catch doesn't change anything. I am not handling that event. Can it change anything to the behavior of loading the layer ?

0 Kudos
MichaelBranscomb
Esri Frequent Contributor

LayerViewStateChanged reports status/warnings/errors once the layer is added to the view (it doesn't change the behavior of loading the layer, which is unrelated to the view).

For reference see https://developers.arcgis.com/net/api-reference/api/netwin/Esri.ArcGISRuntime/Esri.ArcGISRuntime.Map...

 

0 Kudos
francoisfaucher
Emerging Contributor

The issues was the projection that needed to be ESPG4326 (the one from my scene by default). I recreated the slpk and it now works.

Thats for the help.

0 Kudos