Skip to content

Instantly share code, notes, and snippets.

@diogooliveira-dsg
Created December 19, 2018 15:43
Show Gist options
  • Select an option

  • Save diogooliveira-dsg/ab2021e9ab13cf4489092649f5e1dc51 to your computer and use it in GitHub Desktop.

Select an option

Save diogooliveira-dsg/ab2021e9ab13cf4489092649f5e1dc51 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