Creating the boundaries (tindex) of raster orthophotos with unix script
General
Rasters
GDAL
Linux
Tiling
- Creating the boundaries (tindex) of raster orthophotos with unix script
- masking them with the same name
- compressing them by converting them to WGS84
Description :
Example :
for dosyaadi in *.tif
do
gdal_translate -a_srs EPSG:5254 $dosyaadi turef/$dosyaadi
gdaltindex -tileindex location tindex_5254/$dosyaadi.shp turef/$dosyaadi
ogr2ogr -f "ESRI Shapefile" tindex_4326/$dosyaadi.shp tindex_5254/$dosyaadi.shp -s_srs EPSG:5254 -t_srs EPSG:4326
gdalwarp -overwrite -s_srs EPSG:5254 -t_srs EPSG:4326 turef/$dosyaadi wgs84/$dosyaadi
gdalwarp -q -cutline tindex_4326/$dosyaadi.shp -crop_to_cutline -dstalpha -of GTiff wgs84/$dosyaadi wgs84_clipped/$dosyaadi
gdal_translate -co COMPRESS=JPEG -co JPEG_QUALITY=75 wgs84_clipped/$dosyaadi wgs84_compressed/$dosyaadi
gdaladdo -r AVERAGE --config JPEG_QUALITY_OVERVIEW 75 --config COMPRESS_OVERVIEW JPEG --config PHOTOMETRIC_OVERVIEW YCBCR --config INTERLEAVE_OVERVIEW PIXEL wgs84_compressed/$dosyaadi 2 4 8 16
rm -f turef/$dosyaadi
rm -f wgs84/$dosyaadi
rm -f wgs84_clipped/$dosyaadi
done
2025 Mar