0

I have been given three parameters X and Y coordinates and a distance or the radius of the circle. I will have to draw a circle using ArcPy by these three parameters where the center is the point of X-Y coordinate and radius is distance.

e.g: Center (20.5937° N, 78.9629° E) Radius 5 unit

enter image description here

skarmakar
  • 9
  • 4
  • Perhaps this answer might help although it is a few years old: How to create a circle in arcpy – Joseph Jun 29 '16 at 11:11
  • The magnitude of your "X,Y" value implies decimal degrees, and your radius of "5 units" is exceedingly vague. Please edit the question to specify the projection and radius units. – Vince Jun 29 '16 at 11:21
  • yes the coordinate is in degrees i.e the lat and long of a place which will be the center of the Circle and the unit of the radius is double – skarmakar Jun 29 '16 at 11:45
  • You've got your X and Y values flipped (longitude is X, latitude is Y). A buffer of 5 units makes no sense -- What units? Cartesian Degrees? (Cartesian degrees are useless because the ground distance varies by center location (latitude); this is particularly true when a large area is involved). – Vince Jun 29 '16 at 13:27
  • Please post code as text rather than pictures of code. That way it is available for future searches and potential answerers can copy/paste for any necessary testing. – PolyGeo Jun 30 '16 at 08:32
  • import math import arcpy def circle_poly(x,y,r): for i in range(100): ang = i/100 * math.pi * 2 yield (x + r * math.cos(ang), y + r * math.sin(ang) ) x = arcpy.GetParameterAsText(0) y = arcpy.GetParameterAsText(1) distance = arcpy.GetParameterAsText(2) res = circle_poly(x,y,distance) – skarmakar Jun 30 '16 at 09:53

1 Answers1

2

You could create a buffer around the point using the buffer command. For example in 10.0 using arcpy.Buffer_analysis(), and use the radius as the buffer distance. Check this link : http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//000800000019000000.htm

Oualid Fouad
  • 407
  • 4
  • 11