|
POST
|
the process stops at 28% of advance and I get an empty output table. Go to the geoprocessing options and turn off background processing. It may help -- or at least you'll be able to more easily see the error messages (they are in the Geoprocessing > Results too).
... View more
04-11-2011
03:25 PM
|
0
|
0
|
780
|
|
POST
|
In both runs (python script and manually in arccatalog) I'm outtputing to and inputting from the same personal geodatabases - they are not crammed with data so I'm not pushing a data size limit or anything. The elevation derivative rasters are in the IMAGINE image format in the pgdb's. As I said for best performance overall you should read and write directly to grids, specially with tools like this that may be working with large rasters. You do this by writing to a folder workspace with no file extensions used in the output file name. How can you change what you mention regarding current and scratch workspaces? I noticed in my Windows user profile Temp directory (C:\Documents and Settings\...\Local Settings\Temp) that there are some of the g_g_g2 files (or similar) in there. The current and scratch workspace are part of the geoprocessing environment. In Python you do this by setting geoprocessor properties and methods. The main settings i was concerned about performance-wise were the current and scratch workspace, which are in the interface under general settings. gp.Workspace = r"e:\work"
gp.ScratchWorkspace = r"e:\work" Or use a configuration text file of course (saved from an desktop session using Save Environment) with gp.LoadSettings(). Those XML config rues are a really good way to make sure your interactive and outside-ArcGIS script processing were using the same environment. Just to see what happens, I set up a new ArcToolbox Toolbox and added my python script as a script that I could run. I have the script running based on argument input from a "configuration" text file that it reads in, so in this fashion I just double click on the script and click "OK" as there are no variables to set. The script ran in 7 minutes 32 seconds vs. 20+ minutes for my same three test sites, one-third of the total time. It definitely shaved off a bunch of time on the Snap Pour Point and Watershed tool runs (everything else was already reasonably fast so not worried about other tools/functions). I ran the script via ArcToolBox in ArcCatalog, not ArcMap. When you add a script tool to a toolbox and run it, it inherits the GP environment from the desktop session. Including its gp object (if you've checked the box to run in-process). So it's generally faster than "standalone". By the way, a really good way to time to the tools themselves is to print tool messages, which include timings: print str(gp.GetMessages(0)) # for IDLE or PythonWin window
gp.AddMessage(gp.GetMessages(0)) # for ArcCatalog/Map tool messages or Windows command window
... View more
04-11-2011
03:22 PM
|
0
|
0
|
1082
|
|
POST
|
My main question is are you sure this comparison is this apples to apples, ie have you compared the geoprocessing environments between the two, and are you using the tools in ArcCatalog or the (different) arc objects interface in the spatial analyst toolbar. (The environment from the toolbar is different than the GP tool environment.) Note that our gp script running from IDLE or elsewhere outside of ArcGIS does not inherit the default ArcCatalog environment. If you want a current and scratch workspace to be set for example, or have certain toolboxes (besides system toolboxes) loaded, you must set or add them in your script if you are running "standalone." If you are using tools in ArcCatalog, and the ArcCatalog output is a folder and the python output is a geodatabase, the ArcCatalog version may be running faster because only grids are native read/write in 9.3.x, other formats must be copied to/from GRID format before or after tool processing.. Another slowdown can be the fact that from ArcCatalog you don't need to instantiate a geoprocessor, but that usually only affect tool startup time, not processing time. A tip in the raster environment that always makes tools run faster is make sure the current and scratch workspaces are both set to a (local) folder. This saves a lot of extra file copying etc. (Raster tools create a temp file in scratch while they work ("g_g_g2" etc) and rename it as a last step. If your scratch and current workspace are in different places (or current workspace or output isn't a folder) the entire tool output must be copied -- takes a while for a large raster.)
... View more
04-11-2011
01:18 PM
|
0
|
0
|
1082
|
|
POST
|
A task I find myself having to do requires functionality that existed in ArcInfo Workstation's FREQUENCY command. That tool worked pretty much like the ArcGIS Frequency tool except there was an option for a {case_field} that would be added to the input table to make it easy to join the frequency table to the input table later using a single case field. Does anyone have a cookbook example of how to generate such a case field in the input table for each unique combination found? Thanks. (Posted early 2011; updated 5/2015)
... View more
04-02-2011
08:13 AM
|
0
|
19
|
8956
|
|
POST
|
I have had issues with this tool and sometimes have found that the sample tool does the same thing (with more options and can handle multiple rasters at at time). You didn't say which version of arc you are using but there have been fixes over the years.
... View more
03-27-2011
10:26 PM
|
0
|
0
|
4689
|
|
POST
|
A few things to consider: 1) It looks like one of your input datasets does not have a spatial reference defined.Are you sure they overlap? 2) For best results, set your workspace to a folder more friendly to raster processing (no spaces, or non-alphanumeric characters, like: C:\\Workspace) You also probably want to move the toolbox to a "safer" path too. 3) These tools only work on 9.x -- they do not work with 10.x
... View more
02-25-2011
05:39 AM
|
0
|
0
|
2522
|
|
POST
|
not english native speker, hope you understand me. Does anybody know if it's possible to erase outlines in polygon features in many layers only when thay share or they are very close to another polygon feature of another layer, but keeping all the outlines in all the other sides of the polygon, that obviously are not close to that layer? Thank you This is the realm of "Cartographic Representations" - see here in the help: http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/What_are_representations/008t00000002000000/
... View more
02-18-2011
01:29 PM
|
0
|
0
|
380
|
|
POST
|
I've noticed that if I am doing simple addition, subtraction, or multiplication with two grids of different cell-sizes, and I set both the raster analysis cell size and the raster analysis mask to be that of the smaller grid, the output is mangled - it almost looks like it's incorporating the cell size of the LARGER grid into the mask somehow, but I don't really care, it's broken. Workaround is to not set the analysis mask. In the below image (Screenshot attached) you're looking at the results of adjusting four bathymetry MLLW datasets to NAVD88 by adding a Topography of the Sea Surface grid and subtracting a MLLW grid extracted from VDATUM. All grids are in same datum, VDatum grids are 0.0005 degrees, and the bathy rasters are from 0.5 to 4m resolution. . Also I can't believe that there isn't a better place to report bugs. These new forums are like a bowl of spaghetti someone dumped on the floor. If someone found a bug-reporting forum somewhere, please let me know. It's generally problematic in my experience doing raster analysis unless all the participating data sets (data layers, masks, etc) are in the same coordinate system. The cell sizes and extents don't always translate the way you expect -- the best way is to have everything in a projected coordinate system like UTM or Albers. Bug reporting and technical support is available at http://support.esri.com.
... View more
02-18-2011
01:25 PM
|
0
|
0
|
372
|
|
POST
|
Hello, I have been researching ways to count points in polygons and the obvious answer is to use Hawthe's Tools. I have downloaded it, and it works perfectly. My new ambitious task is to create a simple model to calculate some fields in an attribute table. I also want to put this point in polygon geoprocessing task as part of my model. Is there any way to do this? i.e. add the Hawthe tool into the model or is there another geoprocessing task that can handle this? Thanks, Mike I'm guess all of Hawth's tools are accessed from a point and click interface, not in a toolbox. In that case you're out of luck. However, you can count points in polygons by running the Identity tool and piping its output into the Summary Stastistics tool. You can then use Add Field and Add Join and Calculate Field to copy the counts to your table.
... View more
02-18-2011
01:19 PM
|
0
|
0
|
454
|
|
POST
|
- ArcGIS ArcInfo Desktop 10.0 SP 1 - Windows XP64 and Win732 I'm getting a strange error from the Calculate Value tool when I feed it a path variable: Executing: PathTest Executing (Calculate Value): CalculateValue r"C:\Users" # Variant Start Time: Tue Feb 08 12:46:01 2011 ERROR 000539: Error running expression: r"C:\Users" <type 'exceptions.SyntaxError'>: (unicode error) 'rawunicodeescape' codec can't decode bytes in position 2-3: truncated \uXXXX (<string>, line 1) Failed to execute (Calculate Value). I have logged this as incident #896927 - the suggestion was to zap my HKCU registry and profile. Zapping the registry seemed to help, but the problem returns like a bad 70s song. I'm posting it here in case someone else runs into it and finds a solution.
... View more
02-16-2011
01:01 PM
|
0
|
7
|
7369
|
|
POST
|
I would like to have the aggregated cell values be derived by the "Mode" of the original input cells. The options for the aggregate tool include Min., Max, Median, Mean, and Sum., but there is no Mode option.-Andy I was thinking about Block Statistics, but it turns out the Resample tool has a MAJORITY option.
... View more
02-07-2011
11:38 AM
|
0
|
0
|
428
|
|
POST
|
This may be an enhancement request, if I am right that there is no way to do this. I'd like a model tool to return information to the user in a message. I have tried to print messages from the Calculate Value tool with no luck - the message apparently isn't passed along to the models geoprocessing stream. def xxx(): arcpy.AddWarning("This input argument is weak") The workaround I came up with was to return a value like this def xxx(): return "** YOUR INPUT ARGUMENT IS QUITE WEAK **" which at least throws a message that perhaps may be seen by the user of the model tool.
... View more
02-02-2011
09:41 AM
|
0
|
4
|
1689
|