Select to view content in your preferred language

Updating spatial view rings - Update response: {'success': True} but no update

240
0
03-27-2026 06:52 AM
Labels (1)
TL2
by
Frequent Contributor

I am trying to update my spatial view rings in the service defintion with the script below. It returns 

Update response:
 {'success': True}

but the service does not update.  What am I missing?

 

itemid = "XXXXXXXXXXXXXXXXXXXXXX"
view_item = gis.content.get(itemid)
view_layer = view_item.layers[0]
new_rings = [
    [-107.410893147789, 37.0587069440029], 
                  [-107.735363597039, 37.0894217540605], 
                  [-107.695531014991, 37.0676617431684], 
                  [-107.705664997627, 37.0367398691148], 
                  [-107.789459026389, 37.0351318539168], 
                  [-107.810893147789, 37.0587069440029]  # close the ring
]


update_definition = {
    "adminLayerInfo": {
        "viewLayerDefinition": {
            "filter": {
                "value": {
                    "geometry": {
                        "rings": [new_rings]
                    }
                }
            }
        }
    }
}

update_response = view_layer.manager.update_definition(update_definition)
print("Update response:\n", update_response)

 

Tags (4)
0 Kudos
0 Replies