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
1
vote
2answers
17 views

Cut raster by pixels in GDAL

i've some georeferenced images that have the size of 1280 X 960. I need to cut the outer pixels to have a size of 1220 X 900 (i need to cut 30 pixel for each borders). Can i do this using GDAL or a ...
0
votes
1answer
20 views

Converting GeoTIFF to tiles using gdal2tiles

I have a GeoTIFF of weather radar data that I cannot seem to get converted to a raster tileset using gdal2tiles. When the tileset is generated, there are TONS of empty folders in the output directory, ...
0
votes
0answers
12 views

Using raster calculator with GDAL in Python to make sum?

I have 130 rasters in a folder and I would like to create a new raster containing the sum of the 130 raster cell values. How can I do this?
11
votes
6answers
6k views

Impossible to sum rasters because of nodata pixels

I have a set of rasters (.vrt) with daily soil moisture data. I want to sum the pixels of all rasters in order to have a measure by month. However, the whole world is not covered each day, which ...
6
votes
4answers
3k views

Looping through all raster cell values using GDAL via Python?

I'm trying to identify null/0 values in each of my raster bands. How can I loop through all the values of each band? I've tried this code, straight from the gdal/python cookbook website but this just ...
2
votes
1answer
137 views

Problems with some gdal functions in Mac version of QGIS3.4?

This morning I have been trying to clip, extract, do anything with a DEM in V3.4 on a mac10.14.3 (it works fine on linux Debian). I receive an error message in the dialog box - attached and the log ...
14
votes
9answers
9k views

Adding field with filename when merging shapefiles with ogr2ogr?

I'm merging some shapefiles and I had some problems doing so inside QGIS, so i'm using ogr2ogr directly. I'm doing this (in a batch): ogr2ogr -overwrite %destination% %n1% ogr2ogr -update -append %...
26
votes
5answers
38k views

Fully load raster into a numpy array?

I have been trying to check my filters on DEM raster for pattern recognition and it is always resulting in missing last rows and columns(like..20). I have tried with PIL library, image load. Then with ...
1
vote
1answer
24 views

import gdal, return “ImportError: DLL load failed:”

I came up against this problem during the installation of gdal, I tried several solutions already read on the site but none helped me. Here's what I did: 1) uninstall gdal 2) uninstall Anaconda 3) ...
1
vote
1answer
16 views

Using raster calculator with GDAL in python?

i am using an hyperspectral image with 158 bands. I want to calculate raster. i am using the following python script import gdal # Import GDAL library bindings from osgeo.gdalnumeric import * from ...
4
votes
1answer
374 views

artifacts in SRTM contour layers processed with GDAL tools and rendered with mapnik?

Here is my workflow for importing individual SRTM tiles into postgis using the GDAL utils and rendering a png using mapnik: gdal_fillnodata.py -srcnodata -32768 gdal_contour -i 10 -a ele -snodata -...
1
vote
0answers
18 views

How to convert GeoTIFF to array of normalized (0 - 1 range) values using C# GDAL Nuget Package?

I currently have a Unity3D tool that allows users to import different heightmap files into the Unity3d Game Engine, in order to produce Unity Terrain objects. The tool currently has limited support ...
4
votes
1answer
31 views

QGIS-3 does not recognize “-3.40282e+38” float raster values as NoData

I have DEMs with "-3.40282e+38" values that are supposed to be the NoData values. However, if the rasters are loaded into QGIS (3.4.11), the value can not get assigned with "add additional no data ...
2
votes
1answer
28 views

Python GDAL writing image output all pixels as zeros

I have an array "array" with numbers range from -5 to 1 (with decimal) and I tried to write it as a geotiff. However, the output geotiff turns out to be all zeros. Can someone tell me why? Here the ...
1
vote
1answer
456 views

NetCDF layer (.nc) appears flipped and rotated in QGIS

I'm trying to import NetCDF layers with environmental information to QGIS and they appear flipped and rotated In the top-left you can see the Europe coastal line I was using, in the bottom-right the ...
0
votes
0answers
13 views

Unable to install gdal2tiles on PyCharm

I have installed gdal 2.4.1 while installing gdal2tiles. I am getting this error: ERROR: Could not find a version that satisfies the requirement GDAL==2.4.1 (from gdal2tiles) (from versions: 1....
0
votes
1answer
32 views

How can I remove clouds' borders on Sentinel-2 images?

I have to replace area with clouds from another image without clouds. So I have a problem when I remove clouds from my mask I have borders of clouds. I use Sentinel-2 SLC image. For begin I open my ...
1
vote
1answer
153 views

gdal_retile for big mosaic file

I have some big mosaic files (about 3GB, 50k x 50k) and use gdal_retile.py to generate the pyramid tiles for geoserver. It takes very long time to generate all tiles (about one day in my computer). ...
4
votes
1answer
315 views

GeoTIFF (ESA Copernicus data) georeferencing coordinates are mirrored and projection slightly off when checking on Google Maps

I worked on downloading a Sentinel 5P data in my question at Converting a netCDF4 file to (georeferenced) GeoTIFF, problems with georeferencing and also transforming the netCDF4 (.nc) file into a ...
2
votes
1answer
42 views

gdalwarp - correct for a slight spatial misregistration?

Some Sentinel-2B band images have slight spatial misalignments as I explained on the step forum. https://forum.step.esa.int/t/sentinel-2-tci-10m-level-2-images-slight-spatial-misregistrations/14235 ...
0
votes
1answer
207 views

GeoTools and GDAL: CRS WKT

I would like to achieve the same output as for GDAL using the GeoTools library: CoordinateReferenceSystem crs = CRS.decode("EPSG:32632"); String wkt = crs.toWKT(); System.out.println(wkt);...
0
votes
1answer
14 views

Getting string attribute from a shapefile with GDAL Feature.GetFieldAsString(name) returns incomplete value

I read a shapefile (zipped) with GDAL library in C#. Shapefile contains .cpg file with "UTF-8" encoding specified. When I call Feature.GetFieldAsString(attributeName) some of the attribute values get ...
0
votes
0answers
15 views

Seeking documentation on DEMProcessing from GDAL?

I am using python 3.X and I am transforming a DEM (from a raster GeoTIFF file) into a slop tif file. I am using GDAL and rasterio to do that. Specifically, I am using the method: gdal....
2
votes
1answer
73 views

Convert worldfile for jpg to worldfile for png

I am using 3 band jpeg files with 1 band png masks for image analysis. The names match except for extension, and I am merging the jpgs using gdalbuildvrt, then gdal_translate to generate a geotiff. I ...
8
votes
6answers
5k views

Raster reclassify using python, gdal and numpy

I would like to reclassify a raster file from a raster with 10 classes to a raster with 8 classes using pyhton, gdal and/or numpy. The classes are represented as integers. I have tried following the ...
0
votes
0answers
23 views

Many-Many Relationship in GDAL Pixel Functions

I am using pixel functions (in Python) in VRT derived data sets. As far as I know it is only possible to use One-One or Many-One relationships within a pixel function. In other words, the in_ar ...
1
vote
1answer
34 views

gdalbuiltvrt output is different than the source images, when using dstalpha?

I have warped some images from various state plane coordinate to EPSG 3857, but the output of gdalbuildvrt is messed up (see image). I've tried dozens of different combinations of gdalwarped and ...
3
votes
2answers
1k views

stack raster using GDAL and numpy dstack

I am testing Savitzky-Golay filter with my MODIS dataset. Currently I am testing for 10 rasters (but later on will use my whole dataset) only just to test how should I create my script. So my initial ...
0
votes
0answers
10 views

GDAL C# Bindings ogr2ogr's clipsrc

I am trying to call ogr2ogr's clipsrc command from C#, but I can't find any reference other than implementing what the command does from scratch. I can imagine Using gdalwarp with c# bindings? is ...
4
votes
2answers
110 views

Improving quality of tiles generated from Ordnance Survey Raster Data

I'm trying to generate some map tiles based on the Ordnance Survey Open Data (available from here). I don't have much experience with this, but I've read a few tutorials online and have managed to ...
0
votes
0answers
28 views

Python gdal_translate move raster

I would like to translate from TIFF to ASCII, import os os.system("gdal_translate -of AAIGrid -a_srs EPSG:25830 " + 'my.tif' + " " + 'my.asc') But when I do that the ASCII file is moved: ASCII ...
3
votes
5answers
6k views

Import error: no module named _gdal_array

I am using python 2.7 and have gdal installed. I want to read an entire .jpg image at once and so I used statement import gdal from gdalconst import * driver = gdal.GetDriverByName('JPEG') driver....
0
votes
2answers
143 views

How can I write a zipped shapefile with ogr2ogr and /vsizip/?

After reading a bit of GDAL Virtual File Systems docs, I am trying to write a zipped Shapefile using this gdal command involving the use of /vsizip/: ogr2ogr -f "ESRI Shapefile" /vsizip/test.zip\test....
2
votes
1answer
35 views

Convert gnomonic projection to Mercator

I'm trying for some time to convert a weather radar map (gnomonical projection) to mercator (EPSG_3395) and then layout it onto third-party web map so far unsuccessfully. The original image: The ...
0
votes
3answers
2k views

gdal_rasterize is giving no data while converting a shapefile to raster

I have used next command: gdal_rasterize -burn 1 -tr 30 30 fire_2010.shp fireRaster2010.tif to convert shapefile to raster. But I am getting no data in the raster. The same command works for another ...
0
votes
1answer
121 views

QGIS GDAL Installation Error

I am using a Mac OS High Sierra, version 10.13.6. While installing the more recent version of QGIS, I ran into a popup that said "Failure, The GDAL 2.3 framework is required." Naturally, I opened ...
0
votes
0answers
11 views

Creating a vector tileset from a vector GeoPDF

I have a georeferenced PDF published by the USFS. It appears to have been created using Esri ArcMap, and all of the labels and linework appears to be in vector format. Is there any way to convert ...
0
votes
0answers
21 views

GDAL project lat lon coordinates to UTM in C

I have dug up some old code I wrote 6 years ago that was doing the conversion from Lat Lon coordinates to UTM. I have tried to run it today and the code returns NaN values. I suspect there has been ...
2
votes
2answers
819 views

Ogr2ogr: ERROR 1: PROJ: pj_obj_create: Cannot find proj.db

I start using GDAL 3.0.0 using conda build. I successfully installed GDAL on my laptop (Windows 10) and I am trying to ingest MapInfo tab file into Elasticsearch index. I understood that I have to ...
1
vote
1answer
54 views

Error Finding proj.db using GDAL 3.0 With MapInfo v.15

I am using GDAL 3.0, MapInfo v.15, Visual Studio 2015, and c#. Recently I updated from Gdal 2.2 -> 3.0. Since then when I use aerials to create a pdf report and then upload to S3, I receive the ...
0
votes
0answers
48 views

Installing rasterio and Fiona together?

I work on Windows; I use Christoph Gohlke wheels; Python 3.7 After installing GDAL-3.0.1 and Fiona-1.8.6 an error occurs on import of fiona from fiona.ogrext import Iterator, ItemsIterator, ...
0
votes
1answer
68 views

Extracting single band from multiple band raster with PyQGIS?

I'm approaching naw in the script and I'm trying to select many multi-band files from a folder and extract a single band from the file, putting everything in an output folder with the single-band ...
0
votes
1answer
276 views

Not able to import GDAL into Python env

I am new to Python scripting. Can anyone tell me if there is any way to import gdal into Python environment (ArcGIS Desktop 10). I am getting error while importing. Please check attached picture.
1
vote
1answer
57 views

Read RAT (raster attribute table) using GDAL or other python libraries?

Referring to this post, is there any update on the reason why GDAL function band.GetDefaultRAT() always returns NoneType? I can't find much documentation. I've tried to create a RAT for testing (...
0
votes
1answer
55 views

Gdal Build Curl Error

I'm building gdal 2.4.1 with the following config options ./configure --with-libtiff=internal --with-geotiff=internal --with-jpeg=internal --with-gif=internal --with-openjpeg --with-opencl=yes --...
1
vote
1answer
36 views

GDAL module in python error

I have some troubles with GDAL module on Python. When I try to import gdal, console displays this: Файл "c:/rstp/Lib/site-packages/osgeo/__init__.py", строка 48, из <module> __version__ = ...
4
votes
2answers
3k views

GDAL_TRANSLATE Assumes Picture is Orientated North? [closed]

I used gdal_translate to change a jpeg to a geotiff. Attempting to use gdalwarp to create a mosaic I found the images skewed and this lead me to the observation in the title of the question. Below I'...
2
votes
0answers
14 views

GDAL osgeo for python treating Z dimension differently

I have a space defined by a polyhedral surface, and I would like to check if a point is inside this space, and I would like to do this in python with gdal. After trying the default installation of ...
0
votes
0answers
9 views

Convert black color to transparent alpha gdaldem

So I have a tif and it has a black internal padding or stuff. ------- --***-- --***-- --***-- --***-- ------- So the * are the needed bit, the - however, I need to get rid of. After few web ...
1
vote
1answer
5k views

writeRaster: Error in .local(.Object, …) : Unable to create dataset

I received the following warning when trying to write a large raster (global extent) and am not sure how to proceed: Error in .local(.Object, ...) : Unable to create dataset Note that I had to ...