Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I have Center point(Latitude,longitude) for a place and radius. How to draw a circle/polygon on an ArcGIS map using Latlong and radius(also need WKT string). I am new to ArcGIS & do not have much idea about ArcGIS.

Thanks in Advance.

share|improve this question
    
are you limited to c#? if you interest with arcpy(python) i can give you an example... –  Aragon Jun 1 '12 at 11:47
    
Thank you so much for your immediate reply.Basically i am C# programmer.Please share me your code and steps how do we implement this in ArcGIS. –  sherifm2d Jun 1 '12 at 12:02
1  
but my code will be in python hovewer you want? –  Aragon Jun 1 '12 at 12:06
add comment

2 Answers

Yes finally i got it...

I am sharing it here.I hope my code will help someone.

 Private void DrawCircle()
{
 _pointAndBufferGraphicsLayer = esriMap.Layers["Graphics Layer"] as GraphicsLayer;  
  Symbol _activeSymbol = LayoutRoot.Resources["DefaultFillSymbol"] as Symbol;
  ESRI.ArcGIS.Client.Geometry.Polygon polygon=new Polygon();
  ESRI.ArcGIS.Client.Geometry.PointCollection pointCollection = 
  new  ESRI.ArcGIS.Client.Geometry.PointCollection();
  polygon.SpatialReference = esriMap.SpatialReference;
  double radius=0.6;
  MapPoint pp = new MapPoint(55.00206, 24.98167); //Lat long;
  var PointCount = 40; // number of points on the circle
  var angle = 360 / PointCount; // used to compute points on the circle
  for (var i = 1; i <= PointCount; i++)
       {
           // convert angle to raidans
           //var radians = i * angle * Math.PI / 180;
           double radians = 2 * Math.PI / PointCount * i;
           // add point to the circle
           double x = (pp.X + radius * Math.Cos(radians));
           double y = (pp.Y + radius * Math.Sin(radians));
           pointCollection.Add(new MapPoint(x, y));
       }
        polygon.Rings.Add(pointCollection);
        ESRI.ArcGIS.Client.Graphic gr = new ESRI.ArcGIS.Client.Graphic() { 
        Geometry =polygon, Symbol = _activeSymbol };
       _pointAndBufferGraphicsLayer.Graphics.Add(gr);//If already have graphics layer
       // esriMap.Layers.Add(_pointAndBufferGraphicsLayer); //If not already have graphics layer
            esriMap.ZoomTo(polygon);
    }

Thanks to all for your help.

NOTE: this loop is measurably faster if you calculate 2 * Math.PI / PointCount just once, outside the loop.

share|improve this answer
add comment

Hope this will help you: How to efficiently create a polygon

share|improve this answer
    
Here also i cant find the solution.... –  sherifm2d Jun 1 '12 at 14:49
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.