Jump to content

 
Photo

Default field value problems: ArcGIS scripting

- - - - -

  • Please log in to reply
2 replies to this topic

#1
Nick Springer

Nick Springer

    CartoTalk Founder Emeritus

  • Moderator
  • PipPipPipPipPipPip
  • 939 posts
  • Gender:Male
  • Location:Crosswicks, NJ
  • Interests:Cartographic Design, Print Maps, Graphic Design, Web Development, Ultimate Frisbee
  • United States

I have a couple of ArcGIS 10.1 (SP1) Python scripts that are appending new rows to various feature classes. I have used "Assign Default To Field" to set field values for the new rows. However for certain feature classes the default values are not being applied on append. There doesn't seem to be any differences in the schema of a feature class that works and one that doesn't.

The default values are being assigned by the script based on certain parameters, and in ArcCatalog the feature class properties are showing the correct default values after the script has run, but the new records all have <NULL> values.

Has anyone run into some limitation that prevents default field values from being applied on append?

Nick Springer

Director of Design and Web Applications: ALK Technologies Inc.
Owner: Springer Cartographics LLC


#2
jblairpdx

jblairpdx

    Newbie

  • Validated Member
  • Pip
  • 8 posts
  • Gender:Male
  • Location:Boone, North Carolina, United States
  • United States

If my memory serves, appended features aren't treated as "new" features, so the default values won't apply. The Append function is taking the source feature's attributes at face value in the copy, even the nulls. The best you can do is set a follow-up routine to apply defaults to null-valued attributes after the append.

-Jacob



I have a couple of ArcGIS 10.1 (SP1) Python scripts that are appending new rows to various feature classes. I have used "Assign Default To Field" to set field values for the new rows. However for certain feature classes the default values are not being applied on append. There doesn't seem to be any differences in the schema of a feature class that works and one that doesn't.

The default values are being assigned by the script based on certain parameters, and in ArcCatalog the feature class properties are showing the correct default values after the script has run, but the new records all have <NULL> values.

Has anyone run into some limitation that prevents default field values from being applied on append?



#3
Nick Springer

Nick Springer

    CartoTalk Founder Emeritus

  • Moderator
  • PipPipPipPipPipPip
  • 939 posts
  • Gender:Male
  • Location:Crosswicks, NJ
  • Interests:Cartographic Design, Print Maps, Graphic Design, Web Development, Ultimate Frisbee
  • United States

Thanks for the info. I was using field calculations to apply the values but that was slow, so I was hoping that default values would speed things up. I guess not :P

If my memory serves, appended features aren't treated as "new" features, so the default values won't apply. The Append function is taking the source feature's attributes at face value in the copy, even the nulls. The best you can do is set a follow-up routine to apply defaults to null-valued attributes after the append.

-Jacob


Nick Springer

Director of Design and Web Applications: ALK Technologies Inc.
Owner: Springer Cartographics LLC





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

-->