User Tools

Site Tools


linux:bash_snippets

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
linux:bash_snippets [2016/09/15 15:31]
mstraub [GIS]
linux:bash_snippets [2017/09/10 13:04]
mstraub [EXIF]
Line 145: Line 145:
  
  
-===== EXIV =====+===== EXIF =====
  
-=== Adjust ​EXIV information ===+Exchangeable Image File Format 
 + 
 +=== Adjust ​EXIF information ===
  
 <code bash> <code bash>
Line 156: Line 158:
 </​code>​ </​code>​
  
-=== Rename file according to EXIV timestamp ​===+=== Retrieve GPS locations ​===
  
 <code bash> <code bash>
-renrot ​-n %Y-%m-%d_%H-%M-%S ​image.jpg+exiftool ​-n -p '​$gpslatitude,​ $gpslongitude,​ $gpsdatetime' ​image.jpg
 </​code>​ </​code>​
  
-===== GIS =====+=== Rename file according to EXIV timestamp ​===
  
-=== Merge shapefiles ===+Simple rename: 
 +<​code>​ 
 +exiftool '​-FileName<​CreateDate'​ -d '​%Y-%m-%d_%H-%M-%S%%-c.%%le'​ image.jpg 
 +</​code>​
  
 +Rename and rotate:
 <code bash> <code bash>
-ogr2ogr merged.shp file1.shp ​                                   # create a copy of file1 +renrot ​-n %Y-%m-%d_%H-%M-%S image.jpg
-ogr2ogr ​-update ​-append merged.shp file2.shp -nln merge         # append file2+
 </​code>​ </​code>​
- 
 ===== PDF ===== ===== PDF =====
  
 === Shrink pdf files === === Shrink pdf files ===
 +Compresses the images in a pdf to a reasonable size (but still useful for printing)
 <code bash> <code bash>
-gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/​screen ​-dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf+gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/​preprint ​-dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf
 </​code>​ </​code>​
  
 +See also http://​www.ghostscript.com/​doc/​9.05/​Ps2pdf.htm#​Options
linux/bash_snippets.txt · Last modified: 2019/09/19 14:39 by mstraub