Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save dinizime/5a480ab891f7b822788e915cd5f25289 to your computer and use it in GitHub Desktop.

Select an option

Save dinizime/5a480ab891f7b822788e915cd5f25289 to your computer and use it in GitHub Desktop.
Get Image CRS from image in the path
import os, csv
with open('E:/Teste_IMG/teste.csv','wb') as s:
t = csv.writer(s, delimiter=';', quotechar='|', quoting=csv.QUOTE_MINIMAL)
t.writerow(['root','file','crs'])
for root,dir,files in os.walk('F:/PROJETO-941_RS-VOO/LOTE_1/1_IMAGENS_AEROTRIANGULACAO/1_GEOTIFF/BLUE_77CM'):
for file in files :
if file.endswith('.tif'):
x=QgsRasterLayer(root+'/'+file,'k')
#print root+ file + x.crs().description()
t.writerow([root,file,x.crs().description()])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment