I noticed something which to me does not make sense as an exception.
We have a table that is defined to not have Z coordinate.
We normally collect points from a GPS device which just returns lat/lon so normally create points without Z.
I recently was testing the app using the SystemLocationDataSource which does return X,Y,Z coordinates. When calling FeatureTable.AddFeatureAsync it fails because the table does not have a z coordinate.
Why? Why would the Z not simply be removed when the point is added. Instead I am having to write conditionals to remove Z from the points
Solved! Go to Solution.
I think we chose to throw an exception because if the API silently dropped the Z value, then you could consider data is being lost or corrupted. Instead we wanted to guide the developer to consciously choose to remove Z values, or alternatively knowing that they could or should be capturing Z values then ensure the data schema allows for this (and set appropriate default Z value, etc).
The overhead of checking if the table supports Z values, if the feature has a Z value, and using GeometryEngine to remove them should be negligible, but if you see any issues please let us know.
I think we chose to throw an exception because if the API silently dropped the Z value, then you could consider data is being lost or corrupted. Instead we wanted to guide the developer to consciously choose to remove Z values, or alternatively knowing that they could or should be capturing Z values then ensure the data schema allows for this (and set appropriate default Z value, etc).
The overhead of checking if the table supports Z values, if the feature has a Z value, and using GeometryEngine to remove them should be negligible, but if you see any issues please let us know.
Ok, now that I see the GeometryEngine method its not too bad, I was stripping it myself which was somewhat ugly