Saturday 28 May 2016

attribute table - Adding boolean yes/no field in ArcGIS Desktop?



How does one add a field to an ArcGIS feature class with a boolean data type? That is an attribute where the allowed value is only one of a pair such as 1/0, Yes/No, On/Off, Present/Not-present, etc.


A boolean data type is not available in the Data Type pick-list.



Answer



Many DBMSes including Oracle do not have a Boolean column type, so this may explain why there is no Boolean field type in ArcGIS either.


@Emily's suggestion of using a coded value attribute domain is a good one and I believe this is the ESRI-recommended best practice.


The only other suggestion I would have is to use a CHAR field of length 1, as this way you can use the slightly more descriptive "Y" or "N", or "T" or "F", rather than 1's or 0's, and, according to this article, in Oracle 1-character CHAR columns are actually more efficient than 1-digit NUMBER columns.


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...