measure 3d Available ..?

3043
11
Jump to solution
06-22-2016 11:51 PM
JawadhHabeeb1
Occasional Contributor


Is the measure in 3D Available for JS 4.0 ?

Regards,

Jawadh

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
PanagiotisPapadopoulos
Esri Regular Contributor

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.

View solution in original post

0 Kudos
11 Replies
PanagiotisPapadopoulos
Esri Regular Contributor

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.

0 Kudos
JawadhHabeeb1
Occasional Contributor

Thanks for the response,

I hope they release it very soon

0 Kudos
PanagiotisPapadopoulos
Esri Regular Contributor

me too, there is a lot of functionality coming on next release, so we are waiting......

0 Kudos
Jack_Zhang
Occasional Contributor

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.

0 Kudos
ThomasSolow
Occasional Contributor III
0 Kudos
Jack_Zhang
Occasional Contributor

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.

0 Kudos
ThomasSolow
Occasional Contributor III

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.

0 Kudos
Jack_Zhang
Occasional Contributor

so this won't help us measuring 3D object or distance between any two points that not on the ground. WTH

0 Kudos
ThomasSolow
Occasional Contributor III

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