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. 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)
python
from arcgis.gis import GIS
gis = GIS("home")
```
```python
from arcgis.features import FeatureLayer
layer = FeatureLayer(feature_layer_url)
```python
features = layer.query(where="1=1", return_geometry=True)
```python
geometry=features.features[0].geometry
```python
print (geometry)
```
```python
tpr_value = features.features[0].attributes['tpr']
```
```python
from arcgis import features
from arcgis.features import FeatureSet
# Assuming 'layer' is your input layer from earlier steps
result = features.use_proximity.create_buffers(input_layer=layer, distances=[tpr_value], units="Meters", dissolve_type="Dissolve")
# Convert the result to a FeatureSet
buffered_featureset = FeatureSet.from_dict(result)
# Iterate through the features and print their geometries
for feature in buffered_featureset:
print(feature.geometry)
At this point I keep getting the error:
can anyone help me with this?
TypeError Traceback (most recent call last)
/tmp/ipykernel_703/2622654452.py in <cell line: 0>()
6
7 # Convert the result to a FeatureSet
----> 8 buffered_featureset = FeatureSet.from_dict(result)
9
10 # Iterate through the features and print their geometries
/opt/conda/lib/python3.11/site-packages/arcgis/features/feature.py in from_dict(featureset_dict)
1133 """
1134 features = []
-> 1135 if "fields" in featureset_dict:
1136 fields = featureset_dict["fields"]
1137 else:
TypeError: argument of type 'FeatureCollection' is not iterable