9
votes
Accepted
Creating python dictionary that maps each domain to multiple coded values in File Geodatabase?
The following should do the job:
codedDomains = {domain.name: domain.codedValues.keys() for domain in arcpy.da.ListDomains(gdb) if domain.domainType == 'CodedValue'}
Basically, it uses a list ...
7
votes
Accepted
Restricting values to domain codes (beyond attribute table)?
Business rules vs data integrity rules
When you model your database, you specify the business logic in two spaces:
a. The data integrity rules. This includes among others having an integer column so ...
6
votes
Accepted
Coded value domains, Allow Null Values = no. Why does it default to zero?
The behaviour you describe is correct. All because you give a field a domain and set field to not allow NULLS does not mean that ArcMap will capture the fact they the user may not touch that field ...
6
votes
Using subtypes and domains in QGIS like can be done in ArcGIS Desktop
In QGIS 3.xx.x you can use Attribute Forms in layer properties to set Value Maps which allow you to pick values from a dropdown menu. You can try using Value Relation, Relation Reference or create ...
6
votes
field calculator python script with coded values
In a coded value domain, the values are stored as 1, 2, 3 and not as ARTERIAL_CRACKSEAL, ARTERIAL_MICROSEAL, ARTERIAL_OVERLAY.
To make your code work with the coded values, change your if lines to ...
6
votes
Using CopyFeatures_management without copying source GDB domains to 'in_memory' workspace?
When you copy a feature class to an in_memory workspace then all that I would have expected you to be copying is a feature class.
However, when I ran the test below it created output that indicates ...
6
votes
How to Transfer Domain from one Geodatabase to another?
You could export a featureclass that uses the domain from the original gdb to the new one and select transfer field domain descriptions from the 'Fields' section of Environments. The process is ...
6
votes
Accepted
ArcGIS Desktop, Attribute Table with drop down menus
Your database has Domain or dataset has subtype. If you want to manage them you can add more parameters for the domain or subtype.
see Create subtypes and attribute domains
to manage domains :
Right ...
6
votes
Accepted
Exporting all domains to table in ArcGIS Pro using ArcPy?
With only a couple very small changes to the code here: https://community.esri.com/thread/163889, this runs fine in ArcGIS Pro. (note, the code specifically works against CodedValue, not Range. You'd ...
5
votes
Is it possible to edit domain coded values in ArcGIS Online Feature Layers?
I ran into this issue a month or so ago, they don't make things easy, but I was able to find a solution--as long as you have admin rights to the layer that you want to update.
You'll need to go to ...
5
votes
Listing feature classes with active domains?
This code should return what is being asked. It will succinctly traverse all feature classes and tables in a workspace GDB/FS and return all fields associated with a domain, the field name, and the ...
5
votes
Accepted
List of all fields and their domains for each table using SQL (table name, field name, domain name)
Refer to the XML in the DEFINITION field in SDE.GDB_ITEMS_VW.
select
i.name as table_name,
extractvalue(definition_xml.column_value, 'GPFieldInfoEx/Name') as field_name,
extractvalue(...
5
votes
Accepted
How to get description instead of coded value for a field with domain in hosted feature layer
Use the ArcGIS for Python API
from arcgis.gis import GIS
## or use GIS("agol_url", "username", "password")
agol = GIS("home")
item = agol.content.get("...
4
votes
Listing feature classes with active domains?
This is what I imagine Matt Wilkie had to look up and write to augment Brian's code. I had to get all domains for tables, feature classes in the root directory of a database, and features in all ...
4
votes
Export all coded value domains from a geodatabase
Here's some code that exports all the domains to Excel files. Also, you are getting the error when trying to export to DBF because the word "description" is 11 characters long.
''' Export all coded ...
4
votes
Using File Geodatabase coded domain with ArcGIS Online?
I followed the steps in an ESRI blog which shows how to add a domain through the REST API.
Direct link to the document: click me
Here's what I put to add a Yes/No domain to a field called Completed:
...
4
votes
Why domain range failed?
The issue here is that the domains do not prevent you from adding incorrect data into the fields. You need to validate the features first. To do this, you need to be in an edit session. Then, select ...
4
votes
Accepted
Importing Shapefile to File GDB with domains and coded values
No it does not. Shapefiles do not support domains.
When you import this into a GDB, the process does not automatically assign domains, even if the field names are the same.
You will need to manually ...
4
votes
How to Transfer Domain from one Geodatabase to another?
If you are using ArcGIS Pro you can right click the original gdb in the catalog > domains.
Then click the domain that you are interested in highlighting the row. Then right-click the side of the ...
4
votes
Accepted
labeling feature based on defined Value Map in QGIS?
I can reproduce your problem (QGIS 2.18.16).
A working example with a point layer "test" and a CSV-file label.csv.
Alternatively you can use a JOIN:
Or a Virtual Layer:
UPDATE 1
If you have ...
4
votes
Accepted
Using ogr2ogr (or another vector program) to add field domains to existing file geodatabase
The field domain support was implemented by this Pull Request https://github.com/OSGeo/gdal/pull/3638
If I understand it right, ogr2ogr can read existing field domains and copy them into a new ...
3
votes
Accepted
Is it possible to change or reconfigure a domain owner on SDE?
It doesn't work to just give a user "db_owner" permissions. The SDE admin will have to use the script below in MSSQL:
update sde.gdb_domains
set Owner = 'USER'
where DomainName = 'DOMAIN1' ...
3
votes
Accepted
Understanding if-else statements in ArcGIS field calculator when coded value domain used?
It looks like you are using a coded value domain.
So that you can see what is stored rather than what is displayed:
Open your attribute table
Use Table Options to access Appearance
Untick the ...
3
votes
Accepted
How do I import domains into a feature class from a table in ArcGIS 10.2.2?
Loading domains that are already in a geodatabase onto a feature class in the same geodatabase is accomplished using the Assign Domain to Field tool.
3
votes
Accepted
Listing feature classes with active domains?
To answer the question of handling feature classes with subtypes, it is possible with arcpy (10.1+).
arcpy.env.workspace = your_gdb
for FC in arcpy.ListFeatureClasses():
for stcode, stdict in ...
3
votes
Copying domain (and only domain) between Esri geodatabases?
Here's a method to export/import domains that uses XML Workspace Documents.
Requirements
ArcGIS Desktop 10.X.X
ArcGIS Pro latest (tested)
Notepad++, Notepad, or your favorite text editor
Procedure
...
3
votes
Drop down menu for Coded Domain not available in edit session
Make sure subtypes have not been defined for one of the fields in the feature class you are assigning a domain to. In the Feature Class Properties, choose "Subtypes". If a subtype field has been ...
3
votes
Accepted
Creating domain with thousands of values for ArcGIS feature class?
Although you may want to rethink your schema if you have that many values for a single domain, there are tools available in ArcGIS to help you do this. One thing I am not sure of is if there is a ...
3
votes
Limited entries on field (ArcGIS 10.1)
I believe database Domains will accomplish what you're looking for.
From Catalog, right click your gdb and select Properties, then go to the Domain tab.
Start typing in the Domain name box to create ...
3
votes
Accepted
Value relations QGIS
Either using Value Maps or Value Relations, you will face the problem those setting being saved to the project only. One way of overcame that is to save the layer style as default.
Next time you, or ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
domains × 225arcgis-desktop × 101
arcpy × 34
file-geodatabase × 31
arcmap × 26
esri-geodatabase × 26
enterprise-geodatabase × 24
subtype × 21
arcgis-online × 17
qgis × 16
arcgis-10.2 × 16
attribute-table × 16
arcgis-pro × 14
oracle-dbms × 13
arcgis-10.0 × 12
arcgis-10.1 × 12
fields-attributes × 12
arcgis-server × 9
field-calculator × 8
editing × 8
arcgis-10.3 × 7
arcgis-collector × 7
arccatalog × 6
geodatabase-xml × 5
python × 4