Tag Info

New answers tagged

0

also, the original error, I believe is indicating that setNull is not a method for arcpy.da.UpdateCursor, but it is a method for arcpy.UpdateCursor (no "da").


1

Here is the working code updating one of two dictionaries based on common keys: Mesh_dict={} Point_dict={} Mesh = open (r'short3.txt','r+') for row in Mesh: # extract lines describing one type of geometry if row.startswith('ND'): Inline= row.split() IDM = Inline[1] ZM = Inline[4] # actualise the dictionary of original data ...


0

The above solution works only without Groups. To recursively check layers you can use the following solution: extend the ol.map with recursive layer walker: MyMap = function(opt_options) { ... /** * gets layer of map by layer id * @method getLayerById * @param {number} layer_id the ID of the layer */ if(ol.Map.prototype.getLayerById == undefined) ...


3

When you're trying to assign the key to mesh_dict in the first loop you're actually overwriting it with a new dictionary on every iteration of the loop. Instead you should define the dictionary outside the loop and then set the dictionary values like so: mesh_dict {} for row in Mesh: if row.startswith('ND'): Inline= row.split() ...


0

It looks like your second upload may have chosen different column types than your initial one. If (hopefully) your new data is in fact all the same types as the original, an explicit cast should be sufficient to achieve your ends. Make sure you reference the columns from the update table in the same order they appear in the original table. insert into MYdb ...


0

When you are running an update, there is no need for a subquery with a SELECT. This is the cause of the more than one row returned by subquery used as an expression error, as the SELECT will return multiple rows. Instead, you want: UPDATE table_name SET shape_area = ST_Area(the_geom::geography)*0.00024711; which will update your table on a row by ...


3

You could define your feature classes in a list, and looop through it and then perform the update cursor on the common fields. Here is some mock code: arcpy.env.workspace = 'C:\Users\cbgibson\AppData\Roaming\ESRI\Desktop10.2\ArcCatalog\TEST_WSdata.sde' fcList ['WATERLINES', 'HYDRANTS', 'VALVES', 'AIR_RELEAS'] for fcName in fcList: with ...


0

I would suggest a different method to accomplish this task. If you want to delete identicals as long as a particular field is not null, I'd create a feature layer with records where this is the case, and then perform your delete. This would accomplish your task without a cursor: FC = r'C:\Scripts\Drilling_Rig_Deduplication\Drilling_Rigs.gdb\MERGED_RIGS' ...


3

Your current tool would runs "delete identical" as many times as you have a row with a value in field_name. Here is a suggested workaround to achieve what you try to do : 1) select all rows without value for the field_name 2) calculate an unique temporary value for those field (e.g. "temp_"+str(!ID!) ) 3) clear selection and run the delete identical 4) ...


0

UPDATE table_without_geoms_name SET the_geom = (SELECT a.the_geom FROM table_with_geoms as a WHERE table_without_geoms_name.parcel_id = a.parcel_id) Of course, you'd need to change the name of your tables accordingly. :-)


1

First, let it be known there are a number of ways someone could go about accomplishing roughly the same goal in this case. For me personally, especially for someone less experienced with arcpy, it would likely be simplest to do roughly the following workflow Convert the CSV file to Table in GDB Join the Table to Point Feature Class Make Feature Layer ...



Top 50 recent answers are included