This is an example of re-sampling a raster to larger pixels (in this case 0.45 degree resolution) by taking the mean of the pixels encompassed in the coarser output.
gdalwarp -tr 0.45 0.45 -r average -ot Float32 file.tif fileout.tif
I have used GDAL to set no data values (in this case, 0).
gdal_translate -of GTiff -a_nodata 0 PPR/2000/Playas_2000.tif region_img/Playas.tif
Here’s an example of stitching 2 tiff’s together into a larger area, and setting the output no data value to be where the 0’s were in the original input files.
gdal_merge.py -o region_img/Canada.tif -a_nodata 0 PPR/2000/Alberta_PPR_2000.tif PPR/2000/SAK_MAN_PPR_2000.tif
If you want to stitch shape files together into a new file, you have to initialize the new shape file first with one of your input files and then add to it.
ogr2ogr regions/Canada.shp shapefiles/Alberta_PPR_2001.shp ogr2ogr -update -append regions/Canada.shp shapefiles/SAK_MAN_PPR_2001.shp -nln Canada
If you’re going to, say, turn your raster into polygons, you can get rid of clumps below a certain threshold before doing so (in this case, I’m getting rid of single pixels in my unary raster when using an 8-neighbor clumping rule).
gdal_sieve.py -st 2 -8 file.tif
Then, I can make my polygon layer, simplified. In the 2nd line, I project the shapefile to Albers Equal Area.
gdal_polygonize.py -8 file.tif -f "ESRI Shapefile" shapefile/file.shp ogr2ogr -f "ESRI Shapefile" -progress outfile.shp shapefile/file.shp -t_srs "EPSG:5070"