-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Invalid CRS after writing in QgsRasterCalculator #59898
Comments
Is there a sidecar file with an invalid CRS? Try a random name to make 100% sure. What does gdalinfo say about the output file? |
I only have one file in the directory, but anyway, changing the name didn't help.
I included the information below, but it looks like the CRS is just not written to the output file. Input file
Output file
|
It seems to me that using the QgsRasterCalculator construction variant without the transformContext parameter (although deprecated since QGIS 3.8) calculator = QgsRasterCalculator(
formulaString = "'DEM@1' * 1",
outputFile = "output.tif",
outputFormat = "GTiff",
outputExtent = raster.extent(),
nOutputColumns = raster.width(),
nOutputRows = raster.height(),
rasterEntries = [a]
) the output raster has a valid CRS print(test.isValid())
#> True
print(test.crs())
#> <QgsCoordinateReferenceSystem: EPSG:2180> |
What is the bug or the crash?
The documentation in QgsRasterCalculator indicates that the CRS will be taken from the first entry in
rasterEntries
:However, in the following example after loading a new raster, the CRS is not valid. Can you confirm that this is a bug?
Steps to reproduce the issue
The sample data is available for download here: https://github.com/kadyb/adg2024/blob/main/dane/DEM.tif
Versions
This applies to versions 3.40.0 and 3.34.6 on Windows 10.
Supported QGIS version
New profile
Additional context
No response
The text was updated successfully, but these errors were encountered: