Hot answers tagged

8

I think what you are actually trying/wanting to do is create subtypes as shown in the graphic here. You can then apply domains by subtype. In your example type would be a domain of plastic and metal, which in turn would be subtypes, and then metal would have a domain of yes/no for rusted, but plastic would have a domain of N/A or whatever other option. ...


8

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 comprehension to populate a dictionary, but only if it is a coded value domain. If you wanted to have it populated with the description instead of the coded value, ...


7

I'm not sure which version of ArcGIS you are working with, or if you've come across this since posting, but in version 10.1 there is an environment setting under "Fields" called "Transfer Field Domain Descriptions". I've used it on occasion in the Feature Class to Feature Class tool to export to shapefile and it seems to do the trick (if you don't mind your ...


7

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 users won't be able to enter strings. b. The business domain rules. This includes having check/unique/foreign key constraints on columns so it won't be ...


6

I think the easiest way to do this would simply be to use the Table to Domain GeoProcessing tool, which you could run directly within the software or call via arcpy. You can get details about the tool at http://resources.arcgis.com/en/help/main/10.1/index.html#//001700000025000000 but basically it assumes you have a table that in your case would have a ...


6

Maybe a few pictures would help. A subtype field can be set to categorize the main types (rock, soil, debris); This would correlate to Field_1. Notice the desc field domain is set to rock. Each subtype can set a domain for the desc field. The soil subtype has the soil subtype for the desc field. You will need to make domains for acceptable values for ...


6

You cannot use a domain to do this and as far as I know you cannot do this, since it violates the tableview design. You want to violate a coded value domain, which will generate a validation violation when you run Validation for the field. A coded value domain can only be violated with runtime user defined values if the user uses the Field Calculator to ...


6

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 refer to the codes: def checkValue(c, d): if c == 1: return 'ACS' if c == 2: return 'AMS' if c == 3: return 'AOL' if c == ...


6

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 that the domains associated with a feature class are copied into the in_memory workspace, and if that in_memory feature class is copied out to a new file ...


6

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 described in more detail here: http://support.esri.com/technical-article/000011973 Or you could use the "Domain To Table" tool (in ArcToolBox > Data Management Tools ...


6

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 click to the database , select properties then click Domains tab. now you can edit or delete domains. to manage subtypes: right click to the feature class , ...


5

I would suggest using QGIS for Android (or if you have a Windows tablet you have use the default desktop app). You can load any type of raster or vector data as a basemap It can work offline with GPS It has a point capture tool within the GPS Info. panel This last criteria most likely you will have to develop since this type of control is specialized. You ...


5

There is a number of toolboxes that let you work with the geodatabases (analyze feature classes, compare workspaces, etc). The toolboxes can be downloaded from here. You can reuse some of those tools in your work. The easiest way to list the fields and see what domains are used (you need to delete domains from fields first before you will be able to delete ...


5

Create lookup tables like @GeoKelvin discribed. Or use tool Domain To Table to create a lookup table. Join lookup table to feature class Export feature class to Shapefile You can automate this with Modellbuilder.


5

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 feature class/table it belongs in. import os import arcpy lst=[] for dirpath,dirnames,files in arcpy.da.Walk( # the path to your workspace , datatype=["...


5

Yes, you can do this with arcpy. I usually use arcpy.da.ListDomains to iterate through the domains but in your case you just need to see if there are any domains assigned to a field in feature classes. This code can iterate really quickly through multiple feature classes and report those that have a field that has been assigned to the domain you've specified....


5

You can get this from the FeatureLayer class. There is an attribute called fields, which is an array of Field objects. The Field class has domain attribute. The following will output the domains in the console (if any): var map = new Map(...); var fl = new FeatureLayer(...); map.addLayer(fl); // when layer is ready fl.on("load", ()=>{ for (var i = 0;...


5

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 your REST page for the layer and add 'admin' between the Rest\Services part of the URL: From here, scroll to your attributes that contain a domain (...


5

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 during editing. So when they save edits they can insert a nothing even though you have a domain. There are 2 routes here: Accept this odd behaviour then do some ...


5

I'll start with a declaimer: I've cobbled this info together from various scraps of documentation that I found on various ESRI pages. I'm not a geodatabase developer or XML developer, so it's very possible that I've missed the mark here in some way. The Solution: Extract the XML from the DEFINITION field from SDE.GDB_ITEMS_VW. In this example, for simplicity,...


4

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 feature datasets. I exported the information as a csv to allow some other workers to clean up our geodatabase environments of old domains. def domainInfo(...


4

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 value domains in a geodatabase to Excel files in the same directory ''' import os, sys import arcpy ## Ideal when testing so you don't keep getting errors arcpy....


4

Zip and upload is not going to work. As it says at the bottom of hypelink you have to share your MAP as feature service.


4

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: { "name": "Completed", "type": "esriFieldTypeString", "alias": "Completed", "sqlType": "sqlTypeOther", "length": 50, "nullable": true, ...


4

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 assign a domain to the field (Either an existing domain or a new domain) To conform to your existing domain you will need to modify the values in the feature ...


4

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 joined a csv to your layer with 3 attributes you can label this way (like the example in the question). attribute_1 = 'HP attribute_2 = 41 attribute_3 = 'h' label ...


3

You could go two ways. 1) You could use Table To Domain (Data Management) GP tool after you have found out the domain name to export the domain values and descriptions into a geodatabase table and then run Join on the feature class and table and then calculate the field. To find out the domain name for a field in a feature class you need the code: ...


3

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 list(arcpy.da.ListSubtypes(FC).items()): for stkey in list(stdict.keys()): if stkey == 'FieldValues': for field, fieldvals in ...


3

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 Export XML from Source Select your source geodatabase Export an XML Workspace Document Export the schema only. Metadata is optional (red arrow). Edit XML ...


Only top voted, non community-wiki answers of a minimum length are eligible