if you see on JS API 4.0 functionallity matrix Measurement is Coming soon.
Functionality matrix | ArcGIS API for JavaScript 4.0
so we are waiting for measurement on 3D API.
if you see on JS API 4.0 functionallity matrix Measurement is Coming soon.
Functionality matrix | ArcGIS API for JavaScript 4.0
so we are waiting for measurement on 3D API.
Thanks for the response,
I hope they release it very soon
me too, there is a lot of functionality coming on next release, so we are waiting......
Well it's almost about a year now for that "Coming soon" be there. don't think a year long of time could be called "soon" for a basic 3D function. very disappointed. To me web scene is a half baked product that I would not even refer to my users.
In the meantime, you can use the geometry engine for measurements. geometryEngine | API Reference | ArcGIS API for JavaScript 4.3 or geometryEngineAsync | API Reference | ArcGIS API for JavaScript 4.3
Hi Thomas,
do you mean it's possible now to measure in 3D using GeometryEngine? I had look the Javascript APIs but couldn't find anything specifically about measure in 3D. could you please direct me to some examples? Thanks.
It depends on what you mean by "measure in 3D."
You can measure the distance between 2 points using the geometry engine: JS Bin - Collaborative JavaScript Debugging
That example uses the geodesicLength method, so it includes the earth's curvature. There are also planar methods that don't. Measuring in 3D isn't really any different from measuring in 2D as long as you're measuring along the surface of the earth.
Things get more complicated if you're interested in finding the distance between two points with z values. I agree that this is an area where the JS API lacks support.
so this won't help us measuring 3D object or distance between any two points that not on the ground. WTH
I'm by no means an expert in this area but here's a brief rundown of my understanding.
To start with, I would say that all of these measurements are approximations. None of them take variations in elevation into account (obviously). My understanding is that, for very sensitive measurements, other methods are used.
That said, you can get pretty good approximations of the great-circle distance between two points on the earth's surface using the geometry engine. If you have two points with a longitude, latitude, and altitude, the geometry engine won't help (it appears to ignore the altitude), but you have some other options.
One of them is to take the average of the altitudes of the two points and find the great-circle distance between the two new points. In practice this gives reasonably good results. The farther the distance between the two points, the greater the error. I would say this is acceptable for most normal use cases.
Another is to convert from a long, lat, z coordinate system into a 3 dimensional cartesian coordinate system (ECEF is a commonly used one). Once you have two points in ECEF, you can use the distance formula to calculate the straight-line distance between the two points:
let d = Math.sqrt(Math.pow(x1-x2, 2) + Math.pow(y1-y2, 2) + Math.pow(z1-z2, 2))
Here's a stackoverflow question and answer that provides some code that may be helpful if you want to implement either of these options: geometry - Taking altitude into account when calculating geodesic distance - Stack Overflow