ArcGIS API for JavaScript 4.0 - Why is there no SceneLayer elevationInfo?

2900
5
Jump to solution
03-11-2016 10:53 AM
James_Whitacre
Occasional Contributor

I am trying to add a SceneLayer with multipatch building features that are tied to zero elevation at the base/footprint. I want the features in the SceneLayer to overlay onto the ground. This can be done easily in ArcGIS Pro. This can also be done with GraphicsLayer, which SceneLayer is inherited from (see SceneLayer | API Reference | ArcGIS API for JavaScript).

If SceneLayer is inherited from GraphicsLayer, why is the elevationInfo property not also inherited? Is there a work around? Will this be a property added later?

Thanks!

0 Kudos
1 Solution

Accepted Solutions
KristianEkenes
Esri Regular Contributor

> Are you saying that elevationInfo will be a property in the final release of 4.0?

Yes, but only for points. Not multipatch geometries.

> This is functionality I ultimately seek for multipatch (and all) scene layers. You can easily do this in ArcGIS Pro for all types of features.

Something to keep in mind is that Pro, being a desktop application, does not have the same limitations as web applications because it has more resources at its disposal (since it's a 64-bit application). Implementing elevationInfo for multipatch geometries on SceneLayers has proven to be quite expensive in JavaScript. You would see a significant hinderance to your performance depending on the number and complexity of your features. Improving performance of 3D apps in the browser is something we are constantly striving to do.

> With all this said, I still think that adding the elevationInfo property and functionality to SceneLayer is important so as to mitigate for when web map users want to turn off the elevation layer (if the option is provided) they won't see floating scene layers. Additionally, it would be nice if when publishing the scene layer, the elevation properties in the ArcGIS Pro layer were also published with scene layer so it was automatic

That's great that you were able to use a tool to store the actual z-values of your features. I can't speak for ArcGIS Pro, but I can reach out to someone from that team who can chime in.

For now, I would make a decision between using elevation, or not in the web application(s) you're working on since it's not easy to switch between the two. Is switching elevation on/off a requirement of your application?

View solution in original post

0 Kudos
5 Replies
KristianEkenes
Esri Regular Contributor

Hi James,

SceneLayer will not inherit from GraphicsLayer in 4.0 final. The elevationInfo property is part of the SceneLayer. I haven't tested it much, but it is only supported for SceneLayers that have point geometries, not mesh.

I guess I'm also having trouble visualizing the problem. You have multipatch features representing buildings, but they don't have z-values in the geometries, so you need to be able to just place them on the ground. Is that correct? I'll try to help as much as I can, but I want to make sure I understand your data first.

0 Kudos
James_Whitacre
Occasional Contributor

Kristian,

Thanks for responding. Are you saying that elevationInfo will be a property in the final release of 4.0? I know that elevationInfo is a property for FeatureLayer so points can visualized as 3D, but elevationInfo is not listed as a property of SceneLayer in the current release of the ArcGIS API for JavaScript 4.0 documentation (as of 22 March 2016). Additionally I have experimented to see if the property is actually there, but not a part of the documentation, and it's not. It would be great if it is, as I suspect that will solve my problem since elevationInfo (FeatureLayer | API Reference | ArcGIS API for JavaScript) is what determines how feature are placed in accordance to the elevation layer (i.e. on the ground, relative to ground, or absolute height). This is functionality I ultimately seek for multipatch (and all) scene layers. You can easily do this in ArcGIS Pro for all types of features (Define height characteristics for layers—ArcGIS Pro | ArcGIS for Desktop).

To follow up with your question about z-values, the buildings do have z-values, but their bases are at zero (as I mentioned). Here was the workflow: Buildings were modeled in SketchUp, georeferenced, and exported as KMZ (someone else did this...). Then I imported the KMZs into a multipatch feature class and published it to Portal as a Scene Layer (I'd share the URL, but my IT won't let me open up our portal/server past the firewall yet...). In ArcGIS Pro, I set the mulitpatch feature layer to be placed on the ground according to the elevation layer (see link above) and then published the scene layer to Portal. The resulting scene layer is not able to be placed on the ground in a web map. I need to turn off the elevation for the basemap to actually see the layer (see Toggle basemap's elevation | ArcGIS API for JavaScript).

The good news is that since my original post, I was actually able to solve this problem, by using the Layer 3D to Feature Class (Layer 3D To Feature Class—Help | ArcGIS for Desktop). The tool recognizes that the layer is placed on the ground relative to the elevation layer and when it creates the new feature class, the z-values are all scaled accordingly, resulting in the features 'resting' at their correct elevation. Then, when you add this new feature class to the map, the layer's elevation properties can be set at absolute height  and are placed on the ground (although 'on the ground' will also work). When this multipatch layer is now published as a scene layer, it rests on the ground properly in the web map. But if you turn off elevation, the feature floats in the air!

With all this said, I still think that adding the elevationInfo property and functionality to SceneLayer is important so as to mitigate for when web map users want to turn off the elevation layer (if the option is provided) they won't see floating scene layers. Additionally, it would be nice if when publishing the scene layer, the elevation properties in the ArcGIS Pro layer were also published with scene layer so it was automatic...not sure if that is possible though.

0 Kudos
KristianEkenes
Esri Regular Contributor

> Are you saying that elevationInfo will be a property in the final release of 4.0?

Yes, but only for points. Not multipatch geometries.

> This is functionality I ultimately seek for multipatch (and all) scene layers. You can easily do this in ArcGIS Pro for all types of features.

Something to keep in mind is that Pro, being a desktop application, does not have the same limitations as web applications because it has more resources at its disposal (since it's a 64-bit application). Implementing elevationInfo for multipatch geometries on SceneLayers has proven to be quite expensive in JavaScript. You would see a significant hinderance to your performance depending on the number and complexity of your features. Improving performance of 3D apps in the browser is something we are constantly striving to do.

> With all this said, I still think that adding the elevationInfo property and functionality to SceneLayer is important so as to mitigate for when web map users want to turn off the elevation layer (if the option is provided) they won't see floating scene layers. Additionally, it would be nice if when publishing the scene layer, the elevation properties in the ArcGIS Pro layer were also published with scene layer so it was automatic

That's great that you were able to use a tool to store the actual z-values of your features. I can't speak for ArcGIS Pro, but I can reach out to someone from that team who can chime in.

For now, I would make a decision between using elevation, or not in the web application(s) you're working on since it's not easy to switch between the two. Is switching elevation on/off a requirement of your application?

0 Kudos
RussRoberts
Esri Notable Contributor

When you publish the scene layer from Pro do you have the elevation you are using in your web scene added to Pro?

When you have your multipatches added to your scene in Pro you will have to have them on the ground (through the layer properties). Then you run the Layer 3D to Feature Class. This will add the final multipatch to your scene with the buildings on the terrain. Then when you publish your scene it will create a web scene referencing the same elevation service and the scene layer will display on the ground.

This tutorial is helpful in showing the steps to creating a scene layer thats placed on the ground correctly.

Author and share a local scene to Portal for ArcGIS—ArcGIS Pro | ArcGIS for Desktop

0 Kudos
James_Whitacre
Occasional Contributor

Kristian,

> Implementing elevationInfo for multipatch geometries on SceneLayers has proven to be quite expensive in JavaScript.

I think that this is the biggest take away. I totally understand this point and do not find this surprising, though I was hoping otherwise! I can conclude now that the way I solved the problem is the best practice (Russel, The documentation you suggested is what I did. This is what I described in my first response to Kristian).

Switching elevation on and off is not essential to my application. And this is the other best practice advice I can take away from these posts: For non-point 3D data, ensure that its relationship to the ground is taken care of before publishing and then design your web apps appropriately with the desired elevation settings.

Thanks for your input. I think I've got it figured out from here...for now!

James

0 Kudos