Select to view content in your preferred language

How do I create a new scene without an elevation source?

1250
2
Jump to solution
06-14-2021 03:45 PM
KyleBPerri
Emerging Contributor

Given when creating a scene, we cannot remove the ‘Ground’ elevation surface, how can we create a new scene without an elevation source?  While we can change the default behavior through the project settings, we cannot change project settings through code. (It seems you can change custom settings only)

Tags (3)
0 Kudos
2 Solutions

Accepted Solutions
CharlesMacleod
Esri Regular Contributor

yes, u are right. thanks for this requirement. we will add this to the public api

meanwhile, u can delete ground after the scene has been created using map.GetGroundElevationSurface() followed by map.RemoveElevationSurface(ground)

View solution in original post

0 Kudos
NarelleChedzey
Esri Contributor

A followup, 

 

map.RemoveElevationSurface will throw an InvalidOperationException if you try to remove the ground surface.   

The following code should be used to remove the elevation sources from the ground surface.

var ges = map.GetGroundElevationSurface();
ges.BaseSources = null;

map.SetElevationSurface(ges);

  

View solution in original post

0 Kudos
2 Replies
CharlesMacleod
Esri Regular Contributor

yes, u are right. thanks for this requirement. we will add this to the public api

meanwhile, u can delete ground after the scene has been created using map.GetGroundElevationSurface() followed by map.RemoveElevationSurface(ground)

0 Kudos
NarelleChedzey
Esri Contributor

A followup, 

 

map.RemoveElevationSurface will throw an InvalidOperationException if you try to remove the ground surface.   

The following code should be used to remove the elevation sources from the ground surface.

var ges = map.GetGroundElevationSurface();
ges.BaseSources = null;

map.SetElevationSurface(ges);

  

0 Kudos