Saturday 28 February 2015

arcgis desktop - How is the default label field chosen by ArcMap?


I have 2 questions:


I know how to manually go to Layer Properties>Labels tab>Label Field and choose my label field. I also know that I could set up my primary label field and save the setting as a layer (*.lyr) file. This question, though, is more about how the label field is chosen by the program prior to user interaction.


First: When a new layer (shapefile, ArcSDE layer, personal/file geodatabase featureclass) is added to ArcMap, how is the default label field chosen? From my experience, it isn't chosen by field order, nor alphabetical by field. My best guess so far is that it might chose the first field of text/varchar (alphanumeric) type.


Second: Is there a way to define what the "primary label field" will be for a layer within the shapefile, sde, or gdb files, or are you stuck with saving layer files or letting the system pick for you.



Answer



According to this post, the default display field is chosen according to the following priorities:




  1. First field of type Text whose name contains the word "name" (case-insensitive)

  2. First field of type Text

  3. First field of an integer type (Long or Short, presumably)

  4. First field of any type


I don't think there is any way to specify the primary display field without using a layer or layer file, other than using the above logic to name/order your fields accordingly.


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...