【问题标题】:How to change projection with MODIS hdf file using GDAL in Python?如何在 Python 中使用 GDAL 更改 MODIS hdf 文件的投影?
【发布时间】:2013-01-25 15:45:56
【问题描述】:

我有一些 MODIS hdf 文件并尝试使用 Python 中的 GDAL 模块将投影从正弦曲线更改为兰伯特保形圆锥曲线。这是我的 python 代码,它返回错误消息:

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

当我使用命令行运行时:

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.

我该如何解决?谢谢!

【问题讨论】:

标签: python projection hdf5 gdal


【解决方案1】:

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

【讨论】:

  • Here 是一个使用 gdal 模块的演示。希望这会有所帮助。
猜你喜欢
  • 2013-01-05
  • 2022-11-12
  • 1970-01-01
  • 2020-10-07
  • 1970-01-01
  • 1970-01-01
  • 2014-05-07
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多