Tag Info

Hot answers tagged

5

You cannot rename fields in an attribute table. However, you can add a new field and copy the values from the old field to the new one. Finally, delete the old field if you wish. In sum: Add Field Calculate Field Delete Field (optional)


3

Another solution that is in concert with Aaron's solution, arcpy.AlterField_management(r'C:\Data\Garbo.gdb\Khyber', 'oldfieldname', 'newfieldname', 'ALIAS') is the easiest way to achieve this. There is the equivalent geoprocessing tool named "Alter Field" to be used in Model Builder. This tool is available starting with 10.2.1 Before running the model ...


2

In Python, a backslash in a string always signals the presence of a special character. For example, a "\t" will be interpreted as a Tab. I tested your "Calculate Values" expression in ModelBuilder with a path of "C:\Workspace\trash\temp.gdb\poly", and my result was "C:\Workspace rash emp.gdb\poly". Each "\t" was changed to a Tab. To prevent python from ...


2

Go to "Arctoolbox-> data management tool-> Field ", find the "Calculate Field" tool and drag into ModelBuilder, double click the calculate field, input a value which you want to set or use expression to set the value. Hope it works, good luck!


2

It turns that one liners which aren't core python (don't require imports) need to be wrapped in a function: validate("%Field Name%") def validate(s): import arcpy return arcpy.ValidateTableName(s) I thought that since this was in an arcgis model that arcpy would automatically be available, but apparently that's just silly thinking. ;-) /sarcasm ...


2

Feature Class to Feature Class would be your answer. Particularly Field Mapping part is what you are after. If you look at the example below, names of the three fields on the left table are altered to new ones with this tool. One last note, if you have many fields to rename, this approach could be advantageous over the answer in terms of processing speed ...


2

You must have a different version of ArcMap than I'm using (10.2.2), but I got counties along the Texas border just fine (where my state boundary crossed county boundaries, which was not everywhere in New Mexico since my state and county layers are different resolutions): Things to try: Make sure your state boundaries match the county layer visually, ...


2

New answer to an old post, just to clarify how to create a re-usable model to do this. Open the model, Insert-> Model Only Tools-> Calculate Value. In the Expression, type: getuser() In the Code Block, type: def getuser(): import getpass return getpass.getuser() (See "Getting user name in specific format" for source of username code snippet ...


1

Make your current output a temporary dataset and then run Append GP tool to add the results into a final output dataset.


1

Use a try catch to fetch error messages from the gp object. try { GP.Execute("Creation", parameters, null); } catch(exception ex) { Messagebox.Show(GP.GetMessages(<severity>)); }


1

Use the Spatial Join tool with the One to Many option and a Search Radius value of 1000 (assuming your geometry units are already in feet). Your Practice Sales1 will be the Target features and the Practice Stops will be the Join Features. This will duplicate the Practice Sales1 features to match the number of Practice Stops points within 1000 feet of each ...


1

There is a set of add-on ArcGIS Desktop tools (versions 9- 10.2) using network kernel density techniques developed by Professor Okabe available here. http://sanet.csis.u-tokyo.ac.jp/. However they are only licensed for academic use. I used them on my MSc thesis and they worked really well. I guess you could enquire about commercial implementations. ...


1

I was able to convert the numerous tiled contour data files to a CAD format by inserting an additional step into model builder. I used the "Feature to 3D by Attribute" tool and assigned the elevation field as the "Height" field and then converted to .dxf or .dwg One of the first things I did with this contour dataset after projecting it was run it through ...


1

Try the "make feature layer" tool. Connect the output from "Calculate Field" to "Make Feature Layer". You should then be able to connect the output of "Make Feature Layer" into the Dissolve tool.


1

For this, you'll have to project your feature class to determine the values. Check the code below, which creates a NAD27 spatial reference, projects, uses a dictionary to store the desired data, and then updates the feature class with the Xs and Ys. The script assumes there is a unique ID field for your feature class, as well as a NAD27 X and a NAD27 Y field ...


1

As you discovered, a model can have only one iterator, so you can not copy the contents of each submodel having an iterator into one bigger model. Instead, depending on your needs: 1) If the models are totally independed (one model does not create output for the next model), you can simply throw all (sub)models into a "master" model and click run. It will ...


1

I assume that it goes wrong when your model becomes white?! After you've used Dissolve, won't the output be a feature class and thereby not a layer. In modelbuilder Select Layer By Attribute only works with layers. Put in a Make Feature Layer tool after the Dissolve to start a new selection.



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