Currently I have a working script that searches for points within a layer that meets two conditions. It then edits a attribute. The script works well, however as soon as I run it, any point which the script edited I am no longer able to view in mapview, webmap or pulling into ArcPro. For example the attribute table will have 17 points within a layer however only 11 of them will be view-able on the map.

Has anyone seen this before with editing layers through Arcgis API for Python

from datetime import datetime
import pandas as pd
from arcgis.gis import GIS

gis = GIS("https://arcgis.com", "username", "Password")

layer= gis.content.get("f829a68708124b6cae95e247500ad31c").layers[0]
leak_point = layer.query("1=1",out_sr=3857)

for f in leak_point:
    if (f.attributes['Leak_Submited'] == 'No' and f.attributes['Leak_Estimate'] < 3):
        f.attributes['Leak_Submited'] ='Yes'
        layer.edit_features(updates = [f])

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.