Esri / data-assistant

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

Value Map is failing on double field when source is null #149

Closed MikeMillerGIS closed 7 years ago

MikeMillerGIS commented 7 years ago

unable to cast maxopdis to Double : '

MikeMillerGIS commented 7 years ago

So, in a value map on a double field, when there is a null value and that is not mapped and other is not specified, it uses the whitespace of otherwise and trys to set that.

width:None #40
sideslope:None #41
maxopdis:
             #42
diameter:None #43
MikeMillerGIS commented 7 years ago

linking: https://github.com/Esri/data-assistant/issues/105

SteveGrise commented 7 years ago

Normally the ValueMap otherwise value should be set to None so the Xml empty string issue does not happen. If that value is not present and the Xml file is saved externally to Pro then this can happen. I have tried to catch this as follows: if not found: if str(otherwise) != "None" or otherwise == None: if otherwise.startswith("\n ") or otherwise == "": otherwise = None newValue = otherwise

In my experience that empty string startswith a newline char, we can always change the logic but I did some testing and this appeared to work in my small test case with: <Otherwise> </Otherwise> in the xml file.

MikeMillerGIS commented 7 years ago

Closing, I believe the root cause was an edited xml file. New files do not have this issue