The Stack Overflow podcast is back! Listen to an interview with our new CEO.

New answers tagged

3

The update query is taking forever because you have introduce a cross join between the point table and a copy of it (UPDATE table1 SET ... FROM table1 AS t1). We can see that in the explain plan with the number of rows to be updated (rows=15 380 552 946 848) When doing an update, each row is processed individually so you don' t need the lateral join. You ...


0

I'm not sure this is the answer to your question, but anyhow. I often regularly change a shapefile externally, in my case when working on a C++ program and effectively using QGIS as the visual part of the debugger :) I removed and reloaded the layer often, now I simply start an editing session and close it. Done, i.e. I get the refreshed shape. This is going ...


0

Using Emil's code I was able to make it work with some alterations. I needed to calculate the field first, then it gave the cursor something to compare it to. Here's the result import arcpy FClass = arcpy.GetParameterAsText(0) Field = arcpy.GetParameterAsText(1) Feature = arcpy.GetParameterAsText(2) Feature1 = arcpy.GetParameterAsText(3) Feature2 = arcpy....


0

The field name ("AccountNo") needs to be in your cursor field inputs. Something like this: for fc in arcpy.ListFeatureClasses("Comps"): arcpy.AddField_management(fc, "Comp_Num", "TEXT", field_length = 10) with arcpy.da.UpdateCursor(fc, ["AccountNo", "Comp_Num"]) as cursor: for acc, comp in cursor: if acc == Feature1: ...


Top 50 recent answers are included