Select to view content in your preferred language

Measure Distance is inaccurate

3746
1
05-21-2014 06:14 AM
MichaelBucari-Tovo
Deactivated User
I made a scale bar for my android app using Line.calculateLength2D() and GeometryEngine.distance() (both return the same value), but the value returned does not match distances measured on a physical map using a scale nor google earth's measurements.  The points I used to measure were:

Point bottomLeft = MapView.toMapPoint(0, MapView.getHeight());
Point bottomRight = MapView.toMapPoint(MapView.getWidth(), MapView.getHeight()); 


I also used MapView.getExtent() which gave the same result.

Polygon extent = MapView.getExtent();
Point bottomLeft = extent.getPoint(0);
Point bottomRight = extent.getPoint(1); 


I was testing this with the world imagery tile service at zoom level 15.  I noticed that wherever I was on earth, the measurement of my screen width was ALWAYS 1032m.  I measured the real distance using google earth, and found that the real distance matches ArcGIS's calculateLength2D() value at the equator, but it gets progressively smaller as latitude increases.  On a hunch, I tried multiplying the calculateLength2D() value by the cosine of the latitude, and it worked.  The product matched google earth measurements at all latitudes.

I'm not sure if this is a bug or working as intended. What's the use of calculateLength2D() and distance() if their output is only valid at the equator?
1 Reply
TeroRönkkö
Regular Contributor

I ran into same problem which is the distance being inaccurate. I live in Finland and it is roughly double the distance wrong - and indeed cos 62 is ~0.47. It would give roughly correct distance.

It CAN'T be intended to work like this? I queried our local dealer and they should send it as a bug. Unless your article gets noticed here (it should)

0 Kudos