Closed janzandr closed 1 month ago
Note that the library was written with json.dump, which will write Python nan values as "NaN".
It's not valid JSON (see #731) In general, QGIS requires valid JSON files according to https://datatracker.ietf.org/doc/html/rfc7946.
Solution: "NaN" needs to be replaced by "null"
from https://docs.python.org/3/library/json.html
If allow_nan is false (default: True), then it will be a ValueError to serialize out of range float values (nan, inf, -inf) in strict compliance of the JSON specification. If allow_nan is true, their JavaScript equivalents (NaN, Infinity, -Infinity) will be used.
Of course we could somehow handle such kind of none-struct JSON. But other QGIS widgets or even GDAL may have a problem with that. Therefore it is better to rely and use valid JSON only.
Not sure what you want to say? Can/Shall we support NaN values inside the SpectralView?
Currently, using "null" is the correct way of doing it, right?
When using this library, which contains a NaN value, the profile is not correctly plotted: