gdal

can't import gdal in python?

拟墨画扇 提交于 2019-11-28 03:03:19
问题 I have gdal installed and running on Ubuntu Jaunty but I can't run gdal2tiles because I get the error: Traceback (most recent call last): File "/usr/local/bin/gdal2tiles.py", line 42, in <module> import gdal ImportError: No module named gdal When I open python and type import gdal I get the same error. I've set LD_LIBRARY_PATH (without spaces!) to /usr/local/lib but it doesn't seem to have made any difference. Looks like Python can't find gdal . Can anyone help? Thanks! 回答1: Ith seems to be a

Python GDAL package missing header file when installing via pip

若如初见. 提交于 2019-11-27 22:47:01
I'm trying to install gdal from pip pip install gdal inside a virtual environment (Ubuntu). It fails because it cannot find cpl_port.h extensions/gdal_wrap.cpp:2853:22: fatal error: cpl_port.h: No such file or directory compilation terminated However GDAL is installed correctly and the header file is located at /usr/include/gdal/cpl_port.h . Is there some environment variable for GDAL that needs to be set in order for pip to find the header files? tomyun As suggested in the other thread , exporting some shell variables before running pip worked flawlessly. A path for *_INCLUDE_PATH can be

ImportError: No module named gdal

血红的双手。 提交于 2019-11-27 16:16:19
My GDAL is showing strange behaviour when I try to use ".py" functions from the command line: 1. For example, when I run gdalinfo --version , I get the standard response: GDAL 1.11.3, released 2015/09/16 2. Also when I run gdalwarp , I get the standard response showing me the flags and everything. 3. Problem: However, when I run gdal functions with a .py extension, for example gdal_polygonize.py , I get the following: Traceback <most recent call last>: File "C:\OSGeoW64\bin\gdal_polygonize.py", line 36, in <module> import gdal, ogr, osr ImportError: No module named gdal I checked my Path

数据可视化(四)开源 GIS 技术简史

左心房为你撑大大i 提交于 2019-11-27 16:00:49
原文: A History of Open Source GIS, from Humble Beginnings to World-Changing Applications | 23 Jun 2017 9:00am, by Anthony Calamito 数字制图和地理空间信息系统(Geographic Information System,GIS)的出现彻底改变了人们和对周围世界思考、互动的方式。将位置信息分层重叠用于决策的概念首先是由 Ian McHarg(景观设计师)在上世纪60年代提出。大约在同一时间,Roger Tomlinson —— 人们普遍称之为“GIS 之父”(Father of GIS) 完成了他的博士论文,主要研究使用计算方法处理分层的地理空间信息。罗杰随后致力于创建第一个计算机化的地理信息系统——加拿大地理信息系统(the Canada Geographic Information System),主要用于勘探测绘。 开源 GIS 的起源可以追溯到 1978 年的美国内政部(U.S. Department of the Interior)。从那时起,开源 GIS 基于不同的知识产权许可证,深入影响到许多行业的发展,包括政府和商业领域。美国劳工部称 GIS 技术为二十一世纪最重要的三大高增长产业之一。开源 GIS 技术在过去四十年的发展

python GDAL 2.1 installation on Ubuntu 16.04

∥☆過路亽.° 提交于 2019-11-27 11:02:11
Here will be my sequence of command lines while trying to install gdal2.1 in a UBUNTU virtual machine. My virtual machine is a UBUNTU 16.04 LTS(64bit) I would need gdal2.1 and especially the Python bindings to work with it in python. The versionof python currently installed is 2.7.11+ and I installed numpy as I know that it is necessary for GDAL. now the command lines with the Instructions I found in the Pypi page of GDAL2.1: antonio19812@antonio19812-VirtualBox:~$ sudo apt-get install libgdal1i libgdal1i is already the newest version (1.11.3+dfsg-3build2). antonio19812@antonio19812-VirtualBox

Plot GDAL raster using matplotlib Basemap

青春壹個敷衍的年華 提交于 2019-11-27 10:37:39
问题 I would like to plot a raster tiff (download-723Kb) using matplotlib Basemap. My raster's projection coordinates is in meter: In [2]: path = r'albers_5km.tif' raster = gdal.Open(path, gdal.GA_ReadOnly) array = raster.GetRasterBand(20).ReadAsArray() print ('Raster Projection:\n', raster.GetProjection()) print ('Raster GeoTransform:\n', raster.GetGeoTransform()) Out [2]: Raster Projection: PROJCS["unnamed",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG"

用Ubuntu和RStudio Server搭建一个R语言的云平台

烂漫一生 提交于 2019-11-27 10:03:55
前一段介绍过利用Windows系统的Ubuntu子系统搭建数据科学平台,此番来介绍下除了jupyter之外的另外一个数据科学神器:RStudio Server。同时基于Ubuntu和RStudio Server搭建一个R语言的云平台,用于数据分析。 1 RStudio Server简介 RStudio Server 是 RStudio 公司打造的一款基于 Web 的开源编辑器。在实际的工程中,我们的服务器大多是基于Linux的,比如常见的 ubuntu、centos 等。这些操作系统有时并不提供图形化界面,这时候RStudio的服务器版本就派上用场了。启动RStudio Server后,进入在浏览器中进入某一个页面后就可以像桌面版一样使用RStudio编辑器。当R的代码在服务器上出现bug了,线上的hotfix是在所难免的,这时候就需要用到 RStudio Server。--百度百科。 事实上就是一个Web版的RStudio。 2 R语言云平台搭建 闲话少说,就来搭建平台吧。首先,这次我是在我自己的办公室的工作站上搭建,因此受到局域网限制,我主要是方便于使用办公室的工作站,某种意义上是个伪云平台。如果真的想搭建一个网络访问式的,必须购买服务器。阿里云等都是可以的。其次除了搭建平台外,由于平常主要在做一些空间分析类的处理,因此搭建完成后还会有一个小的样例代码就当是hello

NSTask or equivalent for iPhone [closed]

眉间皱痕 提交于 2019-11-27 09:32:14
I've an open source project (gdal) that I want to compile and run as part of an iOS app. I had been expecting to use NSTask but I see now that it was removed in iOS 3.0. I've also seen elsewhere that running external applications, though this would be a resource in my app's bundle, is not allowed. Has anyone else found a way to run commandline tools within their iOS applications? It wasn't removed in 3.0, it was never there. There is no way to run separate processes on the iPhone. GDAL appears to be under an MIT style license and has a library interface, so directly linking it into an iPhone

Numpy - Replace a number with NaN

∥☆過路亽.° 提交于 2019-11-27 08:50:12
I am looking to replace a number with NaN in numpy and am looking for a function like numpy.nan_to_num, except in reverse. The number is likely to change as different arrays are processed because each can have a uniquely define NoDataValue. I have see people using dictionaries, but the arrays are large and filled with both positive and negative floats. I suspect that it is not efficient to try to load all of these into anything to create keys. I tried using the following and numpy requiring that I use any() or all(). I realize that I need to iterate element wise, but hope that a built-in

Trouble installing rgdal

余生颓废 提交于 2019-11-27 00:59:27
问题 I want to install rgdal for "R version 3.2.3 (2015-12-10)" . I downloaded and installed GDAL 1.11 Complete PROJ framework v4.9.2-2 GEOS framework v3.5.0-1 from KyngChaos Then in RStudio I typed install.packages("rgdal") which gave me this: > .... > > configure: CC: clang configure: CXX: clang++ configure: rgdal: > 1.1-1 checking for /usr/bin/svnversion... yes configure: svn revision: > 572 checking for gdal-config... > no no configure: error: gdal-config > not found or not executable. ERROR: