Thursday, 5 March 2015

arcgis desktop - Referring to NaN or ±∞ (special floating point values) in ArcMap definition queries?


I have by chance discovered how ArcMap displays special floating point values to the user.




  • +∞ (positive infinity) is displayed as 1.#INF

  • –∞ (negative infinity) would supposedly be displayed as -1.#INF — I haven't verified this one.


  • NaN (not a number) is displayed as a right-aligned — not to be confused with left-aligned , which denotes NULL (missing values):


    Screenshot of a table viewed in ArcMap that shows two distinct types of NULL


    (Get unique values in the field calculator does not list NaN at all, by the way.)




But I haven't discovered how to write layer definition queries to select rows based on these special values:




  • ColumnName IS NULL will only select regular NULL values, but non NaN.

  • ColumnName = 1.#INF is rejected as having invalid syntax.


Does anyone know how to do this?




C# ArcObjects code snippet for storing a 1.#INF value to a table field (basic concept):


As requested. Since I'm no longer at work, the following is not the real code I used and I cannot test it right now, but it should produce the effect shown in the screenshot above:


ITable table = …;
int doubleFieldIndex = table.FindField(…);
IRow row = table.CreateRow();

row.Value[doubleFieldIndex] = double.PositiveInfinity;
row.Store();


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...