Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.

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
0answers
8 views

Exctract DEM by list of vertex with GDAL

How can I generate a DEM of an area given the vertex list of the polygon that includes it? What I want to achieve is similar to the output of gdalwarp, eg: gdalwarp -t_srs EPSG:4326 -te x_min y_min ...
1
vote
0answers
17 views

ogr2ogr can't append shapefile to existing Postgres table

Using ogr2ogr within python (and Windows 10), I can upload a shapefile to Postgres as a new table. However, my shapefile is made of 10 parts (10 shapefiles). I can upload the first .shp but when ...
0
votes
0answers
23 views

Update raster value at point with Python

I am looking for a fast way to update one value in a raster. Similar to this solution but the other way round. Normally I would go with generating a raster and run a conditional grid operator like it ...
2
votes
2answers
53 views

How to determine if a GeoTIFF image is a photo or a raster map using GDAL and Python

Does anyone have a method to determine if a GeoTIFF image is a photo (e.g aerial ortho) vs a raster map (e.g topographic map produced from vectors) using GDAL and Python? Both images are RGB/RGBA ...
1
vote
0answers
11 views

Is there a way to independantly hillshade the overviews of a GeoTIFF pyramid in GDAL?

Is there a way to get gdaladdo, gdaldem or another GDAL tool to create a hillshade where each overview is shaded from the corresponding overview in the DEM rather than by resampling a single full ...
0
votes
0answers
17 views

GDAL installation required for users?

I'm writing a little Java program to read some shapefiles & spit out the result of some calculations. I'm using GDAL, as the arcObjects.jar for ArcGIS Desktop is too restrictive for what I need (...
1
vote
1answer
31 views

Calling GDAL (programs) from Python

Could someone navigate me for using/calling GDAL stand-alone programs from Python? I have GDAL 2.3.2 and Python 3.7. When I call gdal from python I can access to a limited number of functions ...
0
votes
1answer
25 views

gdaldem - raster to RGB raster with color-relief

I have 6-layer raster with float value. I have six diffrent qgis style with color value Here is image value from qgis: Here is a qgis style (for 6 layer): <!DOCTYPE qgis PUBLIC 'http://mrcc.com/...
1
vote
0answers
16 views

Get pixel value GDAL in C

I have the following code that works well to print out the individual values of pixels on a image (first band), using C-GDAL. #include "gdal/gdal.h" #include "gdal/cpl_conv.h" #include <stdio.h>...
0
votes
0answers
9 views

GDAL - Class File Editor: Source not found, The source attachment does not contain the source for the file osrJNI.class

Trying short java code example through gdal in eclipse, which fails. link: https://trac.osgeo.org/gdal/browser/trunk/gdal/swig/java/apps/OSRTest.java code: import org.gdal.osr.SpatialReference; ...
0
votes
0answers
22 views

R: gdal_translate/gdalwarp/gdalUtils for georreferencing raster [on hold]

I am currently working on georreferencing a 530 X 587 .bmp file called my_raster.bmp with gdal_translate and gdalwarp from gdalUtils package, which is equivalent to using GDAL with those commands. ...
0
votes
1answer
19 views

How to normalize elevation of GeoTIFF file data stored as unsigned integers?

I have a GeoTIFF file where the pixels are stored as unsigned 16 bit integers. I am using C# Gdal bindings to read the GeoTIFF file, using the Band.ReadRaster method, in order to produce an array of ...
-1
votes
0answers
7 views

Seeking GDAL tutorials for Java and/or C# developers [closed]

I'm new to GDAL and combing for resources. Primarily a java developer, newbie learner of C#. What tutorials are available & useful for java & C# devs working with GDAL, if any? Sometimes ...
0
votes
0answers
11 views

ModuleNotFoundError: No module named '_gdal' … but I have GDAL

I'm really at my wit's end with this. I'm on a Macbook running Sierra 10.12, so I used the KyngChaos installation of QGIS 3.8. I followed the instructions in the ReadMe (added the PATH variable), and ...
1
vote
0answers
22 views

ESRI FIleGDB API dll failure: ogr2ogr can't recognize File GDB as driver type

I have been trying this for a day or two now, and I have followed the instructions listed here: How to add support for FileGDB (Esri file gdb API) driver in fiona but for the life of me I can't ...
0
votes
2answers
59 views

How to rotate rasters with GDAL, QGIS or GRASS GIS

I need to rotate raster files from the TRMM Multisatellite Precipitation monthly product 3B43. For some unknown reason, this data comes rotated 90 degrees clockwise, meaning that the y coordinate is ...
0
votes
1answer
27 views

QGIS gdal_contour not respecting scale_factor/offset for netCDF

I am working with some netCDF files and want to import netCDF parameter's data as a Raster and build a contour layer for it. I am using gdal_contour for this. When I import the netCDF and choose a ...
1
vote
0answers
22 views

Rotating raster cells with QGIS GDAL

I've written a PyQGIS script based on this answer to the following question: Writing numpy array to raster file My data shows up at the correct, expected location but the raster cells, which are ...
1
vote
0answers
22 views

GDAL framework does not exist after KyngChaos installation of QGIS

I'm on a Macbook running Sierra 10.12, so I used the KyngChaos installation of QGIS 3.8. I followed the instructions in the ReadMe, and installed python (though I already had it on my machine), GDAL ...
1
vote
0answers
40 views

Raster map not found error with r.fill.dir

I am new the GIS world and I am having trouble with generating depressionless DEM from lidar elevation data. I am using GRASS 7.6.1 and QGIS 3.4.12. I have used r.fill.dir successfully on a ...
1
vote
0answers
31 views

GDAL Error in CreateCopy: in method 'Driver_CreateCopy', argument 3 of type 'GDALDatasetShadow *'

I'm working on a simple script using GDAL Driver.CreateCopy function, but I keep getting the same error. The script is very basic: import os,arcpy,sys from osgeo import gdal source_folder=r'E:\...
1
vote
0answers
19 views

Multi-temporal stack does not include all bands

I made a stack of images for a multitemporal series for 7 months (one per month with 5 bands) with gdal, but the stack that comes out to me consists of a single band for each month, probably the first....
0
votes
0answers
11 views

Calculating elevation angles from RPCs in NITF files using GDAL

Given a NITF, the RPCs in the NITF, and the center pixel coordinates of the image, I am trying to determine the elevation angle (center ground point to satellite). From what I understand, this can be ...
1
vote
0answers
13 views

GDAL python package with Anaconda and ElasticSearch 7 [closed]

I'm trying to import feature data into elasticsearch v7.4 using GDAL to convert from an ArcGIS feature service layer into geoJSON for indexing. We use anaconda 3 (latest version 2019.10) for our ...
1
vote
0answers
32 views

Invalid SRID in PostGIS when importing data by ogr2ogr

I am using PostgreSQL 12 with PostGIS 3.0.0 and GDAL 3.0.0 to copy data in it. The command I am using is: ogr2ogr -f "PostgreSQL" PG:"host=127.0.0.1 dbname=db user=user port=5432 password=1" "file....
1
vote
1answer
32 views

Importing gdal_array from gdal in Conda

I'm working through python examples in a geospatial book using jupyter notebook and have run into trouble trying to import gdal_array from my gdal installation. I've seen several old questions and ...
3
votes
1answer
82 views

Cannot find plugin for GDAL raster miscellaneous tools ( merge ) in newly installed QGIS

I am using QGIS 3.8.3. I'm looking for the Gdal tools "miscellaneous" under the raster menu. It does not appear, nor can I find where to install it in the plugins. Specifically I am looking for the ...
1
vote
1answer
31 views

Create a point from a lat/long list using GDAL

I have a shapefile with a bunch of wildfire perimeter data, and a dataframe with lat and long columns about the lat and long of fire origin points. The information is not connected except by date, so ...
1
vote
2answers
27 views

How to substact 2 dem.tiff rasters through GDAL?

I'm a beginner in GDAL and don't understand the logic of it work completly. I have a folder with 2 DEM-tif files and I need to do this: gdal_calc.py -A D:WORK\gdal\dem05.tif -B D:WORK\gdal\...
1
vote
2answers
60 views

GDAL - Resize a image to a specific dimension, while maintaining ratio [closed]

I want to resize an RGBA geospatial image to a specified smaller height and width using GDAL tools while maintaining the image ratio and centering the original image content. Specifying the height and ...
2
votes
2answers
35 views

Running ogr2ogr in Python on Windows

I run ogr2ogr to transfer geometrical data from a pgsql (PostGIS) database to a MS SQL one. It works quite well. I'm trying to achieve exactly the same result in Python, as I'm planning to use ...
0
votes
0answers
23 views

GDAL virtual dataset with transparency

I'm trying to create image pyramid of multiple smaller images for GeoServer use. I have done this by first creating virtual dataset with gdalbuildvrt and then with gdal_retile.py. The problem I'm ...
0
votes
0answers
24 views

Convert output of Image Segmentation/Classification (From land-use classification) into different shapefiles

I am performing the Landuse Classification on satellite imagery. I have classified my image into different categories. I have the shapefile of the original image, now I want to create the separate ...
1
vote
0answers
33 views

Using ogr2ogr to clip shapefile based on coordinate query

I have some shapefiles that I would like to convert to GeoJSON and clip to display only Arctic regions (for example, everything above 45°N). I tried the following, but nothing is clipped. Any ...
0
votes
0answers
9 views

Cannot print the correct values of array in C - GDAL

I have the following code, which opens a raster file using C, then gets some attributes, and then declares in line :23 a variable called line, then I read the raster as array using GDALRasterIO. #...
0
votes
0answers
34 views

Setting up Python and QGIS for standalone applications

I am learning QGIS for an upcoming internship. I have been trying to configure Python 3.7.5 with QGIS 3.8 (a Coruna) for two weeks now. I have overcome quite some issues by reading a lot of posts, but ...
0
votes
1answer
24 views

Use GDAL to resample and stack multidate image spectral bands

I have a Sentinel 2 multidate image data set and I'm trying to resample all of them at 10m and then stack them to apply a cloud mask, in Python language. Being new to programming, I have a hard time ...
0
votes
0answers
15 views

Python GDAL ReadAsArray vs C-GDALR

I am trying to iterate over the values of a raster dataset (band1). I am able to do it in python with the following code snippet (sorry I can't provide the original raster) import numpy as np import ...
0
votes
1answer
19 views

Using gdal_translate command parameters [closed]

Working from these instructions: https://gdal.org/programs/gdal_translate.html#cmdoption-gdal-translate-gcp I am trying to run the gdal_translate command, here is a sample of the command I run which ...
1
vote
0answers
16 views

Getting subset with same cordinates for different rasters using gdal.translate?

I am a new into Python. I have processed 1000 NDVI rasters covering larger area. I need to burn those NDVI raster with Water mask. The water mask came for whole world I need to subset AOI and also ...
0
votes
0answers
13 views

Iterate over every single value in a Raster GDAL C API

I am learning C, and I am trying to use the C API to iterate over the values of an array. So far I've been playing around printing the projection, Width and Height of the raster, but I would like to ...
1
vote
0answers
31 views

Merge *.png files into one using GDAL

I built a Python script that downloads tiles from some map service. This service cannot be imported to QGIS as a tile layer so I decided to download tiles directly using requests module. The script ...
4
votes
2answers
99 views

Converting raster pixels to polygons with GDAL python

I want to convert raster pixels to vector polygons as below image that is output of "Processing Toolbox--> Vector Creation--> Raster pixels to polygons" in QGIS 3.8: I tried to do this vectorize with ...
1
vote
0answers
22 views

GDAL couldn't create raster with equal shape

I am trying to carry out pixel by pixel correlation for each image in a time series vs another 1d array of data. To do that, the arrays coming out of the raster files must be identical in shape. ...
2
votes
0answers
40 views

How to install GDAL version 3.0 on Windows in order to generate GeoPDF with Qgis 3.10? [duplicate]

I am very enthusiastic to create some GeoPDFs using the new version of Qgis 3.10 on Windows. Unfortunately, using the OSGeo Installer, the newest gdal package version proposed is 2.4.1, which is ...
0
votes
0answers
19 views

Failed Conversion to COG, Missing codec

I am trying it implement OptimizeRasters to convert GeoTIFs to COGs (Cloud Optimised GeoTIFs) as part of a larger workflow, but I am unable to open the resulting COGs due to a Missing Codec, via the ...
9
votes
3answers
1k views

Create Geospatial PDF (GeoPDF) is greyed out in PDF export options in QGIS 3.10

I installed QGIS 3.10 standalone version today and I know it has a new feature introduced in this version to export GeoPDF. But for some reason, it is greyed out.
1
vote
1answer
26 views

Clipping with gdal translate does not create a file (Python)

I have tried to clip a geotiff file using the code below: from osgeo import gdal miny=-10.616665787 maxy=38.558338147 minx=34.562256098 maxx=71.187259028 ds = gdal.Open(fp) ds = gdal.Translate(...
1
vote
0answers
20 views

Improve OGR SQL query for polygon intersection using WKT geometry

I want calculate the intersected area between a shapefile and WKT geometry. My target big layer: a.shp My query small layer: 'POLYGON((1150046 1264030, 1160100 1263793, 1160079 1260606, 1150218 ...
2
votes
0answers
28 views

How to use GDAL from Nuget in C#?

I have created a C# WPF (.NET Framework 4.6.1) application in Visual Studio 2017 and installed latest stable GDAL 2.4.2 from Nuget. In the App.xaml I have added the GDAL configuration call: ...