0

I have some MODIS hdf files and trying to change the projection from Sinusoidal to Lambert Conformal Conic using GDAL module in Python.Here is my python code and it returns error message:

import os,sys
import gdal
import numpy

os.sys('gdalwarp test.hdf outfile.hdf -t_srs "+proj=lcc"')


  File "projection_cmd.py", line 5, in ?
    os.sys('gdalwarp test.hdf outfile.hdf -t_srs "+proj=lcc"')
TypeError: 'module' object is not callable

When I use command line to run :

gdalwarp test.hdf outfile.hdf -t_srs "+proj=lcc"
ERROR 1: Unable to compute a transformation between pixel/line
and georeferenced coordinates for test.hdf.
There is no affine transformation and no GCPs.

How can I fix it?Thanks!

4

1 回答 1

1

os.sys 是一个模块名称。如果您需要运行系统命令行,则需要使用 os.system('command')

于 2013-01-25T07:45:56.063 回答