Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

New answers tagged

1

A raster is a set of cells that form a grid; each cell has a value. When you reproject a raster, you are re-drawing the grid to be aligned with a new projection. So, in the below figure, your original raster grid is shown in blue, and the reprojected grid is shown in red. Right away you can see a problem--the grids do not align. So, for example, in the ...


2

In other words, you want to create a World file from the coordinates of the 4 corners and the width and height of the image 1) You get the width and height of the image with osgeo.gdal, rasterio or any other libraries to open image files as Pillow and others. dataset = rasterio.open('satel.tif') rasterx = dataset.width rastery = dataset.height 2) you ...


3

From the GDAL doc: The driver does support creating new files, but the input data must be exactly formatted as a SRTM-3 or SRTM-1 cell. That is the size, and bounds must be appropriate for a cell. The output of yourgdal_translate command is pretty clear. Your data needs to be in WGS84 (epsg 4326), be 1201x1201 (cellsize=0.00083333333) or 3601x3601 (...


1

The following approach worked pretty well. First I build virtual raster. gdalbuildvrt raster.vrt -srcnodata 0 -input_file_list paths.txt paths.txt is file with following content: a.tif b.tif Then I add a pixel function to it, as showed here https://lists.osgeo.org/pipermail/gdal-dev/2016-September/045134.html. Pixel function is written using numpy, ...


2

The division in gdal is an integer division by default. You can change this behaviour by dividing with a float. In you case, simply replace 10000 by 10000.0 gdal_calc.py --type=Float32 -A C:\z\input.tif --outfile=C:\z\output.tif --calc="A/10000.0" Note that storing in 16bit integer is more efficient than float 32, so I should think twice before running ...


Top 50 recent answers are included