like this
.
Optional items are indicated [ like this ]
.
"0 0 0"
) in this example.
gdalwarp -srcnodata "0 0 0" SOURCE [SOURCE ...] DEST.tif
listgeo IMAGE.tif > IMAGE.metadata
mv IMAGE.tif tmp.tif ; geotifcp -g IMAGE.metadata tmp.tif IMAGE.tif
OUTPUT NAME
, PATH_TO_DEMS
, and METERS
OUTPUT NAME.shp
, OUTPUT NAME.shx
, OUTPUT NAME.prj
, and OUTPUT NAME.dbf
in the current directory
name="OUTPUT NAME" ;
METERS=NN.n ;
rm "$name.shx" "$name.shp" "$name.prj" "$name.dbf" ;
gdalbuildvrt "$name".dem.vrt PATH_TO_DEMS/*.dem ;
shp="$name.shp" ;
gdal_contour -a ELEV -i $METERS "$name.dem.vrt" "$shp"
ORIGINAL.img
and OUTPUT.img
to the input and desired output filenames.
export SOURCE="ORIGINAL.img" # Set the input filename
export DEST="OUTPUT.img" # Set the output filename
gdal_translate -of XYZ "$SOURCE" EDIT_ME.xyz # Convert the data to plain text
EDIT_ME.xyz
in a text editor and fix the broken values.
gdal_translate -of GTiff "$SOURCE" .original.tif # Copy source data to a GeoTiff file (listgeo can't read .img files)
listgeo .original.tif > .original.metadata # Extract metadata from temp file
gdal_translate -of GTiff EDIT_ME.xyz .not_georeferenced.tif # Convert edited text file to a GeoTiff
geotifcp -g .original.metadata .not_georeferenced.tif .georeferenced.tif # Add saved metadata to the GeoTiff
gdal_translate -of HFA .georeferenced.tif "$DEST" # Convert back to .img file
rm .original.tif .original.metadata .not_georeferenced.tif .georeferenced.tif # Clean up temporary files
ogr2ogr -clipsrc CLIP_AREA.shp OUT.shp IN.shp
ogr2ogr -clipsrc X0 Y0 X1 Y1 OUT.shp IN.shp
grep datasource PROJECT.qgs | sed 's/^.*[<]datasource[>]//;s/[<][/]datasource[>]//;s/[|]layername\=.*$//;s/\?type=.*$//;' | sort -u