Questions tagged [gdal]

GDAL (Geospatial Data Abstraction Library) is an open source translator library & set of command-line utilities for processing raster spatial data formats. As a library, it presents a single abstract data model to the calling application for all supported formats. It also comes with a variety of useful commandline utilities for data translation and processing.

Filter by
Sorted by
Tagged with
0
votes
0answers
10 views

Clip MBTiles with BoundingBox

I have a relatively large worldwide raster mbTiles file from which I want to convert individual countries into new mbtiles. Unfortunately i fail to use tilelive which is actually predestined for this ...
0
votes
0answers
14 views

MODIS data download issues with runGdal in R

I'm trying to download some MODIS data using the following function, which errors like so: ndvi.evi <- runGdal("MOD13Q1", collection = "006", tileH = 20, tileV = 11, ...
0
votes
1answer
19 views

Find geographic position of one raster on another raster in GDAL Python

How do I find georeferenced raster2 position on another georeferenced raster1 with GDAL in Python in pixels? For example -10,10 or 200,300 (pixels from 0,0 of raster1 to 0,0 of raster2). Assuming that ...
1
vote
0answers
12 views

ImportError: No module named osgeo

I'm running a .bat script (included) in the cmd prompt. I get the error "ImportError: No module named osgeo" when it tries to call the gdal_merge.py command. I think this has something to do ...
0
votes
0answers
16 views

GDAL GetNoDataValue from HDF5 band

I am opening HDF5 file like this: import gdal hdf_ds = gdal.Open("myhdf.h5", gdal.GA_ReadOnly) band_ds = gdal.Open(hdf_ds.GetSubDatasets()[0][0], gdal.GA_ReadOnly) In documentation it is ...
0
votes
0answers
17 views

Providing GDAL with right encoding

I am using osgeo4w shell to execute gdal_translate command for creating geospatial pdf. My command is: "gdal_translate -of PDF -tr 0.0001 0.0001 -a_srs EPSG:3765 Granice.tif ...
0
votes
0answers
21 views

Mosaic multiple 7gb TIFF into one big TIFF

I have data of 10 sets each with 361 channels in format of ENVI. Each set contain: 7gb format-less file (BSQ #UPDATE) 2.4gb .ENP file 9kb .HDR file I try to mosaic all of them in one big file. What ...
0
votes
0answers
21 views

Remapping a raster map using GDAL in Python

I have a numpy array of data in Python that is a processed version (outliers set to zero, for example) of data from an Albers Conical United States (US) map: PROJCS["Albers Conical Equal Area&...
0
votes
0answers
36 views

R gdalwarp issues under new PROJ6 libraries

i have a workflow that incorporates gdalwarp from gdalUtils in R, to reproject 1km UK data in British National Grid to 0.01 degree data in WGS84. This is always a tricky transformation due to the ...
0
votes
0answers
15 views

GDAL/Python intersection does not include fields from method layer

As stated in title. I'm intersecting two layers and expecting fields from both input and intersect/method layers in the result. This is the behavior as describe in API docs (https://gdal.org/python/...
0
votes
1answer
28 views

Keep getting a black tiff when rasterizing a shapefile with GDAL

I have a shapefile that looks like the follows: And here's how the attribute table looks like: I'm trying to rasterize it with a reference raster and my code is as follows: input_vector = ...
0
votes
0answers
4 views

Missing grib metadata when using CDO tool to invert Lat axis from South-North to North-South?

I have a grib file (it is quite big) and I tried to use cdo to copy it to another grib file. cdo -R copy ws10m_mean24h.grib test.grib However, in this diff: https://www.diffchecker.com/w25sayVz it ...
0
votes
0answers
26 views

Rasterio: Issue with `writing a dirty block from GDALRasterBand::IRasterIO` even with `LibTiff` > 4.0 on Windows and Mac, but not Linux

I was hoping someone might have some insights. I am using python rasterio to compress some large GeoTIFF imagery files. By large I mean 2-3 GB compressed, or on the order of 60,000 x 60,000 pixels ...
0
votes
1answer
72 views

Cannot get projection from raster dataset using .GetProjection()

I can't figure out how to get the projection info from a raster file using gdal. I thought my raster had a bad srs so I used a script from # https://gdal.org/tutorials/raster_api_tut.html to create a ...
1
vote
0answers
29 views

How to mosaic/align multispectral georeferenced images into one merged file with gdal

I am trying to work my head around how to make mosaic from georeferenced multispectral images. Header of those images already contans information about GPS location. Separate image is saved as *.tif ...
0
votes
0answers
18 views

Python GDAL VRT reading using 50% of available memory. How to limit this?

When reading in areas of a VRT with vrt.ReadAsArray(...) I see RAM usage will keep increasing up to about 50%. This is fine but becomes a problem for when running on a computing cluster with huge ...
1
vote
0answers
29 views

Attribute error: 'NoneType' object has no attribute 'GetLayer' geoPDF

I have written some code to export projection information from geoPDF’s. For some reason on some of the files I get the following error and other are fine. AttributeError: 'NoneType' object has no ...
0
votes
0answers
30 views

Clipping raster is taking too long in 3.16.0-Hannover

Okay so I wanted to clip [this][1] raster with this [JPN_adm0.shp][2] file. It's been more than 6 hours and it's still on "Processing algorithm part." I have a decent PC that has 12GB of RAM ...
0
votes
0answers
22 views

Convert a NetCDF layer to GeoTIFF image using gdal_translate, applying mask from another layer

My objective is to convert a layer in a NetCDF file to GeoTIFF image with gdal_translate, applying mask from another layer in the same NetCDF file. Sample NetCDF file: sample file on dropbox (~ 6Mb) ...
0
votes
1answer
23 views

Convert GeoTIFF height map to raw file for Unity terrain

I have a GeoTIFF file that QGIS has produced from merging multiple DEM TIFFs together. The gdalinfo for this file is: Driver: GTiff/GeoTIFF Files: ca_heightmap.tif Size is 39601, 39601 Coordinate ...
0
votes
0answers
27 views

Converting subdatasets (time series) in NetCDF file to CSV, TIFF or vector data with bounding box

I have a data netCDF file that constains multiple two dimensional subdatasets that are basically geo-referenced time-series data. The output of gdalinfo from the top level dataset as well as one ...
0
votes
0answers
17 views

How to put palette labels programmatically to a singleband raster? [closed]

Let's say you have a raster file mosaic.tif with the following palette like so: and you want to change its labels like so: Can this be done programmatically using GDAL tools or R programming or ...
1
vote
1answer
50 views

Cannot convert float Nan to integer with raster data

I have a script that basically takes a low resolution raster grid and creates elevation band text file for this raster based on a high resolution DEM. The data can be accessed from here. On Conda ...
0
votes
0answers
32 views

Slope Analysis with Python

I am trying to perform a slope analysis using Python and GDAL. The DEMs have a CRS of EPSG:4269 which is NAD83 and a geographic coordinate system. Previous attempts to perform a slope analysis ...
0
votes
0answers
15 views

Convert GeoTIFF to GeoJSON using Python or R [closed]

How can we convert GeoTIFF file to GeoJSON file in Python or R? I am able to convert GeoTIFF to CSV using gdal_translate , for example, a 17MB TIFF files get converted to a 50GB CSV file. Is this ...
0
votes
0answers
21 views

QGIS 3x GDAL raster to vector (polygonize) option doesn't work

I want to convert my Geotiff map into the shapefile. For this purpose, I used the GDAL->Raster Conversion -> Polygonize option. I have the status "Processing algorithm" for nearly 2 ...
1
vote
0answers
16 views

Using QGIS with GDAL installed conda on Mac OSX

I used conda to install GDAL in a virtual environment in OSX 10.15 (Catalina). I have no problem running the GDAL scripts in terminal (such as gdal_translate, gdalwarp, etc). I also installed QGIS (3....
0
votes
0answers
17 views

How to Access/Write to a Shapefile in S3 Bucket using BOTO3 and GDAL

I'm trying to access and make edits to a shapefile that's located in a zip on an S3 bucket. So far I've used /vsizip/vsis3/ to access the zip file that the shapefile in question came in. I've made the ...
4
votes
0answers
33 views

ogr2ogr creates too many columns with LEFT JOIN

I am creating a GeoPackage using several shapefiles using ogr2ogr (GDAL 2.2.4): ogr2ogr -f GPKG /path/to/out.gpkg -append -nln out -a_srs EPSG:4326 /path/to/in1.shp ogr2ogr -f GPKG /path/to/out.gpkg -...
2
votes
0answers
37 views

Deprecated CRS (EPSG:2163) gets reinterpreted as another CRS (EPSG:9311) by GDAL

I recently noticed that all vector and raster files with CRS EPSG:2163 (US National Atlas Equal Area) are being automatically reinterpreted as EPSG:9311. When I load the layers into QGIS initially ...
3
votes
1answer
37 views

Forming a single TIFF image of a Sentinel 2 tile [closed]

I downloaded the data using the following command from Amazon S3 bucket : aws s3 cp s3://sentinel-s2-l2a/tiles/51/H/VC/2020/10/19/0/ aus1 --recursive --request-payer. Then translated the 13 bands ...
3
votes
1answer
37 views

Converting grayscale VRT to palleted VRT using GDAL tools

I have this virtual file called virtual-raster.vrt with the following gdalinfo of: Band 1 Block=1x1 Type=Float32, ColorInterp=Gray I just want to convert it into a palleted one like so: Band 1 Block=...
5
votes
0answers
56 views

Reading raster backward using GDAL

I am currently working on two-scan raster algorithms (euclidean distance transformations, cost surface analysis, etc.). Those algorithms require a line-wise forward raster scan (from top left to ...
0
votes
0answers
35 views

GDAL ogr2ogr Converting DateTime to String

I'll preface this by saying I'm brand new to using GDAL. I'm using it in the Linux (Ubuntu) terminal. The GDAL version is 3.0.4. I'm using ogr2ogr to convert ESRI geodatabase feature classes to ...
2
votes
0answers
26 views

How to force PostGIS to use a specific GDAL version in Mac?

I am using PostGIS 2.5.4 on PostgreSQL 12.4 under macOS 10.13 environment. Although GDAL version 2.4 is already installed in "/Library/Frameworks/GDAL.framework/Versions", the query select ...
0
votes
2answers
17 views

gdal.VectorTranslate fails to wrap the antimeridian on specific input

I'm trying to split a GeoJSON polygon which crosses the antimeridian. I use this solution as base gdal.VectorTranslate returns an empty file My code is: geojson_str = <some geojson string> ...
0
votes
0answers
17 views

Identify Number of Ground Control Points in DSM Using GDAL

I am trying to use GDAL (in Python) to extract metadata from a digital surface model (.tif). I am using the "gdalinfo" command and applying different flags (e.g. -stats, -mm) to get ...
0
votes
0answers
21 views

gdal_rasterize incorrect values scale after rasterization

I am trying to rasterize a .shp file (in particular it is made up by several Polygon) into .tif one by using python and the gdal_rasterize command. According to the gdal_rasterize function, I was able ...
-1
votes
0answers
20 views

Georeferencing dwg file using GDAL/ogr2ogr

I have a .dwg-file which needs to be georeferenced via web application using GDAL or ogr2ogr without using ArcGIS or QGIS. I am really blind on achieving this. Any suggestions on how to do this?
0
votes
1answer
24 views

gdal_translate outputs coordinates in metres, but I need degrees

I wish to convert a HDF5 file into NetCDF, with the output NetCDF containing the selected band(s) and the latitudes and longitudes. The data provider gives this info about the original file: Table 2. ...
0
votes
0answers
14 views

Rasterize(Convert Points to Raster) :UnicodeDecodeError in QGIS3

I used Rasterize in QGIS3 to convert points to rasters. The source file of the point layer used is as follows: But clicking Run displays the following error message: Traceback (most recent call last):...
2
votes
2answers
67 views

Finding rivers from GeoTIFF files with GDAL

I've grabbed a bunch of .tif-files (from http://dwtkns.com/srtm/) and I am trying to render it in 3D as terrain. I've converted it to a 16-bit heightmap successfully but I am curious is there any way ...
1
vote
0answers
31 views

Strange rendering artifacts when adding overviews to my geotiff (gdaladdo)

I have a geotiff that I want to render using Tilemill. It's a quite large area, so I need to create overviews for it. Otherwise the rendering performance is just very bad. (Maybe somebody has other ...
1
vote
1answer
31 views

Determining driver, spatial reference and other props from an open GDAL layer

I have a very large network share full of data (raster, vector, sometimes mixed inside of geopackage and/or file geodatabase containers). I have a set of classes that crawl through it all and use ...
3
votes
2answers
41 views

Performance regression: fiona.transform much slower since GDAL 3

I have run into some severe performance degradation when upgrading an environment to GDAL3. I could track the issue down to fiona.transform, which is a lot slower (about 15 (!) times) now than it was ...
0
votes
0answers
33 views

Incorrect projection when converting GeoJSON to shapefile via OGR2OGR

I've created a GeoJSON file whose projection, for example, is EPSG:2154 / Lambert93. I've converted it to shapefile using OGR2OGR. But .prj file includes WGS84 description instead of Lambert93, as ...
0
votes
1answer
17 views

How to get the EGM96 and EGM2008 elevations of a list of WGS84 lat/lng coordinates from a file using GDAL?

I'm trying to do the following: Given a list of WGS84 latitude / longitude pairs in a text file (one pair per line), I'd like to compute the EGM96 and EGM2008 elevations corresponding to those points ...
1
vote
2answers
72 views

Non-noded intersection issues from overlapping buffer objects

I am working with valid lat/lon point data, creating buffers, and trying to calculate overlapping areas from buffers and running into the not-so-rare error with non-noded intersections when using ...
1
vote
1answer
26 views

gdal_translate to JPEG has no EXIF in the output

I am trying to create .jpg files that can be consumed on the web from a .tif image. I would like to rely on EXIF data about the image metadata, however, I fail to read any. What am I doing wrong? $ ...
1
vote
0answers
23 views

Deduplicating overlapping borders? [duplicate]

I've got a gpkg file with country borders and I'd like to draw a dashed line for those borders. However, when I set the style as a dashed line in QGIS I get this: The problem is that the overlapping ...

1
2 3 4 5
96