Select to view content in your preferred language

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

2550
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
16 Replies
BikeshMaharjan1
Regular Contributor

Thanks! It seems that was the reason why my application was slow lol. Thanks all for the information. Appreciate it!

Thanks,

Bikesh

VinceAngelo
Esri Esteemed Contributor

One BILLION vertices?! Yeah, that would slow down most apps, even if hundreds of millions of them were removed for being duplicate at the precision of the spatial reference. In fact, that likely qualifies as a (self-inflicted) denial-of-service attack.

- V

ManelKEDDAR
Deactivated User

Hello ,

Please can you tell me what methods you used to draw the circle ? i really need it thanks 

0 Kudos
BikeshMaharjan1
Regular Contributor

Hey Manel, 

I use sketcheditor to let user draw shapes in the map. It is in the Esri.ArcGISRuntime.UI.

Haven't tried it yet but another thing you might be able to do is draw a polygon with list of points on the circumference of a circle. Below is how I get points on the circle on given angle:

var xCoord = CenterOfCircle.xCoord + Radius * Math.Cos(angle * (Math.PI / 100));
var yCoord = CenterOfCircle.yCoord + Radius * Math.Sin(angle * (Math.PI / 100));
return new MapPoint(xCoord, yCoord, SpatialReferences.WebMercator);

So, one can put that in a loop and get points of a circle with given center of circle, radius, and angle.

Hope that helps!

Thanks,

Bikesh

0 Kudos
dotMorten_esri
Esri Notable Contributor

The Geometry Engine can create a geodesic buffer around any geometry. If you do it around a point, you get a circle:

Here's a 1km circle:

GeometryEngine.BufferGeodetic(new MapPoint(x, y, SpatialReferences.WebMercator), 1000, LinearUnits.Meters);

BikeshMaharjan1
Regular Contributor

Can we change the outline color of the bufferGeodetic? or of ellipseGeodesic?

0 Kudos
dotMorten_esri
Esri Notable Contributor

These methods have no color/symbology. They just take a plain geometry and return a plain geometry. What symbology you choose to render them with is entirely up to you, and would be defined elsewhere in your code.

0 Kudos