Esri / data-assistant

ArcGIS Pro Add-in that assists in emergency management, local government and state government data aggregation workflows.
Apache License 2.0
22 stars 8 forks source link

Domain Map - If the layer has subtypes, restrict values loaded by user specified subtypes #204

Open MikeMillerGIS opened 7 years ago

MikeMillerGIS commented 7 years ago

Should we look at a way to expose only the domains by subtypes, so for a cleaner list?

Could we add a pick list(checkboxes) to this dialog with all subtypes for the source and target?

image

MikeMillerGIS commented 7 years ago

In thinking, we could also expose the domain names and the subtype code, so the user will see that

Same for target layer

MikeMillerGIS commented 7 years ago

Mock Up image

Merge work with #203

JRosenfeldIntern commented 7 years ago

When pre-loading from source, we'll also have to change the way the GPtools work. At the moment, it searches for the svalue in the xml DomainMap. If it finds it, it sets the target value to the corresponding tvalue in the xml.

Theoretically if we pre-loaded the source values, all values within the domain will always get found. If you didn't map that source domain to a target domain, however, '(None)' gets mapped as opposed to the original source value. We will need to check if tvalue is '(None)' or not (or we will have to initialize the corresponding tvalue nodes to their svalue nodes) before mapping the value.

JRosenfeldIntern commented 7 years ago

Implemented the above swap. Was just one line of code and it seems to work. There should be no issue now on the tool level.

 if sourceValue == sourceTest or sourceValue == sValue: 
 # this will check numeric and non-numeric equivalency for current values in maps
                found = True
                try:
                    if dla.getTextValue(targetValues[i]) != "(None)":
                        newValue = dla.getTextValue(targetValues[i])