Closed smalers closed 3 years ago
The Poudre Basin Information wildfire map hover popup was not initially showing the cell data value. The configuration file is below, although I think the configuration uses the classificationAttribute
rather than the following. Then I realized that I had set the attribute to a string because I also had a vector layer with similar data. There needs to be a console warning in this case saying that the classificationAttribute
should be a number. The number also needs to be checked to make sure it is between 1 and the number of bands in the raster.
{
"id" : "cameron-peak-sbs-raster-event-config",
"name": "Hover and click event handlers for cameron-peak-sbs-raster.tif",
"description": "Display only important user-understandable attributes.",
"layerAttributes" : {
"include" : [ "*" ],
"exclude" : [],
"formats": []
},
"actions": [
]
}
The error handling has been updated for the classificationAttribute
, and will display an appropriate warning/error message to help debug. Closing the issue.
The raster hover event handler is working but shows a large negative number for no data value (approximately
-3.39e+38
). This is probably the biggest negative 32-bit floating point number. The data type is Float32 for the raster even through integer values are stored in the cell. I need to check on how GeoProcessor/PyQGIS handles data type for each band when manipulating the raster.The hover popup should display as
Cell value: no data
in this case. I recommend writing a utility function somewhere likeboolean isCellValueMissing(value)
. The no data value is stored with the raster so need to decide how to handle that. In general, avoid many function calls to return the same value.As for detecting the value, it may be necessary to bracket the value, which is what TSTool does, something like: