Questions tagged [gdal-translate]

Command line utility to convert raster data between different formats.

Filter by
Sorted by
Tagged with
2
votes
1answer
52 views

gdal translate resampling -r flag has no effect?

Whenever I add a resampling parameter (-r) to my gdal_translate commands, it seems to have no effect. For example the following two commands produce a binary exact result. How can I get my image to ...
1
vote
0answers
23 views

Python GDAL resampling incorrectly: masking actual data points

I am trying to resample GeoTIFF image from 460 m resolution to 500 m using the Python gdal library. But somehow GDAL is not resampling correctly. It is also resampling noData values, so resulting ...
1
vote
2answers
39 views

What can I do with gdalwarp that I can't do with gdal_translate, and vice-versa?

I'm new to GDAL and its utilities. My experience with both these programs (Warp and Translate) doesn't go much further than doing some image clipping, whether by coordinate's bounding box (that I do ...
0
votes
0answers
33 views

Problems georeferencing an image in QGIS with subprocess.popen() and gdal_translate

I want to georeference a raster using GDAL in QGIS 3.10's Python console. When I use the plugin I get the following script (leave only two GCPs to make it easier to read): gdal_translate -of GTiff -...
1
vote
1answer
38 views

Using GDAL to crop an SRTM DEM file from GeoJSON and translating it to bmp

I have a simple polygon shape in a GeoJSON file. { "type": "FeatureCollection", "features": [ { "type": "Feature", "properties": {}, "geometry": { "type": "Polygon",...
0
votes
0answers
25 views

Controlling number of gdal_translate cores when started via R's gdalUtils

I am processing satellite data in R and need to merge sat images of different UTM zones, which is where I ran into unexpected problems. I think I have solved them, but before moving to the production ...
0
votes
0answers
19 views

How to correctly translate an unprojected PNG image with known bounding coordinates using gdal_translate?

The attached image (original.png) has the following information: UL_lat: 67.02283275830867, UL_lon: -39.5357864125034, UR_lat: 67.62103710275053, UR_lon: 57.81196475014995, LL_lat: 31....
0
votes
0answers
22 views

gdal_translate of Tiff to gpkg with only one band and preserving of the nodata

I try to use gdal_translate in my windows command prompt to convert a single band .tif raster to a single band .gpkg. gdal_translate -of GPKG example.tif example.gpkg I always get a .gpkg with four ...
1
vote
0answers
26 views

Accessing bands of a NetCDF by datetime in Python

I want to write each band as a separate file (after gdal.Translate operation). So I can directly address to each band by datetime, not by a number? The second way, more sophisticated is to get all ...
0
votes
1answer
17 views

How to read a RasterBand as Dataset to use in gdal.Translate as source?

I need to translate each band of netcdf file to other format. How can I get raster.GetRasterBand() not as a band object, but as a dataset ot otherwise to use it in gdal.Translate(dst,src) as src?
1
vote
0answers
12 views

How can I understand the GDAL reprojecting process script?

I'm working with dataset reprojection using GDAL, specifically with netCDF files from GOES-16. The procedure consists of enter with that file in a script Python to transform the spherical view into ...
1
vote
0answers
16 views

Using gdalwarp and gdal_translate to create a KMLSUPEROVERLAY with a trasparent background from a GeoTIFF

I attempting to create a KMZ file with an image overlay that has a transparent background. I'm using a GeoTIFF exported from the CoastWatch Utility Link to TIFF file:https://drive.google.com/file/d/...
1
vote
1answer
56 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 (...
0
votes
0answers
24 views

Error with gdal_translate in R

I am trying to mosaic very large rasters in R. My code, taken from this helpful answer, worked perfectly for 3 test rasters (50 MB, 50 MB, 120 MB), but when I tried a larger test on 7 rasters (...
0
votes
1answer
30 views

QGIS Tools Change Raster Values

I am creating NDVI from Sentinel2 bands 8 and 4 on QGIS, using the raster calculator, but I need to convert the format or clip to a polygon beforehand, because my computer crashes if I try to perform ...
1
vote
1answer
45 views

How can I improve performance of gdalwarp and gdal_translate pipeline?

tl;dr: I can't get gdal_translate to use multiple cores. How to fix? I am using gdalwarp followed by gdal_translate to process a large GeoTIFF by first cropping to a polygon cutline and outputting a ...
0
votes
0answers
15 views

Georeferencing is not proper using gdal_translate and gdal_wrap

I am trying to georeference the image using GDALs gdal_translate based on GCPs . gdal_translate.exe \ -gcp 74.7768075314135 264.327152578751 622092.704992045 3065789.47975504 -gcp 245.39164998501 444....
0
votes
0answers
20 views

Convert grib to image using custom color scale?

I'm working on generating full color radar maps from a grib file. Example of the output I'm trying to create is here: https://boozedog.com/stuff/colorful.png Here's the input grib I'm using: https://...
0
votes
0answers
24 views

Is it possible to extract wavelength from pixel values?

I am new here to GIS and believe this can be better worked-out here than SO, but please do correct me if I am wrong. I am working with Python to review metadata of satellite images. Specifically, I ...
0
votes
1answer
18 views

Geo .PDF to .tiff background colour

I have a geo-referenced pdf that I'm transforming into .mbtiles or .tiff using gdal_translate 00989I11.PDF 00989I11.tiff The problem is that the result does not have a white background as I would ...
0
votes
1answer
54 views

How to install MrSID support for GDAL on Ubuntu

I'm trying to convert some MrSID files to GeoTiff format. They are mostly over 20GB each. It seems the best way to do this is to use gdal_translate with the MrSID drivers. Unfortunately, I can't find ...
0
votes
1answer
63 views

How to use GDAL /vsizip/ to access GML file(s) from Sentinel-2 zip package

Which is the correct way to write the path through the *.Zip S2 imagery package to rich the *.GML vector file(s) ? Does someone knows how to correctly write the path to *.GML file for using it with /...
0
votes
1answer
46 views

Split a GeoTIFF (BigTIFF) file into subsets with a specific overlap in Python

I have a BigTIFF file that I need to split into tiles with a set tile size and overlap. I have a script for this using PIL: tile_height = tile_width = 1000 overlap = 80 stride = tile_height - ...
0
votes
1answer
67 views

Landsat 8 Imagery not Creating Composite RGB Image with Pansharpening Correctly

I am having some serious problems attempting to merge the R,G,B bands from Landsat 8 and then apply pan sharpening to them. Unfortunately, I am not familiar enough with the process to figure out ...
1
vote
0answers
46 views

gdal_translate or gdalwarp: Preserve noData value when using DISCARD_LSB option

I want to reduce the file size of a 32bit floating point 1-Band GeoTIFF file that currently uses -99 for noData pixels. The relevant part from gdalinfo -mm: Band 1 Block=256x256 Type=Float32, ...
0
votes
2answers
52 views

Stacking a raster with GDAL in python - vrt, translate, merge giving errors

I'm trying to create a composite of all my sentinel bands into one tif in python. I've tried doing a few things but nothing seems to be working. I am using an arcpy python environment as I need a few ...
1
vote
0answers
45 views

gdalwarp from EPSG:4326 to EPSG:3031 contains no data

I have a high resolution, optimized GeoTiff file in EPSG 4326 that I want to reproject into several other projections. Target projections EPSG:3857 (Mercator) and EPSG:3413 (Arctic stereographic) work ...
1
vote
1answer
140 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 ...
1
vote
0answers
102 views

From many raster tiles to one geopackage

I need to unify many raster tiles of global land use (856 tiles, in a total of 297 GB, single band, 8 bite unsigned integer, WGS84) in a single file, I chose geopackage because of the high dimensions. ...
3
votes
1answer
48 views

Write output of multiple files to a directory using glob.glob after processing?

I want to convert the data type (Int32 to Float32) of all the tiff images in a directory 'F:\\prep\\input\\' and save/write the outputs to a new directory 'F:\\prep\\converted\\'. I have tried using ...
0
votes
0answers
34 views

Issues translating 16-bit Int (NetCDF) to GeoTIFF with gdal_translate

I am attempting to translate the .nc dataset to GeoTIFF but run into issues with the colors of the final TIFF file. It is a 1-band dataset (lat, lon, temperature (K). Command I am using: ...
0
votes
0answers
20 views

Convert 1-band .nc file to GeoTiff with RGB

How can I convert 1-band .nc file to GeoTiff with RGB? I have tried using gdal translate but it won't let me apply color interp of RGB to the .nc as it has 1 band.
1
vote
2answers
44 views

gdal_translate: error 1: Could not find an appropriate zoom level

I'm trying to put a jpeg file (a map) into Sqlite mbtiles. The command: gdal_translate -gcp 0 0 6.756394 45.192361 -gcp 0 1080 6.756394 45.127057 -gcp 1820 0 6.912606 45.192361 -gcp 1820 1080 6....
1
vote
0answers
71 views

Normalize large rasters with gdal.translate

i have a series of ndvi images that i am trying to normalize with gdal to run some calculations, but i think i'm missing something. per: https://github.com/OSGeo/gdal/blob/master/gdal/swig/...
2
votes
1answer
36 views

How remove alpha band from *.sid

I've got a ImageMosaic (GeoServer) created from 4 band *.sid files. Images become transparent around the outer edges of *.sid files . When 4-th band is removed with gdal_translate -b 1 -b 2 -b 3 -of /...
0
votes
0answers
65 views

Shifting in pixel after subsetting with gdalwarp

I am trying to subset multiple image to smaller Area of interest I have tried with gdal_translate & gdalwarp in commandline but it causes slight shift in pixel in the output raster after cropping/...
2
votes
1answer
38 views

How to convert SPL2SMAP_S data (available in .h5 files) to *.tiff files?

I had downloaded some data from https://nsidc.org/data/SPL2SMAP_S The description of the data is given in the page. Using an earthdata login, one can download the data. The data consists of *.xml and *...
3
votes
1answer
65 views

Build Mosaic using gdal based on Modal value

I have an immense (~50,000) set of tiles that I want to mosaic using the mode for every pixel. The tiles have a size of 299x299 and are overlapping each other by 2/3 respectively. For the sake of ...
2
votes
1answer
106 views

Convert GDAL command line commands to Python script or code

I'm looking to convert my GDAL commands to Python code using either GDAL or Rasterio, as I've heard this is better to use. I've been scratching my head at this and I could be missing some simple ...
1
vote
0answers
34 views

View .hdr in GenBin Format

I'm using GDAL. I have created a .HDR and .BIL file from a .TIF but I want to have .HDR file in format as it displays in GenBin not like default or EHdr or ENVI format. My desired output: {{{ BANDS: ...
0
votes
1answer
35 views

Using gdal_translate to round pixel values in raster - I'm getting an error

I tried to follow along at question: Rounding raster pixel values to one decimal place in QGIS but my python script throws a syntax error at GTiff. I do have one that works for ArcGIS but my end ...
1
vote
0answers
54 views

gdal_translate GeoTIFF to NetCDF: values

I have a GeoTIFF file of sea ice concentration. When I use gdal_info it gives a series of values like: Metadata: COLORINTERP=Palette Color Table (RGB with 65536 entries) 0: 9,60,112,...
0
votes
0answers
26 views

Sentinel-2 change NBITS

I'm trying to proccess a sentinel-2 image but i need it in GeoTIFF format. So, when i translate with gdal_translate to geotiff, it seems to be a geotiff with NBITS=15 that dont work for me. Is there a ...
0
votes
0answers
104 views

R: gdal_translate/gdalwarp/gdalUtils for georreferencing raster

I am currently working on georreferencing a 530 X 587 .bmp file called my_raster.bmp with gdal_translate and gdalwarp from gdalUtils package, which is equivalent to using GDAL with those commands. ...
0
votes
0answers
39 views

Calculating elevation angles from RPCs in NITF files using GDAL

Given a NITF, the RPCs in the NITF, and the center pixel coordinates of the image, I am trying to determine the elevation angle (center ground point to satellite). From what I understand, this can be ...
2
votes
0answers
110 views

Cannot open TIFF in QGIS after mergin with gdal_translate [closed]

I have merged several TIFF files into a bigger one. When trying to add this image to QGIS I get the following error: Cannot open TIFF file due to missing codec. Raster layer Provider ...
0
votes
1answer
56 views

Using gdal_translate command parameters [closed]

Working from these instructions: https://gdal.org/programs/gdal_translate.html#cmdoption-gdal-translate-gcp I am trying to run the gdal_translate command, here is a sample of the command I run which ...
1
vote
0answers
36 views

Getting subset with same cordinates for different rasters using gdal.translate?

I am a new into Python. I have processed 1000 NDVI rasters covering larger area. I need to burn those NDVI raster with Water mask. The water mask came for whole world I need to subset AOI and also ...
1
vote
1answer
40 views

Clipping with gdal translate does not create a file (Python)

I have tried to clip a geotiff file using the code below: from osgeo import gdal miny=-10.616665787 maxy=38.558338147 minx=34.562256098 maxx=71.187259028 ds = gdal.Open(fp) ds = gdal.Translate(...
2
votes
0answers
40 views

Accessing MODIS subdatasets from the command line?

FYI I'm new to command-line geospatial operations. I'm working with the MODIS BRDF-Albedo Quality product (MCD43A2) and am trying to: 1) do a simple gdal_calc.py operation to mask certain QA values ...

1
2 3 4 5
8