SearchCursor on Web Feature Layer

572
3
Jump to solution
02-02-2022 07:39 AM
Rémy_Gourrat
New Contributor III

Hi,

Is there a specific syntax to use SearchCursor with a web feature layer in an arcgis pro map ?

And after save after edited...

Or another Strategy ?

 

 

with arcpy.da.SearchCursor(fc_name, ["objectid", "globalid", "SHAPE@"]) as ag_search_cursor:


---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
In  [42]:
Line 3:     with arcpy.da.SearchCursor(fc_name, ["objectid", "globalid", "SHAPE@"]) as ag_search_cursor:

RuntimeError: cannot open 'lineaire'
---------------------------------------------------------------------------

 

 

c Thanks for your help

Rémy

0 Kudos
1 Solution

Accepted Solutions
MehdiPira1
Esri Contributor

Hi @Rémy_Gourrat ,

This indicates that the layer (fc_name) is not accessible from ArcGIS Pro's python.

You can do a simple test such as buffering the same layer with python to double check. If still not accessible, you need to make sure you have the permissions to access the feature layer from your machine.

View solution in original post

0 Kudos
3 Replies
MehdiPira1
Esri Contributor

Hi @Rémy_Gourrat ,

This indicates that the layer (fc_name) is not accessible from ArcGIS Pro's python.

You can do a simple test such as buffering the same layer with python to double check. If still not accessible, you need to make sure you have the permissions to access the feature layer from your machine.

0 Kudos
Rémy_Gourrat
New Contributor III

Hi @MehdiPira1 

it was the right way.

I designated my layer like this :

 

fc_name = "lineaire"

 

 

But when i add my feature layer to my map, the webfeature layer become a layer group.

So now, i must design my layer like this and it's running now :

 

fc_name = "myWebFetaureLayer_Name\lineaire"

 

 

MehdiPira1
Esri Contributor

Good to hear that @Rémy_Gourrat 

0 Kudos