自定义图像作为地图

时间:2013-10-04 02:48:17

标签: python image map

http://macwright.org/2012/08/13/images-as-maps.html

我正在研究这个链接而且我遇到了麻烦

“这是一个Python脚本:将其下载为原始文件,将其命名为togeo.py。您需要GDAL才能工作 - 不一定是'python绑定',但请确保在您的终端中,存在gdal_translate和gdalinfo。“

我不知道如何制作“gdal_translate和gdalinfo存在于终端”, 谁能帮帮我呢?

这是我运行“python togeo.py eso1119a.jpg”时的错误消息:

Janes-MacBook-Pro:desktop kennett$ python togeo.py eso1119a.jpg
Traceback (most recent call last):
  File "togeo.py", line 7, in <module>
    info_output = subprocess.Popen(['gdalinfo', infile], stdout=subprocess.PIPE).communicate()[0]
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 672, in __init__
errread, errwrite)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1202, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory

1 个答案:

答案 0 :(得分:2)

基本上你只需要安装gdal并确保可执行文件在你的PATH环境变量上。如果可以的话,如果你能从包经理那里得到它,那可能是最简单的。如何执行此操作是特定于平台的。否则,您始终可以从源安装。源代码可从http://www.gdal.org/

获得
相关问题