How to recalculate distance from planar to geodesic?

1909
3
04-06-2017 02:41 PM
VojtěchBlažek1
New Contributor III

Hi,

I've create connections between most of all international airports with xy to line tools - tried all types (Geodesic, Rumbh line ... ) - its about 24000 lines. This tool creates shapefile in Geographic Coordinate System: GCS_WGS_1984. In this is case is of course impossible to calculate length of lines. So i tried to project them into WGS_1984_Web_Mercator_Auxiliary_Sphere, after that I can calculate planar lengths.

I know --- The geodesic lengths can be calculated only in projected coordinate system such as USA_Contiguous_Equidistant_Conic etc. so the lengths are correct only in area for which is concrete projection created.

My question (i thing kind of stupid) is:

Is there any tool or something which can calculate length for each line in geodesic system?

I've found one thread in Silveright api question How to recalculate distance from planar to geodesic value 

and there is answer :

"it's easier to get the center Y web mercator coordinates than the latitude, you can also define the ratio as:

ratio = Math.Cosh(Y/earthRadius);  with earthRadius approximatively equals to 6378137"

And i have no idea how to do it in arcmap‌ or arcgispro - how to get Y center?

Thanks and sorry for stupid question

Result of XY to line (Geodesic)

XY to line (24 000 lines)

0 Kudos
3 Replies
DanPatterson_Retired
MVP Esteemed Contributor

You ruled out Add Geometry Attributes with the geodesic option(s) and returning lengths in km ?

VojtěchBlažek1
New Contributor III

Yes!!!!!

Thanks a lot

0 Kudos
DanPatterson_Retired
MVP Esteemed Contributor

Glad it worked. The built-in is a nice addition.  Should you need code for other purposes, then Vincenty's implementation of geodesic distance can be found ...here... which provides other threads on this topic