p.racz

Drawing polygon and adding buffer to it

Discussion created by p.racz on Aug 25, 2017
Latest reply on Aug 29, 2017 by p.racz

Hi!

I would like to draw polygon on my map and afterwards add 1,5 m buffer to it. I managed to draw a polygon however I have no idea how to create a buffer. The idea is that a user of ArcGIS will draw a polygon and receive directly the buffer. Is that possible?

def onLine(self, line_geometry):
        array = arcpy.Array() 
        part = line_geometry.getPart(0) 
        for pt in part: 
            print pt.X, pt.
            array.add(pt) 
        array.add(line_geometry.firstPoint) 
        polygon = arcpy.Polygon(array) 
         
        # Local Variables 
        Input = polygon 
        NewPolygons = "\\\\abc\\home\\xxx\\Documents\\moje dokumenty\\xyz\\arcgis\\new polygons"
 
        # Process: Append Polygon to existing file or Create new file if one is not created.   
 
        if arcpy.Exists("NewPolygons"):   
            arcpy.Append_management(Input, NewPolygons, "Test", "", "") 
 
        else: 
            arcpy.CopyFeatures_management(Input,NewPolygons, "", "0","0","0")
           
        print " Excavation Polygon located"

Outcomes