Closed yjacolin closed 4 years ago
@rouault do you have some input to fill in this table? Complex types documentation is difficult to find on Internet :)
Type | What does it mean? | Python2/3 | Number domain |
---|---|---|---|
Byte | 8-bit int | ||
UInt16 | Unsigned 16-bit int | Int | 0 to 65,535 |
Int16 | signed 16-bit int | Int | –32,768 to 32,767 |
UInt32 | unsigned 32-bit int | Int | 0 to 4,294,967,295 |
Int32 | signed 32-bit int | Int | –2,147,483,648 to 2,147,483,647 |
Float32 | 32-bit IEEE float | float | -3.4E38 to 3.4E38 |
Float64 | 64-bit IEEE float | float | -1.7E308 to 1.7E308 |
CInt16 | complex 16-bit int | Int | –32,768 to 32,767 |
CInt32 | complex 32-bit int | Int | –2,147,483,648 to 2,147,483,647 |
CFloat32 | complex 32-bit IEEE float | float | -3.4E38 to 3.4E38 |
CFloat64 | complex 64-bit IEEE float | float | -1.7E308 to 1.7E308 |
I'm not sure how QGIS maps those complex data types on the Python side. With GDAL numpy support, CInt16, CInt32 and CFloat32 are mapped to numpy.complex64 and CFloat64 to numpy.complex64 As far as the number domain, this is the same as the corresponding real type, for the real and imaginary parts, so for CInt16 this is [-32768,32767]x[-32768,32767], etc.
@rouault thanks, another question: do you know any web page or so that explain the difference between complex and real type? Which usage?
I want to document this as algorithms in QGIS Processing are not using Python and seems to use C Types (processing feature is now in C/C++).
do you know any web page or so that explain the difference between complex and real type? Which usage?
Documentation on this in GDAL is more than sparse. Basically, complex is complex numbers in the mathematical meaning of the term, ie "x + i * y" where x and y are real number and i the imaginary unit whose square value is -1. Complex data types in raster are mostly used for SAR (Synthetic-aperture radar) images.
This is not specific to QGIS. Those that are interested in this can look it up elsewhere. I suggest that we close this issue.
See this PR to see the "problem" https://github.com/qgis/QGIS-Documentation/pull/2963
Proposition: