SketchViewModel – 2D snapping with automatic Z (like in ArcGIS Pro)

135
3
2 weeks ago
KrzysztofNoga
Emerging Contributor

When sketching with snapping on a 2D map, I'd like to achieve the same effect as in ArcGIS Pro. That is, the Z coordinate would be taken from the clicked vertex of another object, or if we click an edge, it would be calculated based on the vertices of the clicked edge.

Can this behavior be achieved using Sketch or SketchViewModel from the ArcGIS Maps SDK for JavaScript?

There is a video in the attachment showing the behavior in ArcGIS Pro.

0 Kudos
3 Replies
JonathanDawe_BAS
Regular Contributor

Unfortunately I don't think this is possible in the ArcGIS JS API. The client side geometry engine (and new geometry operators) mostly only work with 2D geometries. From past experience, the standard behaviour was that geometries in 2d maps didn't even bother bringing down the z coordinate in the requested geometries. 

 

The issue is that this is a surprisingly non-trivial problem. A z-coordinate could represent an absolute height or a height relative to an underlying elevation surface. This means that it might not be as simple to interpolate a vertical height between the two points on an edge, you may need to also account for the underlying elevation model you are using.

 

 

0 Kudos
KrzysztofNoga
Emerging Contributor

I agree... But if the coordinates are provided in "absolute height" mode, implementation shouldn't pose much difficulty.

JonathanDawe_BAS
Regular Contributor

Agreed - it could assume absolute heights. Though as i understand it there is currently no way of storing in the data model what the z values represent. i.e. absolute vs relative heights....

0 Kudos