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
0
votes
1 answer

something is missing when writing data into new tif file with gdal

There are problems in my writing data into .tif file with gdal module in python. I want to extract data (numpy array) from a tif file and modify some of its values before saving it into a new one, with the new file functioning normally. I use…
longmixl
  • 1
  • 2
0
votes
1 answer

Unable to extract all points when converting tiff file to shape using gdal_polygonize.py

I am trying to extract elevation points from tiff file by converting it to shape file using gdal_polygonize.py command on Linux The conversion is successful, however the shape file does not contain all the elevation points. I am using the below…
Abhilash
  • 43
  • 1
  • 8
0
votes
1 answer

GDAL 3.4.1 build "Cannot create TIFF file due to missing codec for DEFLATE"

I have built GDAL 3.4.1 on CentOS7. Everything seems to be working except if I try to use DEFLATE compression and I get the error below. I have installed libtiff-4.1.0 and libdeflate-1.10. Previously I was running GDAL 2.3.2 using a similar build…
A. Mort
  • 278
  • 4
  • 12
0
votes
0 answers

failed to install it on Ubuntu 22.04, with gcc-11.2

all: I successfully configured and built gdal-3.4.3, but failed to install it on Ubuntu 22.04, with gcc-11.2, My ENV: ➜ ~ uname -r 5.15.0-27-generic ➜ ~ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu…
Pei JIA
  • 158
  • 2
  • 10
0
votes
0 answers

"ImportError: DLL load failed while importing _base: The specified module could not be found." error when trying to import package rasterio [python]

I am trying to import the package rasterio into python and jupyter notebook, link to package: https://rasterio.readthedocs.io/en/latest/installation.html Just to start off clean, I created a virtual environment, I will call projectenv I access…
0
votes
1 answer

How to change numpy array to geotiff array without saving on computer?

I am using gdal.translate() to make the image but its saving the formed image on local machine, I don't want to save it anywhere in my local machine and use it on run time only without saving it.
0
votes
1 answer

Hot to write an In-Memory GDAL Dataset to disk with python

I'm trying to write an IN-Memory Dataset to a GeoTiff in Disk with gdal for python gd_driver = gdal.GetDriverByName("MEM") gd_raster = gd_driver.Create('pippo', src_height, src_width, src_NBands,…
maike
  • 1
  • 1
0
votes
0 answers

Having trouble installing GDAL for python in gitbash

This is what I did in git bash. pip install gdal and the result is: error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/ [end of output] …
SSW
  • 31
  • 3
0
votes
0 answers

How to set the resolution of a Raster using gdal.Grid in python 3?

How to set the output resolution of the raster generated in gdal.Grid? I am using the code below, which produces a TIF with very large cells (~70m) however the data referenced in the vrt (filepath_vrt_in) has data at sub-metre resolution. I get the…
CJA888
  • 1
  • 2
0
votes
0 answers

Why is installing Fiona taking too long and crashes at the end?

So I've been trying to install geopandas and I found out I have to install GDAL and Fiona first. I installed GDL with the command conda install -c conda-forge gdal Then I am trying to install Fiona but it seems to be taking way more than it…
0
votes
0 answers

Compile old gcc version on Centos 8

I'm struggling compiling an old GCC version on Centos 8. Basic development tools come with GCC 8.5, but I would need to get GCC 5.3. I've tried the following: yum install glibc.i686 ncurses-libs.i686 wget…
user11681321
  • 47
  • 2
  • 9
0
votes
1 answer

How to save certain ogrinfo results to a variable?

I am using gdal's ogrinfo command in Python to obtain information about a shapefile. My code is as follows: from subprocess import Popen, PIPE args = ['ogrinfo', '-ro', '-so', '-al', 'C:/test/test_shapefile.shp'] process = Popen(args, stdout=PIPE,…
0
votes
1 answer

Can't import modules in python even if they are "successfully" installed

I'm new to this and I've had trouble starting to practice my code because of the libraries and python versions, first I must explain that I had python 3 installed and was trying to install the libraries to process Landsat satellite images with pip…
0
votes
1 answer

Attempt to invoke virtual method 'int org.gdal.ogr.Layer.CreateField(org.gdal.ogr.FieldDefn)' on a null object reference

In Android, I use GDAL to export SQLite data to Shapefile format. But I get this Exception: Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'int org.gdal.ogr.Layer.CreateField(org.gdal.ogr.FieldDefn)' on a null object…
0
votes
0 answers

GDAL dll points to old python

I am trying to use gdal from Christopher Gohlke's site and apparently, the path to the gdal303.dll is set in old Python3.9 while I am currently using Python3.10, and throws FilNotFoundError. The stack trace looks like: Watching for file changes with…
Kaleab Woldemariam
  • 2,567
  • 4
  • 22
  • 43