Visualize a FeatureLayer in 3D with attribute's values as absolute height

1482
10
05-09-2017 06:46 AM
ChristianSailer2
Occasional Contributor

Hello

Is JS 4.3 ready for visualizing a FeatureLayer (FeatureService) in 3D with attribute's values as absolute height?

Thank you

Chris

0 Kudos
10 Replies
KristianEkenes
Esri Regular Contributor

This option still isn't supported. You could write a function that uses the FeatureLayer.applyEdits() method to add Z values to the geometry object based on the attribute field value.

0 Kudos
KristianEkenes
Esri Regular Contributor

This response is also assuming that you're working with point geometries. If you're referring to extruding polygons based on real world height, this is doable. See this sample: Extrude building footprints based on real world heights | ArcGIS API for JavaScript 4.3 

0 Kudos
ChristianSailer2
Occasional Contributor

Thank you for the quick reaction.
Yes indeed, I use point geometries (trajectories) and like to visualize them as space-time cubes in the web (https://omleth.ch) to evaluate the results. Below an ArcScene VIZ.
Do you know the road map of this very important 3D feature, Height based on feature attribute?

Source: Map-based Visual Analytics of Moving Learners  

0 Kudos
KristianEkenes
Esri Regular Contributor

The roadmap is never set in stone as requirements or any number of issues can arise, postponing the planned release of a feature. But the plan is to have this in by the end of the year. Again, it's not set in stone, just a projection. It's an issue that's definitely been on our radar for a while and we've finally made plans to include it.

0 Kudos
ThomasSolow
Occasional Contributor III

I'm not entirely sure of your requirements, but my guess is that there's no reason you can't do this currently if you're willing to dig into the API a little.

If you have a list of graphics/features (with point geometries) and want to use an attribute on each feature as its z value, you could simply write a function to edit the geometries on each feature based on some attribute. Ideally you would set this up in your feature service beforehand (that is, make your feature service serve up features with z values set beforehand), but there's no reason you can't do it in the browser.

Here's an example: JS Bin - Collaborative JavaScript Debugging

In that example I used the index of each feature in the array as its z value, but you could access some attribute on the graphic for that purpose instead.  This is also using a 2D symbol, but you could use a 3D symbol.

0 Kudos
ChristianSailer2
Occasional Contributor

That example is exactly what I need, thank you!

You can replace the attribute idx with Crown_Height to make the sample reasonable... 😉

Great thank you!

0 Kudos
ChristianSailer2
Occasional Contributor

Hi Thomas

Still me sorry. You have several Integer attributes in used fs https://services.arcgis.com/V6ZHFr6zdgNZuVG0/arcgis/rest/services/Landscape_Trees/FeatureServer/0  of the above sample. When I replace the idx attribute with p.e. "Crown_Base", the features are still visualized by the OBJECTID.

What are the changes to vis. the 3d map by Crown_Base ?

Thank you!

0 Kudos
ThomasSolow
Occasional Contributor III

The issue here is that, by default, the query won't return all attributes on each feature.  To force it to return all attributes, you need to set outFields on the query: JS Bin - Collaborative JavaScript Debugging 

0 Kudos
ChristianSailer2
Occasional Contributor

Can you use also the system-Attribute "Created_Date" in decimal numbers? 

And what about polygon features?

0 Kudos