New answers tagged

1

If you select "table_1" for the Update existing field option, try using this expression: if( "table_2" = 'test', 'y', "table_1") Basically, you're using an IF THEN ELSE statement.


0

I figured it out- I used a da.updateCursor with an SQL query- import arcpy from arcpy import env env.overwriteOutput = True arcpy.env.workspace = "F:/EMILY/TEST/GET_TYPE_TEST/" infc = "SpJoinscript.shp" with arcpy.da.UpdateCursor(infc, "TYPE_1", "TYPE_1=''") as cursor: for row in cursor: row[0] = "OFF_ROAD" cursor.updateRow(row) ...


0

If the field is empty (or NULL), the thing to test is whether the field is None. Try changing the if row.TYPE_1 == "": to if row.TYPE_1 is None:


1

This would have been my solution: import csv results_csv = r"D:\results.csv" # This is the location of the csv containing your results modified_results_csv = r"D:\modified_results.csv" # This is the location of the csv that will contain the modified results header = ["US_NUMBER","Absolute_Distance_ft","DESCRIPTION","FEATURE_TYPE_ID", "Line ...


0

Just a small thing. in addition to embedded cursor loops. Use os.path.join instead of adding text strings together. workspaceTEST = r"C:\Users\Jim\Desktop\TESTSTRM_SWR.gdb" ENV.workspace = workspaceTEST str15096 = os.path.join( workspaceTEST,"STRUCTURES_15096")


6

Never, never, never use embedded cursor loops. Never! It is bad for performance, memory, data safety, etc. It is very, very bad. See my blog on Turbo Charging Data Manipulation with Python Cursors and Dictionaries. Load the look up table into a dictionary with a data access search cursor, then update the other table with an update cursor by matching it ...


0

Being a MapInfo user myself, I think I get what you're trying to say. As far as I know, this is not possible while working with shapefiles, as the associated dbf files do not support it without creating a new column trough a join. Using shapefiles in QGIS will result in the same problem.


1

You say that you "would have to re-do the legend each time" but this is not the case if you have the Legend Properties set to Add a new item to the legend when a new layer is added to the map. The other options on this General tab of the Legend Properties are also worth becoming familiar with for workflows like the one that you are attempting. For more ...


0

You should correct your objectid value type from string to number. your request is here : updates:[{"attributes":{"objectId":"43532","mutcd":"D3-1 (Street sign) - Street Name & Parking Signs","installed":null,"signId":"5912","facing":"N","visibility":"Good","condition":"Good","supportId":"3680","text":" ...



Top 50 recent answers are included