3

Using ArcMap 10.1, I want to use the Apply Symbology From Layer tool, however my field names are not the same. I'm having trouble understanding how to change the Field Names in a layer.

I tried the Make Features Layer tool and it did not rename my variables. My variable names are basically the "LayerName"+"Variable Name".

Has anyone else had this problem?

  • Are you trying to apply symbology from one layer to another, when the fields are different between the two layers? If the symbology is based of a particular field's values, I don't think it's going to work. Fields need to be the same between the two layers. – Emil Brundage Jul 14 '15 at 23:29
  • If the layer you want to add the symbolgy to is in a geodatabase you might want to try adding the field name the symbology is based on as a field alias in ArcCatalog and then running the tool. I have also avoided the symbology transfer tool by saving the source symbology as a lyr file and then changing the data source on the lyr file and adding this to my project. Otherwise it can update your symbology if new values or ranges are in the new data source unless you check "All Other Values", which you may not want to do. – Mike Jul 15 '15 at 7:40
  • ESRIs help on the Apply Symbology tool suggests the field name issue can be overcome using the Make Feature Layer tool... Which you would need to do anyways, but the help for Make Feature Layer says: "New field names defined in the Field Info control will be honored in subsequent tools. However, if this tool is the last tool in a model, the field names will be obtained from the source data on disk. To maintain new field names, the new layer has to be written out to a new data using Copy Rows or Copy Features tools". So it is unclear to me how this really apply symbology to the intended target. – Mike Jul 15 '15 at 7:48
  • 1. Alias names are the same between the two layers. – Katherine Jul 16 '15 at 14:43
1

Assuming layer1 has symbology based on the field "symbol_field", and layer2 has a field "other_field" which contains data suitable to be symbolised in the same way as layer1:

  1. Add a field "symbol_field" to layer2
  2. Copy the values from "other_field" on layer2 to "symbol_field" on layer2
  3. Use arcpy.ApplySymbologyFromLayer_management(layer2,layer1)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.