Add a Boolean Field Type to Personal and File Geodatabases

5445
6
03-01-2012 12:48 PM
Status: Open
Labels (1)
MichaelSiadak
New Contributor III

One thing that ArcGIS is missing on the tabular side of the geodatabase data model is a boolean field (that is, a field that be set to True or False only).  Currently, geodatabase users have two bad options for modeling boolean data in a table:

1) Use a text field.

This way is poor because there are too many ways to model the same two values (true and false).  The user can use a field with no subtypes and use 'Y' and 'N'.  Or, the user can use 'T' and 'F'.  Or, the user can use 'True' and 'False'.  Or, the use can add subtypes and enforce two of the many combinations of words and letters than can represent 'True' and 'False'.

2) Use a short integer field

This way is a little bit better than a text field, but there are still multiple ways to represent true and false in this context.  Should the user follow the model of Microsoft Access and use -1 to represent true and 0 to represent false?  Should the user follow the model of binary numbers and use 1 to represent true and 0 to represent false?  Also, if the user is going to go this route, he or she should probably set domain minimum and maximum values or subtypes in order to prevent other users from entering values other than the two chosen to represent true and false.  This seems like an unnecessary step, and it still doesn't solve the consistency problem.


Adding a boolean field type would solve all of the above ambiguities by creating one go-to datatype for true/false data instead of the theoretically infinite number of choices that people can and do choose between in order to model true/false data.  It would greatly simplify querying of such fields and reduce users' reliance on metadata (which many data creators don't fill out properly anyway).  Also, it would be pretty easy to fall back on one of the above methods (I recommend 1 = true and 0 = false integer fields) when exporting to a datatype that doesn't support the boolean field (some ArcSDE datasources, shapefiles).

6 Comments
DavidFlack
I completely agree.  The number of workarounds for this problem compounded by inconsistencies in metadata and completeness are very frustrating.  I don't believe ESRI supports the use of boolean fields in any of their data formats since not all platforms support boolean (think dBASE).  

Times are changng, ESRI.  You can handle native SQL Server spatial types, so I think you can handling booleans would be far less work.
bdewitt_olsson

I completely agree. I learned about computer data management through learning about GIS, and so I never realized until recently how clunky and overcomplicated true/false data is in ESRI products. Using a string or int field with a "Y/N" or "0/1" domain is much more work and far worse for data integrity than a true Boolean data type would be.

It would especially be nice when creating forms in field maps or web apps to have Boolean data edited with a checkbox, which would be easy to do if a Boolean type existed. "Yes/No" domains are far slower and more tedious to edit.

Edit: Didn't realize how old this post was until after I replied. 2022 and still nothing!

Bud
by

Merged from a separate idea.

It's my understanding that most databases now support a boolean field data type.

I'm wondering if the ArcGIS platform could be enhanced to support boolean in all applicable geodatabases.

I'm aware that we can create a fake boolean with 0 or 1 in an integer column. But I think true boolean fields would be cleaner.

MarceloMarques

Suggestion, you can create a geodatabase domain, integer values, 0=False and 1=True, then add integer column(s) to the featureclasses or tables, assign the domain to the column(s), set the column to "not null", set the column default value to 0=False, then create an index for the integer column to make queries faster. This is the best implementation for performance in any enterprise geodatabase, Oracle, SQL Server, PostgreSQL. 

ArcGIS field data types—ArcGIS Pro | Documentation

Data Types (oracle.com)

Data types (Transact-SQL) - SQL Server | Microsoft Learn

PostgreSQL: Documentation: 15: Chapter 8. Data Types

Bud
by

@MarceloMarques Coded value domain or range domain?

MarceloMarques