Exception while using GDAL in C#

I started to use gdal_csharp dll in my application and read a geotiff file. but it says: The type initializer for 'OSGeo.GDAL.GdalPINVOKE' threw an exception. it's my code string fileName =...

How to set the GDAL_DATA environment variable to point to the directory containing EPSG csv files?

I want to wrap(re-project) one variable in this netcdf file. D:\ gdalwarp -t_srs EPSG:4326 NETCDF:"C:\fie.nc":var "C:\Desktop\SM.img" But I get this error: ERROR 4: Unable to open EPSG support...

How to I get the coordinates of a cell in a geotif?

I have a tif with geoinformation. With gdal I can transform the raster file to an array (numpy). How can I get the coordinates for one entry in that array?

Optimize Reading large Raster with gdal

I'm a newbie with python/Gdal. I try to calculate distance from a point to each cell of a large raster (10000x10000). I manage to do it with the folllowing code using python/gdal but it is very...

Simplest way to save array into raster file in Python

With one 2-d array in the shape of (100, 100), I want to save it into raster file in .tiff format. I can use gdal package to read tiff files which are already exist. But I still can't find a...

No module named _gdal

I am trying to run a Python script test.py to test the gdal library. The script contains the line: from osgeo import gdal At that line I get the traceback: File "~/test.py", line 9, in...

how to plot geotiff data in specific area (lat/lon) with python

I have a geotiff raster data sets with elevation data init and i want to plot it in specific area, such as 60°E - 70° E ,70°S - 80°E. I have a bit of code from here,but the pcolormesh seem...

Trouble getting latest version of GDAL on ubuntu running R

My Ubuntu machine has latest GDAL (2.2.1, released 2017/06/23). But R complains that I have gdalversion <2.0 configure: CC: gcc -std=gnu99 configure: CXX: g++ checking for gdal-config......

GeoDjango could not find GDAL library in Windows 10

I am using Django 11.4 on Windows 10 and I am having problems when I try and migrate my models. I receive this error: django.core.exceptions.ImproperlyConfigured: Could not find the GDAL library...

conda dependencies do not install on local package build

I am building a Python package using conda-build. Right now my structure looks like this: - my_recipe/ - meta.yaml - build.sh And my meta.yaml reads thusly: package: name:...

Interpolated results from gdallocationinfo?

This: gdallocationinfo -valonly -wgs84 file longitude latitude provides the value from the file at the resolved pixel. Is there a gdal function that can provide an interpolated value from the...

Python 3: How to blur a GeoTIFF image with color table?

I've got a GeoTIFF image that I need to make blurry by applying a smoothing filter. The image itself contains metadata that needs to be preserved. It has a bit-depth of 8 and uses a color table...

is there a way in nodejs to convert a geotiff to a PNG (using gdal_translate ?)

Does anyone know if it is possible to use nodejs gdal to convert a geotiff to a regular png for example at the command line you would do: gdal_translate -of PNG -b 1 -b 2 -b 3 -scale 0 1000...

Error installing geopandas:" A GDAL API version must be specified " in Anaconda

This error raised while installing geopandas. I've looking for its solution on the web, but none of them really explain what happened and how to solve it.. This is the full error: Collecting...

Python: why do I get an error when I import geopandas?

I try to import geopandas in my jupyter notebook. import geopandas as gp and I get the following error: ImportError:...

Can we use node-gdal package in angular6 project?

I am new to angular, trying to use gdal native library in angular 6 project, Since angular uses npm and GDAL native library is also available in node.js. Can we do this using node-gdal package? I...

Generating Elevation Profile

Approach I have an array of points [[lon1, lat1], [lon2, lat2], ..., [lonN, latN]]. I am looping through the points and generating elevation on each point as: for point in points: ... alt...

Suppress message of the tm_shape() function (from tmap library)

In RStudio I try to knit my code which produces a map into html-file and get in compiled html-file besides a map an undesired message: "## Linking to GEOS 3.6.1, GDAL 2.2.3, PROJ 4.9.3". This...

Parallel spatial processing based on GDAL/OGR with spatial filter using python?

I'm applying a spatial filter sequentially with GDAL/OGR in Python in order to calculate a point density: point = ogr.Geometry(ogr.wkbPoint) point.AddPoint(xCoord, yCoord) searchArea =...

PyInstaller: StopIteration Error when I import geopandas

I am trying to execute PyInstaller on a my script. I installed all of the required packages and the .exe is succesfully created. But when I execute it on another machine, I get he Following...

Translate .ecw to .tif with GDAL from OSGeo in Python

I have about 250 .ecw files I want to transform to .tif or .png or .jpg using GDAL and Python. This is my code: from osgeo import gdal inputfile =...

ImportError: cannot import name 'rcParams' from 'matplotlib'

I have tried to uninstall and reinstall matplotlib in my tf-gpu enviornment I made but I keep getting this error: ImportError: cannot import name 'rcParams' from 'matplotlib' This is the entire...

Unable to replicate gdal output

I have a set of GRIB files that are fliped (longitude spans from 0 to 365), and I am using gdal to first transform the data to GeoTIFF, and then warp the gridded data to a standard WGS84...

Bilinear Interpolation on rasters to create daily raster files

I have raster (.tif) files for every four days interval (e.g. LAI.Day.2015.10.24.tif, LAI.Day.2015.10.28.tif, LAI.Day.2015.11.01.tif, LAI.Day.2015.11.05.tif, LAI.Day.2015.11.09.tif, so on). Is...

How to pip install GDAL on Python 3.6 venv

gdal is correctly installed on my global system's python 3.5 packages. But now I'm trying to pip install gdal on my python 3.6 virtual environment, but I receive multiple errors. After activating...

Failed to generate executable file for Django by pyinstaller

I have tried to find solutions on google, but it seems that there aren't some suitable solutions. OS: Win 10 Python version: 3.7 Django version: 3.1.5 pyinstaller version: 4.2 There are the...

M1 Mac - GDAL Wrong Architecture Error [Django]

I'm trying to get a django project up and running, which depends on GDAL library. I'm working on a M1 based mac. Following the instructions on official Django docs, I've installed the necessary...

Cargo test--failed to run custom build command for `ring v0.16.9`

I am trying to compile a Rust project on Windows by using Visual Studio code. But the compiling has error. I have double checked my cargo version which is the latest. C:\Users\Lenovo>rustc -V ...

ImportError: the 'read_file' function requires the 'fiona' package, but it is not installed or does not import correctly. Importing fiona resulted in:

Trying to read a shapefile (.shp) and received an ImportError after executing the below line of code. I even pip installed GDAL, geopandas, fiona and shapely before executing the below...

How can files be opened by name in shared storage with native libraries without all files permission?

We are writing a C++ app that is cross compiled for Android. This app uses native libraries (namely gdal and Qt) to read and write files. These files often have references to each other (e.g. a...