Tag Info

New answers tagged

0

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


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


0

The SearchCursor syntax in the previous comments and posts is outdated and 10 times slower than a data access cursor if you have Desktop 10.1 or later. Only use DA cursors. Here is my script, assuming your categories of banks and churches are in the same field in the feature class, this script will get the top ten items for all categories or only specified ...


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


0

Feature Layers are temporary. Your data currently will only exist for the duration of the model. Per ESRI documentation of Make Feature Layer: Make Feature Layer (Data Management): Creates a feature layer from an input feature class or layer file. The layer that is created by the tool is temporary and will not persist after the session ends ...


2

If Shapefile you can only delete (single delete) one feature set. Or use Iterate with Feature Datasets (Geodatabase) Delete Fields http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00170000004n000000


2

Personally I would avoid the batch tool approach. Create a sub-model and cycle through the datasets using an iterator deleting the fields as necessary.


1

This code has not been tested, but it should get you going in the right direction: import arcpy from arcpy.sa import * arcpy.env.workspace = "Path/To/Workspace.gdb" arcpy.CheckOutExtension("Spatial") #Static Variables field = "VALUE" #Build list of years rasters = arcpy.ListRasters("x_*, "ALL") #Loop through names, get year and use it to select rasters ...


0

Sounds like you want to derive a field from a layer, this can only be done in a script tool, it is discussed here. You will need to convert the logic of the model into python code.


1

I think the only way to do this currently is to instruct the user to create a point layer (with one point) which is then used as vector layer input in the Processing model. As far as I know, the Processing scripts and models currently don't provide any user interaction capabilities. If you need user interactions, you can write a plugin instead. The plugin ...


0

You're on the right track, you have two inputs: Main_Lanes Seg1_WZ Which when you want to name other files based on those names, you would reference them as: %Main_Lanes% %Seg1_WZ% However, you want your output to have the same name as your Main_Lanes input, but the issue is you're appending _File to your output parameter name, when you should be naming ...


1

I'm not sure where %Name% is coming from, so I may not be able to answer your question entirely, but wrapping something in exclamation points is how you get a value out a field in a python code block. %Name% is a model builder variable, not a field name. So remove the the exclamation points and just use %Name%[3:] and see if that works.


0

I reading this to mean ignore the Height value and use the Points to Line tool in Model Builder.


1

With instances of ArcMap and ArcCatalog no, each one creates a temp session directory in your %TMP% folder called arc<4 hex digits> like arcA7B0 and is thus unique. For instances of python, yes, it happens frequently. Multiple running instances of python scripts started from command line will cause each other to crash randomly. This limitation does not ...


0

You can actually do this in model builder without python but it is finicky and a bit of a workaround. 1) create your model with the iterators for the first reclass and make the reclass table a parameter in the model. 2) right click on your model and set it to batch. 3) Now you have the reclass table as the parameter. 4) Use the + button to add the number ...


0

Note that you don't need to delete the feature in your case. Just make sure that you use a SQL statement together with your "Make FEature Layer" in order to only select the feature that you want to use for processing. You can also use "select layer by attribute" with the "switch" selection if you have a selection. If you really want to delete, you can use ...


2

You could add a Boolean variable and expose it as a parameter then connect it as a precondition to the Make Feature Layer. This will allow ALL layers to be loaded if TRUE or none of them if FALSE. I don't think you can control each layer as this would require you to interact with the model on every iteration and model builder does not work that way.


3

You need to separate your model into two models. As you have it now, the results table gets created with every iteration. Step 1 needs to be in separate model that calls a sub model, which performs the rest of the steps. Refer to this help file on how to set up nested models.


3

A check box means user interaction so you will need to look at using either a Python script tool / Python toolbox or a Python Add-in. What you are actually needing is called a value table. Have a look at this link in the help doco.


3

You will need to create a boolean variable and define it as a model parameter. This will add a check box option when double clicking on the model. OR Create a script tool that runs your code and has a boolean data type. Either way you will have to check the boolean value using an if statement.


0

I found a way to solved it, is not a very best practice solution though. I did it in 3 separate ways. Using model builder I do a batch slope conversion Using python script I get raster properties (MAXIMUM) and do a mathematic calculation of it then write the result into a dbf file (you need this http://dbfpy.sourceforge.net/) Using model builder I do ...


3

in the code block you'll define a function, and then in the expression, you'll call the function with the needed field names, like so : Code block : def picture_name(current_name, map_number): return current_name[current_name.rindex("\\"):] + "|" + map_number + ".tif" Expression : picture_name(!Pictures!, !MapNumber!) I haven't test this code, ...


-1

There is a cheap add-on called ET GeoWizards for ArcGIS that makes this easy and it does lots of other great tricks. It's built by Ianko Tchoukanski.


2

You have made the classic mistake that people do when they start using an iterator. EVERYTHING runs in a model that has an iterator. So everything up to and including the collects tool must be in a sub model. Expose the collects tool as a parameter. Then drag that model into the master model which has the merge tool. Connect your output from your sub model ...


2

You may use Iterate Feature Selection Iterates over features in a feature class.


0

Yes - I think the way to figure out how to do it is by setting up very simple master and sub models. The master model should do no more than take in a string from its tool dialog and then run the sub-model. The sub-model should take as one of its inputs a string and use that string to perhaps create a shapefile using the string as its name. You should be ...


0

Perhaps the validation issue is where you are editing the models from? ArcGIS gave me trouble if I edited sub-models from the Catalog, but no trouble if I edited them from inside the main model.


0

Also possible to use MERGE each output file to the last, using a feedback loop. http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?TopicName=Iteration_using_feedback



Top 50 recent answers are included