1

I'm trying to clip a raster using gdal.Translate but i get this error message:

Traceback (most recent call last):
  File "C:/Users/Mouqsit/Desktop/test.py", line 6, in <module>
    ds = gdal.Translate("C:\\wamp\\www\\Donnees_CRTS\\irrisat_dessimination-smiej\\new.tif", ds, projWin = [681483.831264, 3558183.87652, 747933.831264, 3607833.87652])
AttributeError: 'module' object has no attribute 'Translate'

This is my code:

from osgeo import gdal
import sys ,os
output_dir='C:\\wamp\\www\\Donnees_CRTS\\irrisat_dessimination-smiej'
etp = os.path.join(output_dir,"L8_L8_ETpot_24_30m_2016_223.tif")
ds = gdal.Open(etp)
ds = gdal.Translate("C:\\wamp\\www\\Donnees_CRTS\\irrisat_dessimination-
smiej\\new.tif", ds, projWin = [681483.831264, 3558183.87652, 747933.831264, 
 3607833.87652])
ds = None

Have you any idea about what is happening right here?

BERA
  • 72,339
  • 13
  • 72
  • 161
zakaria mouqcit
  • 889
  • 1
  • 14
  • 28

0 Answers0