SQLITE data types and VTK - little suggestion

In the vtkSQLiteQuery class I see that the mapping of SQLITE data types to VTK data types does the following (among others):


Looking further into the SQLite documentations and source codes, SQLITE_FLOAT is just any kind of “generic floating point” data type - with SQLite being very “pragmatic” regarding data types, adapting the internal representation (integer, float, double etc.) “on the fly” to the sort of data a user wants to store.

This is a bit like the philosophy of the vtkDataArray class for example: you can use it to access all types of numeric data, and the “common base” is always “double”, even if you access a vtkFloatArray or whatever.

With this in mind I would suggest the following little improvement:


It may not hurt in many cases, but I had serious problems in other situations with geographic coordinates in the past, so I am very careful to ensure sufficient precision - and in my own software I will definitely use a vtkDoubleArray for storing data that is reported by the vtkSQLiteQuery class as being of type VTK_FLOAT! Once you know it you can do that, but others may fall into a trap here.

Would this change cause an issue with code already using float arrays with the class?

I have run into a similar issue with integers.

If I have a table field with large integers (say >2^32) and I add in it to an SQLITE db using (vtkTableToSQLiteWriter) everything is fine, but when I selected the data again using vtkRowQueryToTable the integers are truncated. I believe this is because SQLITE_INTEGER is mapped to VTK_INT.