Select to view content in your preferred language

Geometry.Extent.Height does not match web map distance.

2608
16
Jump to solution
08-15-2017 01:05 PM
BikeshMaharjan1
Regular Contributor

I draw a Geometry (Circle) and try to get its diameter by Geometry.Extent.Height. However, if i manually try to see the distance in a arcgis web map, it differs significantly. Like, 1800m from Geometry.Extent.Height is actually 1200m in web map. 

I tried to do the same in the some part of the equator of world map and it actually matches. I don't know why this is happening. Is this scaling issue? Any advises on how to make it give the same distance in both?

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
MelitaKennedy
Esri Notable Contributor

I think when you ask for the distance, you're getting the "geodesic" distance. You might see if there's a setting to switch to the Cartesian or projected distance. The geodesic distance is closer to the actual ground distance. Mercator wildly distorts distances away from the equator in favor of maintaining the shapes and angles of features. The measure tool is likely set up to return the geodesic distance so that if someone measures Los Angeles to New York (for example) they get a value that matches what someone knows already or can look up.

Melita

View solution in original post

16 Replies
MelitaKennedy
Esri Notable Contributor

What's the coordinate system? geometry.extent.height in, say, Web Mercator, could be giving you the actual height (north-south dimension) which is very exaggerated away from the equator in any Mercator-based coordinate system. The web map tool/widget may be returning the geodesic distance (shortest distance on the underlying ellipsoid model) rather than the projected/2D Cartesian distance.

Melita

BikeshMaharjan1
Regular Contributor

Hey Melita,

Thank you for the reply. The Coordinate system is Web Mercator.  So, I am basically trying to get diameter of the circle I draw in the map. I try to get that using geometry.extent.height. Does that look correct? if not, if you could give tell me how one would find the diameter. I am trying out the sample application to draw a circle sketch on the map. 

I get the distance from the web map viewer by using the measure distance tool in it. Like calculating the distance between two opposite points on the circle. Shouldn't the distance that i manually measure from the map viewer be similar as the geometry.extent.height? if it is the diameter of the circle i drew?

If i draw the circle near the equator line countries, the values turns out to be similar but not in other places away from equator line.

Thanks,

Bikesh

0 Kudos
MelitaKennedy
Esri Notable Contributor

I think when you ask for the distance, you're getting the "geodesic" distance. You might see if there's a setting to switch to the Cartesian or projected distance. The geodesic distance is closer to the actual ground distance. Mercator wildly distorts distances away from the equator in favor of maintaining the shapes and angles of features. The measure tool is likely set up to return the geodesic distance so that if someone measures Los Angeles to New York (for example) they get a value that matches what someone knows already or can look up.

Melita

BikeshMaharjan1
Regular Contributor

Thank You for the information. I think i understand a little better now. So, is there a way to convert geodesic distance to  Cartesian distance and vice versa in ArcGIS Runtime SDK for .NET?

Thanks,

Bikesh

0 Kudos
NagmaYasmin
Esri Contributor

Hi Bikesh,

You could use GeometryEngine.DistanceGeodetic Method to calculate the geodetic distance between two point.

GeometryEngine.DistanceGeodetic Method 

To calculate the planar distance, you can use GeometryEngine.Distance Method

GeometryEngine.Distance Method 

Hope that helps.

Nagma

BikeshMaharjan1
Regular Contributor

Hey Nagma,

Thanks for the links. That might be very useful for me later in my project. Currently, if i am correct, I can get the Geodetic distance (diameter of circle in my case) by using GeometryEngine.LengthGeodetic of the circle geometry and calculating the diameter from there. Since I get the Length value in Geodetic, the diameter value that i calculate is also in Geodetic. Now, I want to convert that Geodetic diameter into planar value so that i can draw a circle into the map manually. or Is there any API in 100.1 where we can draw a circle with Geodetic radius value and center point?

Thanks Again,

Bikesh

0 Kudos
NagmaYasmin
Esri Contributor

Hi Bikesh,

I believe you could use GeodesicEllipseParameters Class. To create a geodetic circle, the "SemiAxisLength1" and "SemiAxisLength2" are the same, or set "SemiAxisLength1" to a valid length and "SemiAxisLength2" to zero.

GeodesicEllipseParameters Class 

Hope that helps.

Nagma

BikeshMaharjan1
Regular Contributor

Thanks Nagma. That looks like what I could use. What do you say the default value for maxPointCount and maxSegmentLength should be there for a circle? I put 1000000000, and 0.1 respectively. I am not sure if that looks like a good value for a circle.

Thanks,

Bikesh

0 Kudos
MelitaKennedy
Esri Notable Contributor

Max point count is way too large. The Buffer Tool when building a point buffer of 500 m at 52N (latitude) uses about 160 points. For a buffer of a a few kilomters, I wouldn't use more than a few hundred points.