Questions tagged [gdal]

GDAL (Geospatial Data Abstraction Library) is a library for reading and writing raster geospatial data formats.

GDAL (Geospatial Data Abstraction Library) is a library for reading and writing raster geospatial data formats.

2184 questions
21
votes
9 answers

Install gdal using conda?

I used conda install gdal to install the GDAL packages. But I had the following error when importing the packages. >>> from osgeo import gdal Traceback (most recent call last): File "", line 1, in File…
DQ_happy
  • 505
  • 2
  • 6
  • 20
21
votes
1 answer

How do I write/create a GeoTIFF RGB image file in python?

I have 5 numpy arrays of shape nx, ny lons.shape = (nx,ny) lats.shape = (nx,ny) reds.shape = (nx,ny) greens.shape = (nx,ny) blues.shape = (nx,ny) The reds, greens and blues arrays contain values that range from 0–255 and the lat/lon arrays are…
Andy
  • 353
  • 1
  • 2
  • 10
19
votes
1 answer

No such file or directory: 'gdal-config'

I am trying to install fiona and geopandas on a mac machine. I have installed GDAL trough brew install gdal --HEAD If I try install fiona, I get the following: sudo pip3 install fiona Collecting fiona Downloading Fiona-1.8.18.tar.gz (1.3 MB) …
emax
  • 6,965
  • 19
  • 74
  • 141
19
votes
3 answers

Set SHAPE_RESTORE_SHX config option to YES to restore or create it

I am not able to read the shape file. It says no such working directory. !pip install sentinelsat !pip install geopandas !pip install folium from sentinelsat import SentinelAPI user = '****' password = '****' api = SentinelAPI(user, password,…
19
votes
2 answers

ImportError: No module named gdal

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…
maRtin
  • 6,336
  • 11
  • 43
  • 66
18
votes
7 answers

Unable to install Python and GDAL (DLL load failed)

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…
Mario
  • 483
  • 1
  • 4
  • 15
18
votes
5 answers

Reading hdf files into R and converting them to geoTIFF rasters

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…
James
  • 1,164
  • 2
  • 15
  • 36
18
votes
11 answers

Exception while using GDAL in C#

I started to use gdal_csharp dll in my application and read a geotiff file. but it says: The type initializer for 'OSGeo.GDAL.GdalPINVOKE' threw an exception. it's my code string fileName = @"/path to geotiff file"; OSGeo.GDAL.Dataset DS = …
Hossein Narimani Rad
  • 31,361
  • 18
  • 86
  • 116
18
votes
4 answers

Python multiprocessing design

I have written an algorithm that takes geospatial data and performs a number of steps. The input data are a shapefile of polygons and covariate rasters for a large raster study area (~150 million pixels). The steps are as follows: Sample points…
hendra
  • 700
  • 2
  • 6
  • 16
17
votes
4 answers

GeoDjango - GDAL library giving error

I am trying to get GeoDjango running on ubuntu and have hit a problem with GDAL. I have downloaded and installed GDAL without problem. I had to add the following line to my project settings: GDAL_LIBRARY_PATH = '/usr/local/lib/libgdal.so.1.15.1' …
Darwin Tech
  • 18,449
  • 38
  • 112
  • 187
17
votes
1 answer

Plot GDAL raster using matplotlib Basemap

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 =…
Mattijn
  • 12,975
  • 15
  • 45
  • 68
17
votes
2 answers

How to project and resample a grid to match another grid with GDAL python?

Clarification: I somehow left out the key aspect: not using os.system or subprocess - just the python API. I'm trying to convert a section of a NOAA GTX offset grid for vertical datum transformations and not totally following how to do this in GDAL…
Kurt Schwehr
  • 2,638
  • 3
  • 24
  • 41
16
votes
2 answers

Provide a path to gdal-config using a GDAL_CONFIG environment variable error while attempting to install Fiona

This is the error I receive: A GDAL API version must be specified. Provide a path to gdal-config using a GDAL_CONFIG environment variable or use a GDAL_VERSION environment variable. after running the command: pip install Fiona from the command…
Recessive
  • 1,780
  • 2
  • 14
  • 37
16
votes
10 answers

GeoDjango on Windows: Try setting GDAL_LIBRARY_PATH in your settings

I've done this a dozen times before, but something isn't working this time.. Following the docs: https://docs.djangoproject.com/en/1.11/ref/contrib/gis/install/#windows I'm trying to set up GeoDjango on a Windows machine (this one is a virtual…
Adam Starrh
  • 6,428
  • 8
  • 50
  • 89
16
votes
2 answers

How can I get the installed GDAL/OGR version from python?

How can I get the installed GDAL/OGR version from python? I aware of the gdal-config program and are currently using the following: In [3]: import commands In [4]: commands.getoutput('gdal-config --version') Out[4]: '1.7.2' However, I suspect…
fmark
  • 57,259
  • 27
  • 100
  • 107