I have a Landsat TM image and in QGIS I used Clipper to crop my image. Then, I tried to reprojected it via Warp (Reproject) and the pixel size goes 29.9936,-29.9936. I do not understand why this happens. I want then to preprocess this image in Grass. Will I have a problem?
-
2What's the problem, what would you like to achieve?– user30184Commented Apr 7, 2015 at 10:28
-
I want resolution 30,-30 because I will preprocess this image in Grass.– user50130Commented Apr 7, 2015 at 10:30
-
1To respond to comments it is best to use the edit button beneath your question to revise it with the additional details.– PolyGeo ♦Commented Apr 7, 2015 at 10:37
-
2Set the desired resolution with -tr gdal.org/gdalwarp.html. By default gdalwarp tries to avoid resampling and it lets the pixel size to change when it converts from one projection into another.– user30184Commented Apr 7, 2015 at 10:42
-
2gdalwarp -tr 30 30 -s_srs epsg:xxxx -t_srs epsg:yyyy input.tif output.tif. But people will be much more willing to help you if you can show that you have done some work for resolving the problem by yourself and you ask for help with the final detail that stops you.– user30184Commented Apr 7, 2015 at 11:25
1 Answer
The problem is not with the projection, probably, but with the clipper. When you clip a raster pixel size changes, by default. For example, clipping ASTER GDEM are ESPG:2039 changes the cell size from 30, -30 to 30.0735,-30.0976. In order to overcome such an issue, you should use the "clip raster by extent" or "clip raster by mask" geo-algorithm from the toolbox panel, under GDAL/OGR>Extraction.
In the tool's window, use the additional parameters slot to set the output resolution, i.e
-tr 30 30
See image below.
That should fix your problem, unless your original TM image already has a spatial resolution of 29.9936,-29.9936.