gdal

Obtain Latitude and Longitude from a GeoTIFF File

限于喜欢 提交于 2019-11-26 23:53:24
问题 Using GDAL in Python, how do you get the latitude and longitude of a GeoTIFF file? GeoTIFF's do not appear to store any coordinate information. Instead, they store the XY Origin coordinates. However, the XY coordinates do not provide the latitude and longitude of the top left corner and bottom left corner. It appears I will need to do some math to solve this problem, but I don't have a clue on where to start. What procedure is required to have this performed? I know that the GetGeoTransform()

Python GDAL package missing header file when installing via pip

試著忘記壹切 提交于 2019-11-26 23:14:45
问题 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? 回答1: As suggested in the other thread,

Reading hdf files into R and converting them to geoTIFF rasters

99封情书 提交于 2019-11-26 16:09:55
问题 I'm trying to read MODIS 17 data files into R, manipulate them (cropping etc.) and then save them as geoTIFF's. The data files come in .hdf format and there doesn't seem to be an easy way to read them into R. Compared to other topics there isn't a lot of advice out there and most of it is several years old. Some of it also advises using additional programmes but I want to stick with just using R. What package/s do people use for dealing with .hdf files in R? 回答1: Ok, so my MODIS hdf files

python GDAL 2.1 installation on Ubuntu 16.04

元气小坏坏 提交于 2019-11-26 15:24:17
问题 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

Numpy - Replace a number with NaN

对着背影说爱祢 提交于 2019-11-26 14:19:13
问题 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

Unable to install Python and GDAL (DLL load failed)

♀尐吖头ヾ 提交于 2019-11-26 10:53:56
问题 I am trying to install GDAL and Python on my Windows 7 workstation. Python-version: 2.6.6 Gdal 1.8 (Visual Visual C++ Studio 2010 Express) I followed the instructions at http://ucsb.pbworks.com/w/page/1936549/Using-GDAL-with-Python and added PYTHONPATH and the GDAL_DATA to my systems environment variables. Furthermore I modified my PATH variable by adding the GDAL binaries folder. The GDAL Python bindings I downloaded from: http://vbkto.dyndns.org/sdk/PackageList.aspx?file=release-1600-gdal-1