|
POST
|
[The F:\Data\Reg09\update1\ workspace is read only.] ERROR 010067: Error in executing grid expression. Failed to execute (ZonalStatisticsAsTable). It looks to me like you are running into file-locking issues. If you are viewing the workspace in another application (say, you're running the tool in IDLE and viewing the workspace in ArcCatalog or ArcMap), and have a table open, if you try to overwrite it using your script, Windows will not give you security to do so. ArcMap for example has set a lock, and IDLE cannot overwrite the table. If you have Windows Explorer open in the folder, you can often see the lock files that Windows writes to keep track of those locks. These KB articles have some useful information about file locks. Why am I getting schema locks on shapefiles? FAQ: Why do file geodatabase .lock files remain after a process is finished
... View more
04-11-2012
10:36 AM
|
0
|
0
|
2915
|
|
POST
|
My python code is below....any suggestions on how to modify this code? I should add that sometimes this script runs and sometimes not. What does "sometimes not" mean? Is there any kind of error message? If ArcMap is crashing (this would be a memory leak), an approach that may help make your script more stable is to use the Python garbage collector:
import gc
gc.enable()
While we're talking code, your use of "strip" may not do exactly what you want. The best way to remove file extensions is the os.path.splitext() function:
os.path.basename(os.path.splitext(path)[0])
... View more
04-11-2012
09:03 AM
|
0
|
0
|
2915
|
|
POST
|
However, the Aggregate tool does not provide the Environment Settings option when used in Model Builder. Dre, I believe you're looking in the wrong place, the "Environments" button on the tool dialog is only available when you run a tool interactively. Within ModelBuilder, right click the tool and pick Environments. ALso, the nice thing about Model Builder is you can also associate environment settings with other elements in the model. Arc 10 Help: Setting environments for a model process
... View more
04-09-2012
12:17 PM
|
0
|
0
|
866
|
|
POST
|
I should mention I still have 9.3, if this makes a difference. If you still are at 9.3, you can't use these (excellent) updates Steve mentions. I can't think of an easy workaround off the top of my head that does what you want. One approach to fill in holes to consider is the Nibble function. This will fill in NoData errors irregardless of how big they are. A hybrid approach of doing focal statistics, followed by nibble to fill in the remaining holes may be your best approach.
... View more
04-09-2012
12:14 PM
|
0
|
0
|
1474
|
|
POST
|
I sent to the geoprocessing team my problem Note, you will most likely not hear back, this is an automated dialog that collects information using a web robot. If you want assistance from Esri Support, you need to contact them at support.esri.com and open an incident. Arc 10 Help: Frequently asked questions about error reporting ArcGIS Blog: ArcMap Crashed? Send us your report!
... View more
04-09-2012
12:04 PM
|
0
|
0
|
857
|
|
POST
|
I agree with Dan - the spatial distribution of your input points is not appropriate for IDW, which works best with more evenly distributed points that do not fall on a line. With all your points on a line like that, you should choose another interpolator that may be more appropriate for your data, for example, Trend.
... View more
04-09-2012
11:55 AM
|
0
|
0
|
2965
|
|
POST
|
Thanks for the response. To clarify, I am trying to iterate through feature class using OID, but would like to return Name field in output. sp. Clip%Name% is this possible? In ModelBuilder 10.x you can access this value from the feature layer output for the iterator using the Get Field Value tool. The output of that tool will be the value (say, %Name%) you can use in the output file name. Another approach I've used is include the OID and name field in the iterator - then you can parse the value out of the iterator label element using the Calculate Value tool. For example on an iteration the iterator label element may be "1_Foo", you can then use Calculate Value to get the value using this expression: r"%Value%".split("_")[1] the above expression returns "Foo" if Value is "1_Foo".
... View more
04-09-2012
08:53 AM
|
0
|
0
|
4515
|
|
POST
|
The script you found looks like an easier approach than I came up with, in fact it seems to implement the 10.x iteration in the 9.x Model Builder without having to futz with Calculate Value python code. I'm guessing the tool you found is the Iterate Field Value Model Example - Case Study in the Geoprocessing Model and Script Tool Gallery. This tool is really well documented. I suggest following its help - this is a better solution than I posted. As for your error message, I'm guessing "%n%" is not a valid argument, since it is a reserved read-only variable that evaluates to a number.
... View more
04-09-2012
08:41 AM
|
0
|
0
|
2589
|
|
POST
|
I know how to do this, but i don't know how to iterate the model to automatically take separately every single rectangle (i mean every record of that table) of the fishnet and to follow the pre-mentioned procedure and make me separate tables of frequencies based on the id of every rectangle. This is much more difficult using 9.3 of course. On each iteration you want to calculate your select expression using the Calculate Value tool. You also need to name your output with a name including %n% (or a value derived from that using another Calculate Value) so the outputs will not overwrite on each iteration. I think the easiest way to run the iteration is to number your fishnet polygons with a field from zero to N. Then you can easily calculate a select expression using %n%, for example "FISHID = %n%". After you do the selection, run Get Count and in the model properties set your Get Count output to be the a while condition (the model will loop until your count variable is false (zero)) There's an example of using Get Count to stop the model in the online help.
... View more
04-06-2012
10:50 AM
|
0
|
0
|
2589
|
|
POST
|
I am needing help determining syntax of inline variable to use string from field name instead of 1..2...3.. Your question is unclear to me. Have you tried looking at %Value%, which has the value for each iteration?
... View more
04-05-2012
10:22 PM
|
0
|
0
|
4515
|
|
POST
|
I tried switching selections, but that raised an error on SelectLayerByAttribute - module has no attribute This was my bad. Still getting used to arcpy syntax, which if you don't import the managment module requires you to specify it: SelectLayerByAttribute_management I repaired the code sample above.
... View more
04-05-2012
07:14 AM
|
0
|
0
|
7293
|
|
POST
|
I want to check if any features in a feature class are selected, and exit the script with a message to the user if they aren't. I think a good approach to try would be to switch the selection. UPDATE: code repaired to add "_management" to tool call, see post below # check how many parcels are selected
count1 = int(arcpy.GetCount_management("Parcel").getOutput(0))
arcpy.SelectLayerByAttribute_management("Parcel","SWITCH_SELECTION") # switch selection
count2 = int(arcpy.GetCount_management("Parcel").getOutput(0))
arcpy.SelectLayerByAttribute_management("Parcel","SWITCH_SELECTION") # switch it back
# if no parcels are selected, inform user and exit script
if count1 == 0 or count2 == 0:
arcpy.AddError("No features selected! \n Please select at least one parcel feature. \n")
arcpy.AddError("Quitting the Create Case tool \n")
else:
....
... View more
04-04-2012
08:48 PM
|
0
|
0
|
7293
|
|
POST
|
As a starting point, I have tried doing feature area to envelope area ratios and feature area to feature perimeter ratios, which identify some of the features. You're on the right track as the area / perimeter ratio is a time-tested approach to select polygons for removal using the Eliminate tool. (I'm thinking back to the original ARC/INFO ELIMINATE command back in the 1980s.) Unfortunately the "cutoff" you use is highly data and processing flow dependent.... it really depends on your data and trial and error is the only sure fire way to get what you want. Your picture looks like polygons that started out life in the raster domain (albeit projected) so I would be remiss not to mention that there is a raster approach to this using the tools Region Group, Zonal Geometry, and Nibble. A raster approach may be much more efficient than the vector equivalent because of the inherent benefits of the raster data model. If you want to remove "long, narrow" parts of your area features, there are raster tools will suited to that as well. In fact, that would be much easier to do in raster. See the help for the Generalization toolset for more information.
... View more
04-04-2012
08:39 PM
|
0
|
0
|
2444
|
|
POST
|
I'm trying to create coincident (shared) vertices for all intersecting features. Josh, you may want to try the Integrate tool, if these features are all in a single feature class. Topology of course give you more control, but Integrate may do what you need.
... View more
04-03-2012
10:48 PM
|
0
|
0
|
719
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 08-11-2021 01:26 PM | |
| 5 | 12-10-2021 04:58 PM | |
| 1 | 02-27-2017 09:30 AM | |
| 2 | 12-04-2023 01:05 PM | |
| 1 | 04-12-2016 10:17 AM |
| Online Status |
Offline
|
| Date Last Visited |
06-19-2024
12:10 AM
|