Tag Info

Hot answers tagged

2

You could use the Parse Path (ModelBuilder) tool with the input being your MXD. The resulting PATH will be your input to the Create File GDB (Data Management) tool. Below is a simple model showing this. It seems that you cannot use the output value from the Parse path tool as a direct input into the Create File GDB tool. This is probably because the File ...


2

This can be achieved in several steps. Run a Spatial Join for your buffer polygons and road network layers (right-click the buffer polygons layer in the TOC and choose Join and Relates > Join). You will get an output polygon feature class which contains information on how many road features were located (even partially) within the buffered polygons. ...


2

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 ...


2

The introduction of Python toolboxes at ArcGIS 10.1 for Desktop invalidates your four year old statement that all: Toolboxes, and thus their models, are binary. Standard toolboxes are binary but Python toolboxes (*.pyt) are text files. Consequently, I think Python toolboxes should be considered if version control of source code trumps the requirement ...


2

Take a look at this tool Feature Class To Feature Class (Conversion), the help section contains sample scripts if you want to go the arcpy path. Right clicking on the tool reveals a "batch" option, you can set the names how you want.


2

Your sub-model should end with a Collects Value tool (exposed as a parameter). This collects the featureclasses and returns a list to the master model. Your merge tool can take this list as the input.


2

If the model is outside of ArcMap you will first have to use Make Feature Layer tool, then you may use Select Layer by Attribute tool followed by the Delete Features tool.


2

There are many Python modules you can use for manipulating Excel sheets: xlutils; xlwt; openpyxl; xlrd You could use any of those that allow modifications on Excel sheet; developing this piece of code is not dependent on ArcGIS in any way. When you have a chunk of code that does the work for you, you can wrap it to a custom Python script tool (or a Python ...


1

With some help from colleagues and lots of googling I found the answer. If you choose "Insert" --> Model only tools --> Parse Path, and connect the Raster Dataset to this, choose Parse type = Name, and Rename the "Value" output from the ParsePath tool to "RasterName", you will get JUST the Raster name if you change the expression (blue, in jpeg above) to ...


1

Esri has registered 2 duplicate bugs corresponding to your issue: NIM-103740 - When a model with an iterator is run from within ModelBuilder, it completes correctly, but overwrites the outputs when run as a tool; NIM-098729 - In ArcGIS for Desktop 10.2.1, when running a model with the Iterate Feature tool, an incorrect number of outputs are generated ...


1

Please have a look at the second example in here. Most probably your question is related to finding the right term here, which is inline variable substitution.


1

The geopy module is quick and easy for tasks such as this. Straight from the docs: >>> from geopy.geocoders import Nominatim >>> geolocator = Nominatim() >>> location = geolocator.geocode("175 5th Avenue NYC") >>> print(location.address) Flatiron Building, 175, 5th Avenue, Flatiron, New York, NYC, New York, ... ...


1

After input from radouxju, Martin and Hornbydd and some trial and error I found the Python code below to be working. Problem was mainly the os.path.split(image)[-1][:-5] which was replaced with os.path.basename(image).rstrip(os.path.splitext(image)[1]) import arcpy, glob, os from arcpy import sa #spatial analyst liste_a = glob.glob("d:\\folderA\\*.tif") ...


1

If your Have field is of type date and you Needed field type is string, you can do it with the following statement in the field calculator of Arcmap: !DateFieldName!.split( )[1]


1

If you are running a model from within ArcMap or ArcCatalog, go to Geoprocessing>Geoprocessing Options and put a check in the box next to Overwrite the outputs of geoprocessing operations. If you are going to export your model and run it as a Python script, add this line to your script. arcpy.env.overwriteOutput = 1


1

Here is a bare-bones example (borrowing from both Jim and Richard's answers): import arcpy fc = r'C:\junk\FILE_GDB.gdb\Export_output_gdb' # input feature class field1, field2 = 'Distance', 'Type' # fields to sort, and group fcOut = r'in_memory\blah' # output feature class # set up counters bankcount = 0 churchcount = 0 ...


1

I think we can handle this using an arcpy.SearchCursor (I still use the Old School SearchCursor) and usage of the arcpy.Select_analysis() tool. The following is probably inefficient but I hope it helps. This assumes the Banks and Churches layer is held in a File Geodatbase (.gdb): import arcpy BanksAndChurches = r'Path\To\BanksAndChurches\FeatureClass' ...


1

Without seeing the model or the exported Python script it is hard to say this definitively but ... If you have the line below in your Python script: arcpy.env.overwriteOutput = True then it should take care of ensuring that what you try to write can be written. Alternatively, you could use two lines like the following to ensure that the outputFC does ...


1

If your new fields have a pattern in their naming (e.g., [table_name]_y as in your snapshots), you can use inline variable substitution. More specifically, if you change Field Name parameter to %Name%_y, this will transfer all GRID_CODE values to this field in your individual DBFs.



Only top voted, non community-wiki answers of a minimum length are eligible