<?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 Re: buffer point data based an field value through script in notebook in Developers Questions</title>
    <link>https://community.esri.com/t5/developers-questions/buffer-point-data-based-an-field-value-through/m-p/1524952#M7206</link>
    <description>&lt;P&gt;That worked great thank you.&amp;nbsp; The next thing I am trying to do is to convert this buffer into a polygon and add it as a new feature to another feature layer I have.&amp;nbsp; I have tried the following code:&amp;nbsp;&lt;/P&gt;&lt;P&gt;target_layer_url = &lt;SPAN class=""&gt;"&lt;A href="https://services.arcgis.com/your_service_id/arcgis/rest/services/your_layer_name/FeatureServer/0" target="_blank" rel="noopener"&gt;https://services.arcgis.com/your_service_id/arcgis/rest/services/your_layer_name/FeatureServer/0&lt;/A&gt;"&lt;/SPAN&gt; target_layer = FeatureLayer(target_layer_url)&lt;/P&gt;&lt;P&gt;&amp;nbsp;new_features = []&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;# Iterate through the features in the result and add them to the target layer&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;for&lt;/SPAN&gt; feature &lt;SPAN class=""&gt;in&lt;/SPAN&gt; result.query():&lt;/P&gt;&lt;P&gt;buffer_geometry = feature.geometry&lt;/P&gt;&lt;P&gt;buffer_feature = Feature(geometry=buffer_geometry)&lt;/P&gt;&lt;P&gt;new_features.append(buffer_feature)&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;# Add all the new buffer features to the target layer at once&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;response = target_layer.edit_features(adds=new_features)&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;# Check if the operation was successful&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;if&lt;/SPAN&gt; &lt;SPAN class=""&gt;'addResults'&lt;/SPAN&gt; &lt;SPAN class=""&gt;in&lt;/SPAN&gt; response &lt;SPAN class=""&gt;and&lt;/SPAN&gt; &lt;SPAN class=""&gt;all&lt;/SPAN&gt;(result[&lt;SPAN class=""&gt;'success'&lt;/SPAN&gt;] &lt;SPAN class=""&gt;for&lt;/SPAN&gt; result &lt;SPAN class=""&gt;in&lt;/SPAN&gt; response[&lt;SPAN class=""&gt;'addResults'&lt;/SPAN&gt;]):&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;print&lt;/SPAN&gt;(&lt;SPAN class=""&gt;"All buffer polygons successfully added to the feature layer."&lt;/SPAN&gt;)&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;else&lt;/SPAN&gt;:&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;print&lt;/SPAN&gt;(&lt;SPAN class=""&gt;"Failed to add some or all buffer polygons to the feature layer."&lt;/SPAN&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I keep getting this returned:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN class=""&gt;TypeError&lt;/SPAN&gt;                                 Traceback (most recent call last)
&lt;SPAN class=""&gt;/tmp/ipykernel_338/3308212656.py&lt;/SPAN&gt; in &lt;SPAN class=""&gt;&amp;lt;cell line: 0&amp;gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;()&lt;/SPAN&gt;
&lt;SPAN class=""&gt;      1&lt;/SPAN&gt; &lt;SPAN class=""&gt;for&lt;/SPAN&gt; feature &lt;SPAN class=""&gt;in&lt;/SPAN&gt; result&lt;SPAN class=""&gt;.&lt;/SPAN&gt;query&lt;SPAN class=""&gt;(&lt;/SPAN&gt;&lt;SPAN class=""&gt;)&lt;/SPAN&gt;&lt;SPAN class=""&gt;:&lt;/SPAN&gt;
&lt;SPAN class=""&gt;      2&lt;/SPAN&gt;     buffer_geometry &lt;SPAN class=""&gt;=&lt;/SPAN&gt; feature&lt;SPAN class=""&gt;.&lt;/SPAN&gt;geometry
&lt;SPAN class=""&gt;----&amp;gt; 3&lt;/SPAN&gt;     buffer_feature &lt;SPAN class=""&gt;=&lt;/SPAN&gt; feature&lt;SPAN class=""&gt;(&lt;/SPAN&gt;geometry&lt;SPAN class=""&gt;=&lt;/SPAN&gt;buffer_geometry&lt;SPAN class=""&gt;)&lt;/SPAN&gt;
&lt;SPAN class=""&gt;      4&lt;/SPAN&gt;     new_features&lt;SPAN class=""&gt;.&lt;/SPAN&gt;append&lt;SPAN class=""&gt;(&lt;/SPAN&gt;buffer_feature&lt;SPAN class=""&gt;)&lt;/SPAN&gt;
&lt;SPAN class=""&gt;      5&lt;/SPAN&gt; 

&lt;SPAN class=""&gt;TypeError&lt;/SPAN&gt;: 'Feature' object is not callable
&lt;BR /&gt;&lt;BR /&gt;As you can probably tell, I don't have alot of experience in coding.  any help would be greatly appreciated&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 21 Aug 2024 07:02:51 GMT</pubDate>
    <dc:creator>tendtreesTC</dc:creator>
    <dc:date>2024-08-21T07:02:51Z</dc:date>
    <item>
      <title>buffer point data based an field value through script in notebook</title>
      <link>https://community.esri.com/t5/developers-questions/buffer-point-data-based-an-field-value-through/m-p/1524240#M7204</link>
      <description>&lt;P&gt;I'm trying to write a script in my online notebook to create a buffer around my point data based on the values I have in a field.&amp;nbsp; &amp;nbsp;I have written the following script (its abit messy because I download it as a .md file so I could copy and paste it into this window)&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;FONT color="#000080"&gt;&lt;EM&gt;python&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#000080"&gt;&lt;EM&gt;from arcgis.gis import GIS&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#000080"&gt;&lt;EM&gt;gis = GIS("home")&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#000080"&gt;&lt;EM&gt;```&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#000080"&gt;&lt;EM&gt;```python&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#000080"&gt;&lt;EM&gt;from arcgis.features import FeatureLayer&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#000080"&gt;&lt;EM&gt;feature_layer_url = "&lt;A href="https://services-ap1.arcgis.com/fmr3nGZRGUm3hVAY/arcgis/rest/services/Development_site_application/FeatureServer/0" target="_blank" rel="noopener"&gt;https://services-ap1.arcgis.com/fmr3nGZRGUm3hVAY/arcgis/rest/services/Development_site_application/FeatureServer/0&lt;/A&gt;"&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#000080"&gt;&lt;EM&gt;layer = FeatureLayer(feature_layer_url)&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#000080"&gt;&lt;EM&gt;```python&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#000080"&gt;&lt;EM&gt;features = layer.query(where="1=1", return_geometry=True)&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;FONT color="#000080"&gt;&lt;EM&gt;```python&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#000080"&gt;&lt;EM&gt;geometry=features.features[0].geometry&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#000080"&gt;&lt;EM&gt;```python&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#000080"&gt;&lt;EM&gt;print (geometry)&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#000080"&gt;&lt;EM&gt;```&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#000080"&gt;&lt;EM&gt;```python&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#000080"&gt;&lt;EM&gt;tpr_value = features.features[0].attributes['tpr']&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;FONT color="#000080"&gt;&lt;EM&gt;```&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#000080"&gt;&lt;EM&gt;```python&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#000080"&gt;&lt;EM&gt;from arcgis import features&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#000080"&gt;&lt;EM&gt;from arcgis.features import FeatureSet&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;FONT color="#000080"&gt;&lt;EM&gt;# Assuming 'layer' is your input layer from earlier steps&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#000080"&gt;&lt;EM&gt;result = features.use_proximity.create_buffers(input_layer=layer, distances=[tpr_value], units="Meters", dissolve_type="Dissolve")&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;FONT color="#000080"&gt;&lt;EM&gt;# Convert the result to a FeatureSet&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#000080"&gt;&lt;EM&gt;buffered_featureset = FeatureSet.from_dict(result)&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;FONT color="#000080"&gt;&lt;EM&gt;# Iterate through the features and print their geometries&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#000080"&gt;&lt;EM&gt;for feature in buffered_featureset:&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#000080"&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; print(feature.geometry)&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;&lt;FONT color="#000000"&gt;At this point I keep getting the error:&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;can anyone help me with this?&lt;/DIV&gt;&lt;DIV&gt;&lt;PRE&gt;&lt;SPAN class=""&gt;TypeError&lt;/SPAN&gt;                                 Traceback (most recent call last)
&lt;SPAN class=""&gt;/tmp/ipykernel_703/2622654452.py&lt;/SPAN&gt; in &lt;SPAN class=""&gt;&amp;lt;cell line: 0&amp;gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;()&lt;/SPAN&gt;
&lt;SPAN class=""&gt;      6&lt;/SPAN&gt; 
&lt;SPAN class=""&gt;      7&lt;/SPAN&gt; &lt;SPAN class=""&gt;# Convert the result to a FeatureSet&lt;/SPAN&gt;
&lt;SPAN class=""&gt;----&amp;gt; 8&lt;/SPAN&gt; buffered_featureset &lt;SPAN class=""&gt;=&lt;/SPAN&gt; FeatureSet&lt;SPAN class=""&gt;.&lt;/SPAN&gt;from_dict&lt;SPAN class=""&gt;(&lt;/SPAN&gt;result&lt;SPAN class=""&gt;)&lt;/SPAN&gt;
&lt;SPAN class=""&gt;      9&lt;/SPAN&gt; 
&lt;SPAN class=""&gt;     10&lt;/SPAN&gt; &lt;SPAN class=""&gt;# Iterate through the features and print their geometries&lt;/SPAN&gt;

&lt;SPAN class=""&gt;/opt/conda/lib/python3.11/site-packages/arcgis/features/feature.py&lt;/SPAN&gt; in &lt;SPAN class=""&gt;from_dict&lt;/SPAN&gt;&lt;SPAN class=""&gt;(featureset_dict)&lt;/SPAN&gt;
&lt;SPAN class=""&gt;   1133&lt;/SPAN&gt;         """
&lt;SPAN class=""&gt;   1134&lt;/SPAN&gt;         features &lt;SPAN class=""&gt;=&lt;/SPAN&gt; &lt;SPAN class=""&gt;[&lt;/SPAN&gt;&lt;SPAN class=""&gt;]&lt;/SPAN&gt;
&lt;SPAN class=""&gt;-&amp;gt; 1135&lt;/SPAN&gt;         &lt;SPAN class=""&gt;if&lt;/SPAN&gt; &lt;SPAN class=""&gt;"fields"&lt;/SPAN&gt; &lt;SPAN class=""&gt;in&lt;/SPAN&gt; featureset_dict&lt;SPAN class=""&gt;:&lt;/SPAN&gt;
&lt;SPAN class=""&gt;   1136&lt;/SPAN&gt;             fields &lt;SPAN class=""&gt;=&lt;/SPAN&gt; featureset_dict&lt;SPAN class=""&gt;[&lt;/SPAN&gt;&lt;SPAN class=""&gt;"fields"&lt;/SPAN&gt;&lt;SPAN class=""&gt;]&lt;/SPAN&gt;
&lt;SPAN class=""&gt;   1137&lt;/SPAN&gt;         &lt;SPAN class=""&gt;else&lt;/SPAN&gt;&lt;SPAN class=""&gt;:&lt;/SPAN&gt;

&lt;SPAN class=""&gt;TypeError&lt;/SPAN&gt;: argument of type 'FeatureCollection' is not iterable&lt;/PRE&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 20 Aug 2024 09:41:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/buffer-point-data-based-an-field-value-through/m-p/1524240#M7204</guid>
      <dc:creator>TobyChapman</dc:creator>
      <dc:date>2024-08-20T09:41:33Z</dc:date>
    </item>
    <item>
      <title>Re: buffer point data based an field value through script in notebook</title>
      <link>https://community.esri.com/t5/developers-questions/buffer-point-data-based-an-field-value-through/m-p/1524332#M7205</link>
      <description>&lt;P&gt;Hi Toby,&lt;/P&gt;&lt;P&gt;The create_buffers task will return a &lt;A href="https://developers.arcgis.com/python/api-reference/arcgis.features.toc.html#arcgis.features.FeatureCollection.query" target="_self"&gt;FeatureCollection&lt;/A&gt; object (when no output_name is supplied). You can use the query method to iterate through each of the features returned in the response.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;result = features.use_proximity.create_buffers(input_layer=layer, distances=[tpr_value], units="Meters", dissolve_type="Dissolve")

for feature in result.query():
    print(feature.geometry)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let us know if this helps or if you have any questions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Aug 2024 12:36:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/buffer-point-data-based-an-field-value-through/m-p/1524332#M7205</guid>
      <dc:creator>MarkTorrey</dc:creator>
      <dc:date>2024-08-20T12:36:32Z</dc:date>
    </item>
    <item>
      <title>Re: buffer point data based an field value through script in notebook</title>
      <link>https://community.esri.com/t5/developers-questions/buffer-point-data-based-an-field-value-through/m-p/1524952#M7206</link>
      <description>&lt;P&gt;That worked great thank you.&amp;nbsp; The next thing I am trying to do is to convert this buffer into a polygon and add it as a new feature to another feature layer I have.&amp;nbsp; I have tried the following code:&amp;nbsp;&lt;/P&gt;&lt;P&gt;target_layer_url = &lt;SPAN class=""&gt;"&lt;A href="https://services.arcgis.com/your_service_id/arcgis/rest/services/your_layer_name/FeatureServer/0" target="_blank" rel="noopener"&gt;https://services.arcgis.com/your_service_id/arcgis/rest/services/your_layer_name/FeatureServer/0&lt;/A&gt;"&lt;/SPAN&gt; target_layer = FeatureLayer(target_layer_url)&lt;/P&gt;&lt;P&gt;&amp;nbsp;new_features = []&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;# Iterate through the features in the result and add them to the target layer&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;for&lt;/SPAN&gt; feature &lt;SPAN class=""&gt;in&lt;/SPAN&gt; result.query():&lt;/P&gt;&lt;P&gt;buffer_geometry = feature.geometry&lt;/P&gt;&lt;P&gt;buffer_feature = Feature(geometry=buffer_geometry)&lt;/P&gt;&lt;P&gt;new_features.append(buffer_feature)&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;# Add all the new buffer features to the target layer at once&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;response = target_layer.edit_features(adds=new_features)&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;# Check if the operation was successful&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;if&lt;/SPAN&gt; &lt;SPAN class=""&gt;'addResults'&lt;/SPAN&gt; &lt;SPAN class=""&gt;in&lt;/SPAN&gt; response &lt;SPAN class=""&gt;and&lt;/SPAN&gt; &lt;SPAN class=""&gt;all&lt;/SPAN&gt;(result[&lt;SPAN class=""&gt;'success'&lt;/SPAN&gt;] &lt;SPAN class=""&gt;for&lt;/SPAN&gt; result &lt;SPAN class=""&gt;in&lt;/SPAN&gt; response[&lt;SPAN class=""&gt;'addResults'&lt;/SPAN&gt;]):&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;print&lt;/SPAN&gt;(&lt;SPAN class=""&gt;"All buffer polygons successfully added to the feature layer."&lt;/SPAN&gt;)&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;else&lt;/SPAN&gt;:&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;print&lt;/SPAN&gt;(&lt;SPAN class=""&gt;"Failed to add some or all buffer polygons to the feature layer."&lt;/SPAN&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I keep getting this returned:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN class=""&gt;TypeError&lt;/SPAN&gt;                                 Traceback (most recent call last)
&lt;SPAN class=""&gt;/tmp/ipykernel_338/3308212656.py&lt;/SPAN&gt; in &lt;SPAN class=""&gt;&amp;lt;cell line: 0&amp;gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;()&lt;/SPAN&gt;
&lt;SPAN class=""&gt;      1&lt;/SPAN&gt; &lt;SPAN class=""&gt;for&lt;/SPAN&gt; feature &lt;SPAN class=""&gt;in&lt;/SPAN&gt; result&lt;SPAN class=""&gt;.&lt;/SPAN&gt;query&lt;SPAN class=""&gt;(&lt;/SPAN&gt;&lt;SPAN class=""&gt;)&lt;/SPAN&gt;&lt;SPAN class=""&gt;:&lt;/SPAN&gt;
&lt;SPAN class=""&gt;      2&lt;/SPAN&gt;     buffer_geometry &lt;SPAN class=""&gt;=&lt;/SPAN&gt; feature&lt;SPAN class=""&gt;.&lt;/SPAN&gt;geometry
&lt;SPAN class=""&gt;----&amp;gt; 3&lt;/SPAN&gt;     buffer_feature &lt;SPAN class=""&gt;=&lt;/SPAN&gt; feature&lt;SPAN class=""&gt;(&lt;/SPAN&gt;geometry&lt;SPAN class=""&gt;=&lt;/SPAN&gt;buffer_geometry&lt;SPAN class=""&gt;)&lt;/SPAN&gt;
&lt;SPAN class=""&gt;      4&lt;/SPAN&gt;     new_features&lt;SPAN class=""&gt;.&lt;/SPAN&gt;append&lt;SPAN class=""&gt;(&lt;/SPAN&gt;buffer_feature&lt;SPAN class=""&gt;)&lt;/SPAN&gt;
&lt;SPAN class=""&gt;      5&lt;/SPAN&gt; 

&lt;SPAN class=""&gt;TypeError&lt;/SPAN&gt;: 'Feature' object is not callable
&lt;BR /&gt;&lt;BR /&gt;As you can probably tell, I don't have alot of experience in coding.  any help would be greatly appreciated&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Aug 2024 07:02:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/buffer-point-data-based-an-field-value-through/m-p/1524952#M7206</guid>
      <dc:creator>tendtreesTC</dc:creator>
      <dc:date>2024-08-21T07:02:51Z</dc:date>
    </item>
    <item>
      <title>Re: buffer point data based an field value through script in notebook</title>
      <link>https://community.esri.com/t5/developers-questions/buffer-point-data-based-an-field-value-through/m-p/1525358#M7207</link>
      <description>&lt;P&gt;From the error message, it looks like you just need to add an uppercase &lt;STRONG&gt;F&lt;/STRONG&gt; to &lt;FONT color="#FF0000"&gt;&lt;EM&gt;f&lt;/EM&gt;&lt;/FONT&gt;eature(geometry=buffer_geometry)? Other than that it looks good and should run...&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MarkTorrey_1-1724268413221.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/113154i21D835F95A78D594/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MarkTorrey_1-1724268413221.png" alt="MarkTorrey_1-1724268413221.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MarkTorrey_0-1724268233037.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/113153iD622B8BF6409928E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MarkTorrey_0-1724268233037.png" alt="MarkTorrey_0-1724268233037.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Aug 2024 19:28:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/buffer-point-data-based-an-field-value-through/m-p/1525358#M7207</guid>
      <dc:creator>MarkTorrey</dc:creator>
      <dc:date>2024-08-21T19:28:13Z</dc:date>
    </item>
    <item>
      <title>Re: buffer point data based an field value through script in notebook</title>
      <link>https://community.esri.com/t5/developers-questions/buffer-point-data-based-an-field-value-through/m-p/1525657#M7208</link>
      <description>&lt;P&gt;Thank you Mark, the buffers have now been created and loaded into my feature layer however all the polygons have been created as a single item instead of one item for each tree.&amp;nbsp; My code is below.&amp;nbsp; I tried to add a filter but that hasn't seem to work.&amp;nbsp; I'm also wanting to pass the attribute data from my point layer to the new polygon layer if you are able to assist with this also?&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080"&gt;from arcgis.gis import GIS&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#000080"&gt;gis = GIS("home")&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080"&gt;from arcgis.features import FeatureLayer&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#000080"&gt;feature_layer_url = "&lt;A href="https://services-ap1.arcgis.com/fmr3nGZRGUm3hVAY/arcgis/rest/services/Development_site_application/FeatureServer/0" target="_blank"&gt;https://services-ap1.arcgis.com/fmr3nGZRGUm3hVAY/arcgis/rest/services/Development_site_application/FeatureServer/0&lt;/A&gt;"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#000080"&gt;layer = FeatureLayer(feature_layer_url)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080"&gt;tree_id_to_process = 5 &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080"&gt;features = layer.query(where=f"tree_ID = {tree_id_to_process}", return_geometry=True)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#000080"&gt;print (features)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080"&gt;if not features:&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#000080"&gt;print(f"No tree found with tree_ID = {tree_id_to_process}")&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#000080"&gt;else:&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#000080"&gt;# Assuming only one tree point should be returned, handle accordingly&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#000080"&gt;feature = features.features[0] # Get the first (and hopefully only) feature&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#000080"&gt;tpr_value = feature.attributes['tpr'] &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080"&gt;from arcgis import features&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#000080"&gt;from arcgis.features import FeatureSet&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080"&gt;result = features.use_proximity.create_buffers(input_layer=layer, distances=[tpr_value], units="Meters", dissolve_type="None")&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080"&gt;for feature in result.query():&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#000080"&gt;print(feature.geometry)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080"&gt;# Define your target layer&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#000080"&gt;target_layer_url = "&lt;A href="https://services-ap1.arcgis.com/fmr3nGZRGUm3hVAY/arcgis/rest/services/Development_site_application/FeatureServer/4" target="_blank"&gt;https://services-ap1.arcgis.com/fmr3nGZRGUm3hVAY/arcgis/rest/services/Development_site_application/FeatureServer/4&lt;/A&gt;"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#000080"&gt;target_layer = FeatureLayer(target_layer_url)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080"&gt;new_features = []&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080"&gt;response = target_layer.edit_features(adds=new_features) # Corrected method name to `edit_features`&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080"&gt;# Check if the operation was successful&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#000080"&gt;if 'addResults' in response and all(result['success'] for result in response['addResults']):&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#000080"&gt;print("All buffer polygons successfully added to the feature layer.")&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#000080"&gt;else:&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#000080"&gt;print("Failed to add some or all buffer polygons to the feature layer.")&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Aug 2024 11:10:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/buffer-point-data-based-an-field-value-through/m-p/1525657#M7208</guid>
      <dc:creator>tendtreesTC</dc:creator>
      <dc:date>2024-08-22T11:10:17Z</dc:date>
    </item>
  </channel>
</rss>

