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

Have a look at the Reclassify tool (Spatial Analyst).


2

Use Summary Statistics with the first field being the case field and use the maximum of field 2. arcpy.analysis.Statistics(in_tab, out_tab, [['Field2', 'MAX']], 'Field1')


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

Use the ModelBuilders' Calculate Field to insert a python code like this: Expression: calculate(!Field1!, !Field2!) And a code block of: previousValue1 = "" previousValue2 = "" previousUnchangedValue1 = "" def calculate(field1, field2): global previousValue1 global previousValue2 global previousUnchangedValue1 #First item in list if not ...


2

as written, the function returns a string with 'Nearby:' removed only if the 'Nearby:' test is true (if 'nearby:' exists within the field string. If the test is false, the function is set to 'pass', which returns no value (deleting the original value in the process) to remedy, a value should be passed for both cases - true and false - something like def ...


1

I haven't tested this but I don't there would be any problem. I suggest to simply test the code with two MessageBox: public class Tool1 : ESRI.ArcGIS.Desktop.AddIns.Tool { public Tool1() { } protected override void OnUpdate() { Enabled = ArcMap.Application != null; } protected override void OnMouseDown(MouseEventArgs ...


1

There is a much simpler way using a Dictionary object. To be accessible/updateable for each iteration it must be outside the scope of the function (global) otherwise it's reset for each calculation. preDict = {} def CalcField3(Field1,Field2): global preDict # tell python this isn't a new variable but the other one if preDict.has_key(Field2): # if ...


1

I think you're trying to create is working with Geocoding in ArcGIS. Here is a video tha you can follow the instructions to do the geocoding in ArcGIS. But before that you need to parse your XML data to get just the address. You can do it using a simple code using Python (it's installed by default when you install ArcGIS). Is that make sense for you?


1

What you are identifying in your image is a ToolPalette not a Button or Menu. So use the AddIn Wizard to create your Buttons that you want to see in the ToolPalette then create the ToolPalette and add the buttons by their ID. Below is some demonstration code to get you going. <ESRI.Configuration xmlns="http://schemas.esri.com/Desktop/AddIns" ...


1

8.9 is the 98th percentile which QGIS computes by default for the rendering. If you change to min/max and press Load, QGIS computes 21.9, just like Arc.


1

A UTM projection uses eastings and northings with units of metres, which look like the ones you have shown. To get Latitude and Longitude, you need to reproject it. In the ArcToolbox: Data Management Tools > Projections and Transformations > Feature > Project And for the Output Coordinate System, choose: Geographic Coordinate Systems > World > WGS ...


1

According to the Help file image is not an attribute of a menu element. In fact I cannot think of any menu on the ArcMap interface that behaves in this manner, i.e. has an image instead of a word, despite being able to change it to an image via the customize mode. So it's not a property you can define in the config file. Now I may be wrong, others can ...


1

Assuming "Nearby:" is at the beginning of the line (and never in the middle), you can simplify this logic with a one-liner, without the need of a codeblock: str(!Street1!).replace('Nearby:', '').lstrip()


1

If the purpose is to link data found in an attribute table to and excel file where the spatial information isn't necessary it may be best for you to export the attribute table as a .dbf. You can drag and drop the file into an open excel table (2010 maybe earlier), once the file is open in excel you can do all of your joining within excel and not ArcMap. It ...


1

You need to understand that ArcMap data is stored like a database instead of like a spreadsheet and so you need to use the tools ArcMap provides to efficiently get data in/out of it. There is a pretty thorough guide here on how to work with excel data in ArcMap. The actual function you are likely looking for is Excel to Table edit: or try converting your ...


1

Rather than playing with conditional statements (which are fine, but not necessary here), I would just do the following in raster calculator: ("raster.tif" * 0) + 1 Simple and effective.


1

You can use a conditional statement in the raster calculator as follows: Con("your_raster.tif" >= 12, 1, "your_raster.tif") This command assigns any value greater than or equal to 12 a value of 1.


1

I suspect that the default location into which outputs of your geoprocessing tools are written, has been reset by the upgrade. Next time you run a tool pay careful attention to the workspace into which the output is being written, and check that against the source of any layer that you are expecting it to overwrite.



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