<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Create unique buffers in Notebook in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/create-unique-buffers-in-notebook/m-p/1228519#M7971</link>
    <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;I have an AGOL item with 3 layers: Site Location (pts), Site Buffer (poly) and Site Area (poly). The Site Area has a field with a Distance value that I would like to use to create my buffers (different value for each area).&lt;/P&gt;&lt;P&gt;So in my Notebook, I have a piece of code that select all the Site Location where the BufferFlag='N' then I intersect each of the records with my Site Area to get the proper value of the Distance to create the buffer…. AND THEN I AM STUCK! below is the section of code that I can't figure it out.(line 15 to 20)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;i=0
###for each Site Location WORKING
for f in SLHFLcount:
    print(f.attributes['FUID'] + ' -- '+ f.attributes['BufFlag2'])
    ptFeat = SLHFLcount.features[i].geometry
    print(ptFeat)
    print("~~~~~~~~~")
    ###Intersect with my Site Location WORKING
    AreaHFLqry = AreaHFL.query(where='1=1', geometry_filter=filters.intersects(ptFeat))
    print(len(AreaHFLqry))
    if len(AreaHFLqry) &amp;gt;=1:
        AreaHFLqryFeatures = AreaHFLqry.features
        print(AreaHFLqryFeatures[0].attributes['Area1']+ ' -- '+ AreaHFLqryFeatures[0].attributes['Area2']  + ' -- '+ str(AreaHFLqryFeatures[0].attributes['Dist']))
        
        ###Create individual buffers NOT WORKING
        dDist = AreaHFLqryFeatures[0].attributes['Dist']
        buffLyr = use_proximity.create_buffers(SLHFL, distances=[dDist], units = 'Feet',output_name=BufferHFL)
        #buffLyr_fc = buffLyr.layer
        #print(buffLyr_fc)
        map1.add_layer(BufferHFL)
        
        ###update BufFlag to Y
        #strExpression = "FUID='"+str(f.attributes['FUID']+"'")
        #SLHFL.calculate(where=strExpression,calc_expression={"field":"BufFlag2", "value": "Y"})
    else:
        print("we don't have a polygon yet")
    i +=1
    print("----------------")

print("Process completed")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I create the buffer JUST for that selected Site Location and append the buffer to my Site Buffer layer?&lt;/P&gt;&lt;P&gt;Any help would be much appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
    <pubDate>Thu, 03 Nov 2022 20:55:37 GMT</pubDate>
    <dc:creator>DominicRobergeIADOT</dc:creator>
    <dc:date>2022-11-03T20:55:37Z</dc:date>
    <item>
      <title>Create unique buffers in Notebook</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/create-unique-buffers-in-notebook/m-p/1228519#M7971</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;I have an AGOL item with 3 layers: Site Location (pts), Site Buffer (poly) and Site Area (poly). The Site Area has a field with a Distance value that I would like to use to create my buffers (different value for each area).&lt;/P&gt;&lt;P&gt;So in my Notebook, I have a piece of code that select all the Site Location where the BufferFlag='N' then I intersect each of the records with my Site Area to get the proper value of the Distance to create the buffer…. AND THEN I AM STUCK! below is the section of code that I can't figure it out.(line 15 to 20)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;i=0
###for each Site Location WORKING
for f in SLHFLcount:
    print(f.attributes['FUID'] + ' -- '+ f.attributes['BufFlag2'])
    ptFeat = SLHFLcount.features[i].geometry
    print(ptFeat)
    print("~~~~~~~~~")
    ###Intersect with my Site Location WORKING
    AreaHFLqry = AreaHFL.query(where='1=1', geometry_filter=filters.intersects(ptFeat))
    print(len(AreaHFLqry))
    if len(AreaHFLqry) &amp;gt;=1:
        AreaHFLqryFeatures = AreaHFLqry.features
        print(AreaHFLqryFeatures[0].attributes['Area1']+ ' -- '+ AreaHFLqryFeatures[0].attributes['Area2']  + ' -- '+ str(AreaHFLqryFeatures[0].attributes['Dist']))
        
        ###Create individual buffers NOT WORKING
        dDist = AreaHFLqryFeatures[0].attributes['Dist']
        buffLyr = use_proximity.create_buffers(SLHFL, distances=[dDist], units = 'Feet',output_name=BufferHFL)
        #buffLyr_fc = buffLyr.layer
        #print(buffLyr_fc)
        map1.add_layer(BufferHFL)
        
        ###update BufFlag to Y
        #strExpression = "FUID='"+str(f.attributes['FUID']+"'")
        #SLHFL.calculate(where=strExpression,calc_expression={"field":"BufFlag2", "value": "Y"})
    else:
        print("we don't have a polygon yet")
    i +=1
    print("----------------")

print("Process completed")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I create the buffer JUST for that selected Site Location and append the buffer to my Site Buffer layer?&lt;/P&gt;&lt;P&gt;Any help would be much appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 03 Nov 2022 20:55:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/create-unique-buffers-in-notebook/m-p/1228519#M7971</guid>
      <dc:creator>DominicRobergeIADOT</dc:creator>
      <dc:date>2022-11-03T20:55:37Z</dc:date>
    </item>
    <item>
      <title>Re: Create unique buffers in Notebook</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/create-unique-buffers-in-notebook/m-p/1228894#M7973</link>
      <description>&lt;P&gt;Ok I solved my own problem:&lt;/P&gt;&lt;P&gt;1) I added a Filter on my Feature layer to get one Site Location the time&lt;/P&gt;&lt;LI-CODE lang="python"&gt;fExpression = "FUID='" + f.attributes['FUID'] +"'"
SLHFL.filter = fExpression&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and then , after I ran the buffer I am adding the new feature to my Buffer Layer using the following code&lt;/P&gt;&lt;LI-CODE lang="python"&gt;buffLyr = use_proximity.create_buffers(SLHFL, distances=[dDist], units = 'Feet')

#Append to Buffer HFL
BufferHFL.edit_features(adds=buffLyr.layer.featureSet.features)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;working great!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Nov 2022 20:41:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/create-unique-buffers-in-notebook/m-p/1228894#M7973</guid>
      <dc:creator>DominicRobergeIADOT</dc:creator>
      <dc:date>2022-11-04T20:41:37Z</dc:date>
    </item>
  </channel>
</rss>

