One thing that makes writing WHERE clauses a lot easier is to use the AddFieldDelimiters function, which automatically adds the correct, DBMS-specific delimiters for field identifiers, such as double-quotes for FGDB and brackets for PGDB.
The other thing you have to consider is whether the value is a number, string, or other data type. Specifically, strings ...
I would try Repair Geometry first, like you have, but I think the TopoEngine error message is spurious and really this is a resources issue.
Copying the data to a new file geodatabase has sometimes got me past this error so try that first.
Other things I try are rebooting before retesting, running the tool from ArcCatalog or a Python IDE or the command ...
Based on the code you have copied, it looks like your error is arising from how you have entered the file path for your arcpy.env.workspace variable.
Here is what you entered
arcpy.env.workspace = r"C:\\Temp\\MuleDeer\\AllKLM5.gdb"
For comparison, here is what you entered for the local variable gdb location:
AllKLM5_gdb = "C:\\Temp\\MuleDeer\\AllKLM5.gdb"...
Couple of suggestions:
Run Check Geometry tool on your layer that you wish to clip, you could then follow that up with a Repair Geometry if it finds errors. You may wish to do that on a backed up copy.
Check whether the coordinate systems are different. Perhaps you are trying to Clip a dataset in Decimal Degrees with a dataset that is in Meters or vice ...
FeatureLayers and RasterLayers are layers created in memory, not in the scratch workspace (in background processing they create a file referencing the memory position but that is all).
In order to remove those layers residing in memory, you need to explicitly delete them one by one using arcpy (they do not fall out of scope until Python exits). Note that ...
I can see from your field name !DEAD_VOL_PER_HA_SPP1_125! that the field you are calculating is likely a float or integer type field. Assuming this is true, you cannot write a space or '' into a number-based field (e.g. return ''). Valid values for number-based fields include None or a numeric value.
You will need to either create a new text field to ...
The Dissolve tool can create a Godzilla by combining smaller (but still fairly large) features into one feature. This is known as the combinatorial problem. The Dissolve tool has logic that prevents it from creating a Godzilla (you’ll receive the warning code 000059) but this logic is based on the machine’s available memory at the time Dissolve is run. So, ...
The issue is in the interpretation:
Expands out to the name of the feature class so the field calculation is looking for a field that matches the name of the feature class, is unable to find one, then returns an error as no field called MCD43B3.A2002001.h21v09.005.2007114212806.hdf.tif exists in the feature class.
To use the name of the feature ...
The built-in Feature Class to Feature Class tool does everything you want.
If you want more control than that, you can create a script tool and customize its validation behavior if necessary (for example, to list all the unique values of a chosen field).
To simply provide a drop-down of available fields you don't need to customize the behavior, just set up ...
With cursors and the "SHAPE@" token, a geometry object is returned. The getPart() method returns an Array containing all the points for that particular part.
Interestingly, field calculator also returns a geometry object, but the getPart() method does not appear to return an array, although it is something similar. Maybe an unpacked array?
Luckily, arcpy ...
I had a similar problem with the Tabulate Intersection tool (using 10.4). I found the suggestion to place the resulting table into a geodatabase from here: https://geonet.esri.com/thread/13680
It fixed the problem!
Try PatchFinder from the ESRI Support site.
Also before you go too far down that rabbit hole you might just uninstall and reinstall ArcGIS on the problem machine. It's likely not a reproducible error if it only happens in a 400-element model.
It looks like you've mixed up the usage of the 'old' cursors (arcpy.SearchCursor) and 'new' cursors (arcpy.da.SearchCursor).
You are using the 'old' cursors, so you need to pass the name of the field to getValue, not the field index.
So in your case, change row.getValue(1) to row.getValue(fields).
Also, there's no need to have all of the or statements ...
You should change "Log" to "math.log" .
If you want to use your code in Field Calculator, just use formula in it:
In Python IDE:
You need to assign "PYTHON_9.3" to the last parameter of the "arcpy.CalculateField_management".
Don't forget import arcpy in the beginning of ...
While I couldn't solve the original problem with the tool Extract Values to Points (Spatial Analyst), I was able to instead use the tool Extract Multi Values to Points (Spatial Analyst).
This tool worked with no issues and instead of creating a new output, it simply appended the DEM elevation values to my existing point file.
The problem is that your code defines raster_outputpath but you try to save the raster in raster_output.
Change this line:
arcpy.PolygonToRaster_conversion(featureClass, "CLASS", raster_output, "CELL_CENTER", "NONE", "30")
arcpy.PolygonToRaster_conversion(featureClass, "CLASS", raster_outputpath, "CELL_CENTER", "NONE", "30")
This code should return what is being asked. It will succinctly traverse all feature classes and tables in a workspace GDB/FS and return all fields associated with a domain, the field name, and the feature class/table it belongs in.
for dirpath,dirnames,files in arcpy.da.Walk( # the path to your workspace
I believe the problem might be in your coordinate system definitions -- ref. the Project Raster help page.
The coordinate system to which the input raster will be projected. The
default value is set based on the Output Coordinate System environment
Valid values for this parameter are
A file with the ".prj" extension (the prj ...
You're tripping over your own feet here.. All cursors need to be removed or they will lock the data; until you free the cursor you could still go back to it at any stage.
In your code you're using a mixture of old and new style cursors, I wouldn't, try to stick to one or the other. They both work but I would use arcpy.da cursors exclusively. Older style ...
This is what I imagine Matt Wilkie had to look up and write to augment Brian's code. I had to get all domains for tables, feature classes in the root directory of a database, and features in all feature datasets. I exported the information as a csv to allow some other workers to clean up our geodatabase environments of old domains.
With respect to the line throwing the error: value = row.getValue(field)* row.UNpctOfEd maybe check the data type or value in each of the f and UNpctOfEd fields? Check note 1 below.
If all input fields are similarly named, you might also want to generate your fieldList with the List Fields function instead of typing it out:
# list fields for calculations
We rarely used the Toolbox within ArcGIS 10.x.
The problem was with several bugs in the Toolbox's Python script.
We have fixed the problems and now it works with ArcGIS 10.x.
If you need the fixed toolbox, do not hesitate to contact me and I will send it. (I am one of the authors.)
Without knowing your particular dataset, I can't say for sure what the issue might be, but I know I had a similar issue working with some smaller CSV files where it got part way through the CSV and then quit with an error. What I finally determined was that in one of the fields/columns most of the values were a single numeric value 1 - 9, but I found out ...
In this case the error means "trouble parsing input file". There are actually 3 problems here. I'm not sure if the 99 problem would have cropped up with any single one or whether it requires a constellation.
Mix and match white space delimiters. Rows were using tabs while the header which was added manually used spaces (in Notepad++ hit the "show all ...
Following the link you provided it is clear from the screenshots (always good to include those!) for the answer you have ticked as correct that you are projecting your raster into a file geodatabase.
Thus a raster name such as DEM_%value%.tif is invalid as you cannot store tifs in a file geodatabase. Simply edit the tool output to not be a file geodatabase ...
In your second version, you've mixed cursors and CalculateField_management(). They don't work together in this way. CalculateField_management() will change the value for ALL RECORDS*, and pays no attention to what is happening in your cursor.
You should use either an UpdateCursor (NOT a SearchCursor) OR use a CalculateField_management(). Not both.
ArcGIS often throws a topoengine error when it runs out of memory while running in 32 bit mode and performing overlay operations. To get around that I either chop-up the job or use 64 bit geoprocessing with lots of RAM and Repair Geometry on all input features (create local copies first if you don't want to mess up your inputs with the repair).
To answer the question of handling feature classes with subtypes, it is possible with arcpy (10.1+).
arcpy.env.workspace = your_gdb
for FC in arcpy.ListFeatureClasses():
for stcode, stdict in list(arcpy.da.ListSubtypes(FC).items()):
for stkey in list(stdict.keys()):
if stkey == 'FieldValues':
for field, fieldvals in ...