To add a custom toolbox, in ArcMap or ArcCatalog, open ArcToolbox and right click in the white space and go to Add Toolbox:
To see the script, right click on the tool, and go to Edit or Export Script.
If you use Export Script, create a new text file and select it when exporting.
You might need to go into the Geoprocessing menu, and go to Geoprocessing ...
I found a solution that worked for me.
I change setting in the register. Search for 1201 and value 0 (DWORD) at:
Problem running any tool (on Esri's Geonet forums)
I figured out how to do this by using the Make Query Table tool, Copy As Python Snippet, the Python window and the Copy Features tool.
After running the Make Query Table tool to pull through just the fields I wanted to appear in the output I was able to Copy As Python Snippet this code from the Geoprocessing | Results window into the Python window of ArcMap....
You can go to Data Management -> Raster -> Raster Processing -> Clip, and Spatial Analyst is not needed.
There just check the checkbox "Use input features for clipping geometry".
From help: If the checkbox "Use input features for clipping geometry" is checked, then the output raster is clipped based on the perimeter of the polygon shape. If the checkbox is ...
The one important difference that most suggestions omit, and very possibly this is all that's needed to fix this, is that in Zone 0 a new DWORD 1201 MUST be created if it doesn't already exist. In other words changing all the other DWORD values to "0" will not work unless 1201 is also added.
The solution can be found here: https://geonet.esri.com/ideas/...
First of all, thanks for all answers and comments. Unfortunetaly, the existing tools were not fully compatible with the latest versions of QGIS and ArcGIS. Therefore I made my own solution using the tool indicated by @polygeo, the QGIS plugin from @Alexandre and the name of the algorithm (four color map) from @Jens.
Here is my code for those interested (for ...
Quick and short solution:
Please follow this post: REDIRECT: axtiveX error warning
I found a fix for this on ESRI's web site - axtiveX error warning. A staff member came into the thread and confirmed it is a bug in current versions of ArcGIS (at time of writing, 10.5.1 was the latest).
So far we have only seen it affect our 1703 users. ...
As you have discovered, Windows paths contain a single backslash, but in Python a single backslash is an escape character.
You have a few options:
1) You can use a raw string (r"stringgoeshere"), or os.path.normpath(), as detailed in this blog post.
2) In order for Python to understand that a string contains a path you need to use double backslashes.
To get the result you are looking for you need the inputs in your model to be empty when you save it and they both need to be set as parameters. Do this by right clicking on them in model building and choosing 'Model Parameter'.
You can set up everything else, but leave the input and/or target parameters blank. Then when you open the tool the user will ...
I believe the AreaOnAreaOverlayer is the transformer that performs the equivalent of an ArcGIS Union.
Performs an area-on-area overlay so that all input areas are intersected against each other and resultant area features are created and output. The resultant areas have all the attributes of all the original features in which they are contained.
Assuming your tool is always outputting the output file in the same directory, this function will return the next highest-numbered file name:
highest_num = 0
for f in os.listdir(output_folder):
if os.path.isfile(os.path.join(output_folder, f)):
file_name = os.path.splitext(f)
I agree with afalciano.
You can create a model that combines the two tools, that could look like this:
It would give you a interface that offers both selection types:
Don´t forget to set the Selection type of the second selection to "SUBSET_SELECTION"
This model could then be called from a python script importing the toolbox using arcpy.ImportToolbox() ...
This was a simple question that had found difficult to answer. I searched through the Esri documentation, which is usually very thorough, but just overlooked it. I wanted to share my answer here in a concise manner.
In the Parameters dialog, set up a parameter, and set its direction to "output". Set the type to "Derivative" if applicable.
In the script, ...
This help topic discusses some of the raster format limitations for Spatial Analyst: Data formats supported by Spatial Analyst
While it is focused mainly on vector overlay operations, this blog post has many suggestions, including improvements made at 10.1 and 10.1 SP1. In particular, if you are working with very large datasets, then using 64-bit ...
That's just the statistics. By default it is set to the minimum and maximum possible values. If you use the Calculate Statistics tool from the toolbox it should set those to more meaningful numbers.
If you don't want to calculate statistics in your layer properties you can change the minimum and maximum values of the display manually if you have a ...
Based upon your comments in other responses, it sounds like you really just want to alert the user about things that have occurred during the operation of your script, rather than necessarily keep the script dialog box open.
A couple of alternative approaches could be:
Write the pertinent information back to the ArcGIS GP console by adding messages, ...
The only thing I see in your code that could cause this problem is that you are setting the MXD value to "CURRENT", which is fine... IF you have an MXD open (executing the script tool from within ArcMap).
I was able to cause your code to fail with the same response if I tried executing the code form the stand-alone ArcCatalog application. Is that what you ...
I would recommend that you use the (free) extension ArcHydro Tools. It's got a lot more features and ways to tweak your results than the built-in functions.
There is a document here for 10.1 which outlines possible workflows. Although it's a bit different than in 10.0, it should give you a good starting point to get the idea of the software.
Unless you ...
This help topic should get you started -- basically you embed your toolbox in a Python package and install it in your local Python installation. Then your tool should show up automatically under system toolboxes.
ModelBuilder is old, clunky, and is not getting any significant updates with ArcGIS Pro, if this tweet is any indication. I have never been a big fan of it (though begrudgingly still use it when I have to), so you might consider this answer as a sidestepping of the question and a recommendation to look at alternatives.
FME is arguably the most obvious ...
Alternatively, you could proceed as followed:
Use the aggregate tool on your input data to create a coarser raster with the same extent.
Convert the resulting raster to points.
Use these points to sample the original grid.
The key here is the aggregation factor which controls the degree of generalization of your input data, e.g. the spacing of the ...
In my personal experience, no.
Looking at the product matrix, there is also nothing to indicate they would groom their performance as such.
I would suggest running some test cases with the same data, stored locally, on the same computer, with different licenses in order to ...
Every GUI-based tool has a "Tool Help" button on the bottom right. There you will find all of the parameter information. Alternatively, simply clicking on an input area will show necessary information about the parameters.
ESRI has one of the best support sites around. Googling, for example, arcpy Dissolve will bring you directly to the specific support ...
At the bottom of the help page for each tool, ESRI provides a list of the environments that can impact the tool's processing.
For example, the Resample help page does not include Mask in its list. It does not include Cell Size in its list either, because the cell size option that is a direct and required input to the tool would overwrite it anyway.
ArcGIS has to be able to find the Toolbox, but that doesn't mean you have to specify the path each time.
The easiest way may be to just ensure that the toolboxes are in the same folder, and then just use the file name, for example:
If you are running the PythonToolbox tool from within ArcGIS, the directory ...
ArcGIS stores a great deal of a user's preferences in the Windows Registry, which is partially documented in "ArcGIS Desktop Advanced Settings Registry Keys.doc", found in the Utilities folder of your ArcGIS installation. You can browse these settings with the Registry Editor (run regedit), and look into the keys from HKEY_CURRENT_USER\Software\ESRI.
It sounds like you are working with polygons. I created a 4-corner polygon in a FGDB, and when I look at it in the editor, it does have 4 vertices:
However, when I run the following script on it, you can see it does indeed have 5 vertices (as it should), where the first and last are the same in order to close the polygon:
infc = "...
for %i in (*.tif) do gdal_translate -of GTIFF -a_nodata 0 %i %~new_ndata.tif
for %i in (*.tif) do gdal_translate -of PNG -scale -co worldfile=yes %i %~cnvt.png
for i in *.tif; do gdal_translate -of GTIFF -a_nodata 0 $i $i~new_ndata.tif; done;
for i in *~new_ndata.tif; do gdal_translate -of PNG -scale -co worldfile=no $i $i~cnvt.png; ...