Questions tagged [gdal]
GDAL (Geospatial Data Abstraction Library) is a library for reading and writing raster geospatial data formats.
gdal
2,239
questions
0
votes
0
answers
15
views
GDAL Exception when using in AutoCAD .Net Plugin
I have installed GDAL and GDAL.Native v3.9.1 packages. Console application works well.
But when I use it in AutoCAD Class Library project, it always raise the exception
The type initializer for 'OSGeo....
0
votes
0
answers
20
views
Polygon area not being the same each time it's calculated
I have a shapefile with multiple polygons. I'm calculating the size of all the polygons and then summing them to get the total area. This shapefile is generated in my code and is the intersection of a ...
0
votes
1
answer
18
views
Clipping not working gdal python in a for loop
I have a block of code that work individually works but when I put it in my main block of code doesn't work anymore and i can't figure out why.
My goal is to clip a shapefile with another shapefile ...
0
votes
0
answers
13
views
can gdal.Driver handle S3 file paths?
A project that I am working on requires me to access geometries stored in a .gdb folder with OGR/GDAL as geopandas is currently not capable of accessing M values associated with those geometries.
I've ...
-1
votes
0
answers
21
views
How to Generate an Orthomosaic Map from Multi-Spectral Drone Captured Images?
I have a set of multi-spectral images captured by a drone stored in folder, using file_name we can derive its band and index, for example:
- ('IMG_0298_1.tif', 'Red', 1)
- ('IMG_0298_2.tif', 'Green', ...
0
votes
0
answers
21
views
How to install gdal-3.8.2 on Ubuntu 20.04? [closed]
I have a server with Ubuntu 20.04 that I cannot upgrade. The latest version of gdal is installed on it (3.4.3), but I need functionalities from a newer version 3.8.2. Because of the many dependencies ...
0
votes
0
answers
19
views
load gml with gdal org driver (with driver options) in c#
I try to open a wfs gml file with gdal and I want to use the options "DOWNLOAD_SCHEMA" and "GML_SKIP_RESOLVE_ELEMS".
But when I use the GML Driver, I couldn't find a way to add ...
0
votes
0
answers
11
views
gdalwarp ERROR 1: Invalid pixel size for backmap
I used following command to generate geotiff file for VIIRS NetCDF file:
./gdalwarp -geoloc -t_srs epsg:4326 -tr 0.0035 0.0035 -r near -te -70.18 -7.64 -43.96 30.91 dat.vrt i4b.tif
but failed with ...
-1
votes
0
answers
41
views
Render large .asc files, with variable colormap
Suppose I have a large .asc file (matrix representing elevation, water depth, ....), in my backend and want to visualize it on the client (with openlayers). The requirements are:
Smooth rendering
...
0
votes
0
answers
15
views
Transforming an (lat,lon) extent in GOES-16 projection with Python/cartopy/GDAL?
I have a WGS84 shapefile, which I'm trying to get its extent, firstly with its projection:
gdf = gpd.read_file("/content/buffer.shp")
bounds = row.geometry.bounds
extent = [bounds[0], ...
1
vote
0
answers
11
views
how to reslove unsatisfyLinkError for libgdal.so file in 64-bit android
I am developing an Android app that uses the libgdal.so library. When I run the app I get the error like this
java.lang.UnsatisfiedLinkError: dlopen failed:
"/data/app/~~fEMejdDPZpV3FZzivEAV9Q==/...
0
votes
1
answer
84
views
Labelling contour lines with OGR_STYLE
I'm trying to add labels to DEM contour lines.
I'm working with GDAL 3.6.2. , which I installed using Anaconda . I have some DEM data from USGS which I wrote as a contour map to a KML file using:
...
-1
votes
0
answers
21
views
how to convert KML file into shape file using GDAL (ogr2ogr) in android studio java and how to implement in android studio java
I need to Convert KML file Into Shape file using GDAL ogr2ogr library how to do the conversion from KML file to Shape file in android studio java
I found out about GDAL ogr2ogr that has Java bindings, ...
0
votes
1
answer
25
views
Selecting GDAL driver for writing KML file from TIFF
I have some DEM data from USGS which I'm trying to write as a contour map to a KML file. I'm working with GDAL 3.4.1. , which I installed using Anaconda
$ gdal_contour Downloads/...
0
votes
0
answers
33
views
How I can georeference a png image with GDAL in Django?
I am trying to georeference a png image with some control points, which would be the corner coordinates. I have achieved this using just GDAL with the following code:
from osgeo import gdal
ds = ...
0
votes
2
answers
38
views
How to install gdal using conda?
I am trying to run this line: from osgeo import gdal
I am getting this error:
from osgeo import gdal
ModuleNotFoundError: No module named 'osgeo'
However, I have already installed gdal using ...
0
votes
0
answers
17
views
MODIStsp R package: unable to download land cover data
I am trying to download land cover data using the MODIStsp R package without using the GUI, using the following code:
library(remotes)
remotes::install_github(
"ropensci/MODIStsp"
)
...
0
votes
0
answers
54
views
Using spack compile c++ and get: undefined reference to `std::__throw_bad_array_new_length()@GLIBCXX_3.4.29'
I get the error while compiling C++ on the server using the spack virtual environment and get error
/usr/bin/ld: /home/panasun/spack/var/spack/environments/hydro/.spack-env/view/lib/libgdal.so: ...
0
votes
0
answers
19
views
I want to merge geojson's adjacent grids into one large grid based on properties. What should I do?
I tried using gdal:
bash
docker run --rm -v $(pwd):/data ghcr.io/osgeo/gdal:alpine-normal-latest \
ogr2ogr -f GeoJSON /data/Zones_merged.geojson /data/Zones_smoothed.geojson \
-dialect sqlite ...
0
votes
0
answers
56
views
How to use gdal_translate in Python
I am trying to convert a netCDF file to a Cloud Optimized GeoTiff (COG) format. I have been able to do so successfully in the OSGeo4W Shell using the following command:
gdal_translate -of GTiff NETCDF:...
0
votes
1
answer
53
views
Dissolving polygons in python results in some polygons missing
I have a large code that is essentially vectorizing a tiff layer into polygon shapefile. the last step of the code is dissolving the polygons based on their value (ranging 1-5). I tried using '...
0
votes
0
answers
37
views
I have a problem when using gdal's vsimem feature
Code like this:
calculate_boundary_weights(polys_in_area, scale=config.boundary_scale).to_file("/vsimem/weights.vrt")
gdal.Rasterize(mem_ds, "/vsimem/weights.vrt", bands=[n_bands+2]...
1
vote
0
answers
31
views
How do I convert an equirectangular image to a globe with labeled data
I have 2 data sources:
A .png equirectangular image of a celestial body
A .lyr file containing labels alongside coordinates for the celestial body
How do I:
Convert the png into a globe-like ...
0
votes
0
answers
48
views
Using R, list and access individual files on an ownCloud public folder
I have a public folder on ownCloud containing over 5,000 files. I need to access each individually in R (what all my collaborators use), but I don't have an individual sharing token. I would like to ...
0
votes
0
answers
54
views
How to read in a (compressed) .gdb using R and or SF Package?
I want to open a GDB (A directory that ends with ".gdb") in R. I am assuming that some sublayers or the whole GDB is compressed, though i do not know how to confirm this. I have tried ...
1
vote
0
answers
23
views
Open File in Gdal with from Smb in Python
How can I open a file in Gdal from a Smb server without storing the file in memory?
I want to do something like this:
import smbclient
from osgeo import gdal
with smbclient.open_file(r"\\server\...
1
vote
0
answers
53
views
R crashes when I import raster layers (ERROR elf_dynamic_array_reader.h:61)
I am working with R (4.4.0) in RStudio (2024.4.1.748) in Ubuntu 22.04.
When I try to import a raster with the terra package (but also with raster package) I got this error and R crashes:
r <- rast(&...
2
votes
0
answers
118
views
How to specify system-dependent versions of dependent libraries with pyproject.toml
I am creating a library named mygeo that depends on a GDAL python package.
To install the gdal python library, we must specify the same version of GDAL that is installed on the system, like as follows:...
0
votes
0
answers
25
views
metadata error on tif to pmtiles conversion
I like to convert tif file to pmtiles. According to this: https://github.com/protomaps/PMTiles/blob/main/README.md
I should first create mbtiles and then do conversion to pmtiles but while doing so I ...
0
votes
0
answers
30
views
Set metadata in TIFF files with gdalUtilities?
I'd like to modify the metadata of a TIFF file, in particular the TIFFTAG_XRESOLUTION, TIFFTAG_YRESOLUTION and the TIFFTAG_RESOLUTIONUNIT in which they are expressed. Is this possible with R? With ...
1
vote
1
answer
32
views
Summing values from intersecting points and save the result in a polygon column
Using this link I could count all points intersecting polygons:
ogrinfo -sql "select count(*) from tmppol, tmppoi where st_intersects(tmppol.geometry,tmppoi.geometry) group by tmppol.fid" -...
0
votes
0
answers
66
views
Error: Problem: package gdal-devel-3.0.4-12.el8.x86_64 from epel requires libgdal.so.26()(64bit), but none of the providers can be installed
I have a RHEL8 machine with "8.10 (Ootpa)".
I am trying to install the following package but getting the following errors:
$ yum install gdal-devel -y
Last metadata expiration check: 2:56:...
0
votes
0
answers
13
views
How can I save a "names" attribute into a GeoTIFF using `r.out.gdal` in GRASS GIS?
I'd like to save a "names" attribute in a GeoTIFF using r.out.gdal in GRASS GIS so that when the file is opened other software, the "name" is included. For example, in GRASS I can ...
0
votes
0
answers
42
views
GeoDjango_Installation_don't_work
In my GeoDjango installation process (https://docs.djangoproject.com/fr/5.0/ref/contrib/gis/install/#windows), GDAL is an important component.
I followed the recommendations from the Python website by ...
1
vote
0
answers
65
views
Regridding two different curvilinear grids onto a common rectilinear grid with R
I have numerical model outputs (in this example, ocean surface temperature) from two different models that cover different spatial domains. Both sets of outputs are on their own curvilinear grid (...
1
vote
0
answers
27
views
Bulk insert rasters into GPKG
I wonder if there is a way to bulk insert TIFF rasters into a geopackage using python or gdal, to increase write performance.
GDAL needs to open an SQLite connection per added raster file (subdataset, ...
0
votes
1
answer
49
views
Coordinates of dataframe in a clockwise direction [closed]
I'd like to join the list of polygons in a data frame, but it is important to sort a set of coordinates in a clockwise direction. In my example:
library(dplyr)
library(sf)
test.all <- list(...
0
votes
0
answers
20
views
Inconsistent Bounding Box and Array Shapes When Querying Tiled Raster Data from PostGIS Using GDAL
I am using Python to query and visualize raster data stored in a PostGIS database. The raster data is tiled using -t auto during the import process. I have written a script to query the raster data ...
0
votes
0
answers
51
views
How to get decimals as values into the result of gdal.Polygonize() function using Python3?
I'm using gdal.Polygonize() function to vectorize main regions in a raster. It works so good!
But, the pixel values considered for the vectorization are just integers, so the clustering ignores data ...
0
votes
0
answers
32
views
Can't fetch tiles from this WMTS service with GDAL WMTS Driver
Other WMTS Services from same Geoportal work fine with GDAL, but I can not get this one to work:
gdalwarp -overwrite D:\test_gdal\wmts_raster.xml D:\test_gdal\668_raster_1.jpeg -of jpeg -te 2132898....
0
votes
0
answers
52
views
Force gdal.warp to ignore source file no data-values
I am trying to crop a satellite image (in GeoTIFF format) to the extent of a region of interest (irregularly shaped polygon outlining the area of a glacier) using gdal.warp in Python. While doing this ...
0
votes
0
answers
30
views
GDAL: GDALSetRasterNoDataValue and SetNoDataValue give different results
I am really struggling to understand this one. The former case (using GDALSetRasterNoDataValue) works as expected, the second (using SetNoDataValue) does not. Here is a minimal replicable example (I ...
0
votes
0
answers
34
views
How to package a Python program that uses GDAL into an executable file using PyInstaller?
I want to package my Python code that uses GDAL into an executable file using PyInstaller, but I keep encountering missing dependencies. Can someone provide a detailed tutorial, including how to ...
0
votes
0
answers
22
views
How to convert WEBP Mbtiles (512 x 512) to lower resolution (256x256)
I am working on world elevation mbtiles which are in WEBP 512 x 512 resolution. I want to convert this to a lower resolution WEBP 256 x 256. How can I lower the resolution?
I tried gdal-translate, but ...
0
votes
0
answers
29
views
GDAL set fixed max value for stretching tiff images
I need to homogenize a set of files where the minimum value is always 1 while the maximum should be 366
I would like to use GDAL to perform this operation and this is my code:
for tiff in `cat list....
1
vote
0
answers
33
views
How to cross-compile GDAL for aarch64-linux-gnu?
I am working on running Rust on a ZCU106 devkit (ARM64), where I'm using the GDAL crate. The Rust crate compiles fine but needs to be linked to the compiled binaries of the GDAL library in C. The ...
0
votes
0
answers
32
views
Creating patches from big TIFF file
I have a bit TIFF file with two bands. Most of it is NaN or zeros, and the only part I'm interested in is where there is information. So I'm trying to cut the image into patches of 64 by 64, and ...
0
votes
1
answer
129
views
How to cross-compile GDAL for aarch64-unknown-linux-gnu?
I require to run a crate, that depends on the GDAL Rust crate, on a ZCU106 devkit. This requires me to cross-compile my code for the target: aarch64-unknown-linux-gnu. The crate compiles for the ...
1
vote
1
answer
116
views
Exporting PostGIS Raster Data to GeoTIFF using gdal_translate - Selecting Subdataset Issue
I am trying to export a PostgreSQL table containing raster data to a GeoTIFF file using gdal_translate.
I am looking for assistance on how to specify the subdataset in the gdal_translate command when ...
0
votes
0
answers
40
views
Making RGB tiff files from red,green,and blue bands
i have three geotiff orthomosaic images which i have processed from pix4d mapper. one is red band, one is blue band, one is green band. I have to combine these three images to form an rgb geotiff ...