Linked Questions

2 votes
1 answer
11k views

GDAL translate in python - where do I find how to convert the command line arguments to use in python scripts? [duplicate]

I'm trying to use gdal.translate() to convert a raster from unit16 to int16 and I am trying to figure out what arguments to use. I think in the command prompt version I would use -ot Int16 but that ...
Emtomp's user avatar
  • 543
1 vote
1 answer
7k views

GDAL command lines on windows [duplicate]

I am trying to get started with GDAL on a windows machine using Python2.7. I have tried commands such as: gdalinfo RasterFileName.TIF and gdal_translate.py -projwin ulx uly lrx lry -of GTiff input....
user2757128's user avatar
1 vote
1 answer
1k views

How to call gdal_translate from Python [duplicate]

I want to make a translation of a grib file to tif with gdal, I use the python script, and I have always error "the specified file not found ' import subprocess src ="donnee1.grib2" dst ="donnee2....
user28253's user avatar
1 vote
0 answers
421 views

trying to clip with gdal translate [duplicate]

I'm trying to clip a raster using gdal.Translate but i get this error message: Traceback (most recent call last): File "C:/Users/Mouqsit/Desktop/test.py", line 6, in <module> ds = gdal....
zakaria mouqcit's user avatar
17 votes
1 answer
22k views

Georeferencing raster using GDAL and Python?

I want to georeference a raster using python and GDAL. My current approach is to call gdal_translate and gdalwarp using os.system and an ugly list of ground control points. I'd really like a way to do ...
djq's user avatar
  • 16.3k
13 votes
3 answers
12k views

Gdal Dataset.ReadAsArray() crashes Python

I am using Python 2.6.5 (32bit) with Numpy 1.3 and Gdal 1.9.1 installed on Windows 7 64bit. I am trying to read an 800 MB Imagine (.img) raster dataset into a Numpy array to do some raster algebra, ...
Brian's user avatar
  • 4,229
6 votes
4 answers
4k views

Storing result from gdallocationinfo as variable in Python

I'm trying to find the cell value at various locations in a set of rasters so I can count the number of real values (aka not 'NoData') that occur at all the locations within each raster. The various ...
user20408's user avatar
  • 1,545
5 votes
1 answer
3k views

How to apply "Band" settings using gdal Python bindings?

I am trying to replicate the gdal_translate command, but using pure Python: gdal_translate infile.tif outfile.tif -co COMPRESS=JPEG -co PHOTOMETRIC=YCBCR -co TFW=YES -b 1 -b 2 -b 3 I have ...
RyanKDalton's user avatar
  • 23.2k
3 votes
2 answers
2k views

Converting coordinate and raster values of each pixel to csv of large raster using Python?

There should be a simple way to convert a large raster to a csv or dataframe by reading the raster in as chunks, converting raster chunk to table of just three columns (x, y, and values), and ...
timpjohns's user avatar
  • 339
3 votes
3 answers
2k views

Using GDAL translate in Pythonwin

I want GDAL translate in Pythonwin to process some GeoPDFs to GeoTiffs. I can't call up GDAL module in Pywin. I used the OSGeo4 installer for original GDAL install and can leverage GDAL properly from ...
Tom's user avatar
  • 365
2 votes
1 answer
2k views

How to calculate affine transformation by Python gdal as same as gdal_translate?

I've made a python script which tries to reproduce what gdal_translate does (given a bounding box BBOX in EPSG:4326 and an UTM32 .jp2 file. Then, translates the BBOX from EPSG:4326 to EPSG:32632 (...
Bằng Rikimaru's user avatar
0 votes
1 answer
1k views

Convert netcdf4 to ASCII using Python and gdal: No output

I want to convert a netCDF4 dataset (including grouped datasets) to Arc/Info ASCII Grids, using Python's gdal package. I tried to orientate at this question, the only thing I added is a loop over the ...
countryman's user avatar
0 votes
0 answers
623 views

Georeferencing PNG image by GDAL in QGIS

I am not familiar with GDAL so far. Thereby I don't know how to start. By knowing the problem from the question below: Georeferencing PNG image in QGIS when the coordinates of image corners are known ...
Geographos's user avatar
  • 3,791
1 vote
0 answers
397 views

Project a subset of GeoTIFF image from UTM 32651 to EPSG:4326 by bounding box in EPSG:4326?

I have a GeoTIFF file which is in UTM 32651 and I need to develop a program, using GDAL library version 1.x (e.g., not using gdalwarp/gdal_translate binary tools) which takes a subset bounding box in ...
Bằng Rikimaru's user avatar
0 votes
1 answer
161 views

Converting PNG to GTiff increases file size using Python

I am running this script to convert PNG to GTiff and tag it with coordinates and a crs of my choice. It works just fine but after the conversion the geotiff file is 177 MB (the png is 1 mb or smt) and ...
CEB420's user avatar
  • 1