I am trying to reproject and resample (1000m ->> 30m) a raster image (shape 238X406) using gdal.ReprojectImage() function in Python. The input file has -9999 cells as no data value. The result is an array (shape 10834x15055). The data type is float32.
When I write the result to geotiff file, everything is expected.However, when I write the result to a gdal memory file instead of GeoTIFF file to save some time (25 seconds shorter processing time), this time all -9999s (no data value) become 0 (zero). Both results are exactly same, but GeoTIFF file has -9999, memory file has 0.
I am using the same code to produce the results and the only difference is that I call memory driver when I want to write result to memory file (driver=gdal.GetDriverByName("MEM")), and GeoTIFF driver when I want to write result to GeoTIFF file (driver=gdal.GetDriverByName("GTiff"))
أكثر...
When I write the result to geotiff file, everything is expected.However, when I write the result to a gdal memory file instead of GeoTIFF file to save some time (25 seconds shorter processing time), this time all -9999s (no data value) become 0 (zero). Both results are exactly same, but GeoTIFF file has -9999, memory file has 0.
I am using the same code to produce the results and the only difference is that I call memory driver when I want to write result to memory file (driver=gdal.GetDriverByName("MEM")), and GeoTIFF driver when I want to write result to GeoTIFF file (driver=gdal.GetDriverByName("GTiff"))
أكثر...