Questions tagged [gdal]

GDAL (Geospatial Data Abstraction Library) is an open source translator library for raster and vector geospatial data formats.

Filter by
Sorted by
Tagged with
0
votes
0answers
6 views

GDAL georeference multiple NG images as GEOTIFF with different size and extends

Following my problem described here: Georeferencing PNG image by GDAL in QGIS I would like to make some batch image georeference in GDAL. Unfortunately I couldn't find the reasonable solution for it. ...
0
votes
1answer
16 views

Python GDAL: Clip rasterfile with multi-polygon shapefile

I am trying to clip a raster file with a multi-polygon shapefile to get separate clipped-raster file for each polygon with its 'id' as part of the name of clipped-raster file. I tried the following ...
0
votes
1answer
15 views

Using VRT to mimick N bands Geotiff from a k-bands Geotiff, N >> k?

I recently discovered VRT format and I wonder if it could be suited to my problem. I have a program A that expects as an input a N-bands Geotiff (N >> 1000). I have presently k = 200 rasters ...
0
votes
0answers
29 views

Georeferencing PNG image by GDAL in QGIS

I am not familiar with GDAL so far. Thereby I don't know how to start. By knowing the problem from the question below: Georeferencing PNG image in QGIS when the coordinates of image corners are known ...
0
votes
0answers
20 views

Cut out polygons from a large raster

I'm trying to cut out polygons from a large raster using gdalwrap by mask .kml. When I don't set the resolution of the output file everything works great. gdalwarp -dstnodata -9999 -q -cutline ...
0
votes
1answer
36 views

GDAL resample 30m file to 90m

I have an SRTM file in DTED format obtained from EarthExplorer spanning 1 degree latitude by 1 degree longitude and containing 3601x3601 pixels at 30m spacing. The pixel size resolution is 0....
0
votes
1answer
22 views

OGR2OGR Esri JSON to GeoJSON - Rings returning as null in geometry?

I'm trying to convert an Esri JSON file to a GeoJSON format using ogr2ogr. For some reason, in the objects returned, the geometry field is constantly null. Here's the script I'm running: ogr2ogr -f ...
0
votes
0answers
15 views

How to avoid producing a blocky image using gdals rgb2pct?

I want to create clean single band 8 bit images from RGB using gdal rgb2pct. Due to the dithering algorithm in rgb2pct the resulting image shows very blocky areas producing many different coloured ...
0
votes
0answers
17 views

Looping through all layers in Esri feature server

Because multiple layers aren't handled by the ESRIJSON driver. I have to query layer per layer. source I need to loop through all my feature layers, To generate a GeoPackage file containing all ...
2
votes
1answer
44 views

Unable to write raster from array using rasterio

I have two raster files, raster1 and raster2. I want to take raster1 and divide it by raster2 and produce an output raster for this calculation. I am using python and the rasterio package. For info on ...
0
votes
0answers
9 views

GDAL - Heroku OSError: /opt/homebrew/opt/gdal/lib/libgdal.dylib: cannot open shared object file: No such file or directory

I am trying to deploy a webapp that utilises GDAL libraries. I have followed the heroku documentation pertaining to GDAL and Heroku here and here. My buildpacks are: === vygrapp Buildpack URLs 1. ...
0
votes
0answers
34 views

Unable to divide rasters through gdal_calc.py because of unicode error

I am trying to use python in Jupyter Notebook to divide raster file A by raster file B. I am trying to use the gdal_calc.py program in a Jupyter Notebook cell, and not in the command line, and so I am ...
3
votes
1answer
39 views

What are the GeoPackage metadata conventions supported in GeoServer?

I'm trying to find information on how best to write metadata into a multilayer GeoPackage so that it can be read into a GeoServer instance. My chain of treatment would be to: Modify layers in an ...
0
votes
0answers
37 views

GDAL_RASTERIO_RESAMPLING error when using QGIS GDAL translate

I have a VRT of a multiband raster layer from Sentinel 2. I converted it to a GTiff using GDAL translate in QGIS 3.10 and, though I received the output I wanted, I got hundreds or thousands of these ...
2
votes
0answers
29 views

How to query a file geodatabase using GDAL/OGR C# for records with an invalid geometry

Presently, I have a snippet of code that works well when iterating over a file geodatabase. The problem I'm currently having is that, on occasion, a geometry is supplied that is invalid, such as a ...
2
votes
0answers
27 views

Can't reference an MVT layer from Mapfile

I'm trying to add an MVT layer to my Mapfile, but it doesn't work and I ran out of ideas. Some info about the layer I'm trying to add: https://support.regrid.com/articles/using-the-tileserver/ This is ...
1
vote
1answer
22 views

Changing georeferenced .tif file with GDAL SetGeoTransform?

I am trying to change the pixel width and pixel height in the GeoTransform inside a georeferenced .tif file. I wrote a bit of code to read the file then change the GeoTransform parameters and write ...
0
votes
1answer
31 views

Python Gdal: Count pixels having a specific range of values [closed]

I have few hundred raster files and I want to count the number of pixels having values within a specific range. Following code works well when using == operator e.g., raster_file == 25, but gives ...
0
votes
1answer
13 views

ogr2ogr DXF_FEATURE_LIMIT_PER_BLOCK error

I am trying to convert a DXF to GeoJSON using ogr2ogr However, I am getting the below error: Limit of 10000 features for block ____ reached. If you need more, set the DXF_FEATURE_LIMIT_PER_BLOCK ...
2
votes
1answer
21 views

Tile a large VRT with different resolutions

I have a large raster GeoTIFF of the whole world with a low resolution, and also parts of the world with higher resolutions. Some very high, some medium high resolution. Now I would like to create new ...
0
votes
1answer
25 views

Docker ogr2ogr & ogrinfo .shp shapefile "Unable to open datasource"

I am using current gdal docker image osgeo/gdal:ubuntu-full-3.4.1 to display metadata from a shapefile. After multiple failed attempts of failed installation of GDAL 3.4 on Ubuntu 20.10 I am now using ...
0
votes
0answers
39 views

Summing rasters in python with different shapes [duplicate]

I have a polygons shapefile with many individual overlapping polygons, each containing a unique value in the "Value" column. I want to iterate over each polygon in this shapefile (feature in ...
0
votes
1answer
24 views

Clip Raster with Shapefile GDAL API

I am trying to clip a raster using a polygon an GDAL. The following code is running without an error but the ouputimage is all zeros. All files are in the same CRS. Is there a way to use GdalWarp with ...
0
votes
0answers
32 views

Unable to rasterize polygons within for loop in Python

I have a shapefile with many polygons, with three separate attribute value columns as "colors": Blue, Red, and Green. For each color, I want to rasterize each individual polygon with that ...
1
vote
0answers
34 views

Using -limit tag with ogr2ogr and -where takes too long

I am running some ogr2ogr commands to extract some data from OSM dataset. Since I don't want to extract all features of some condition because I can't see them all and is takes too long I am trying to ...
0
votes
1answer
44 views

Convert x,y pixel positions of JPEG after georeferenced to GeoTIFF file x,y pixel positions

New to GDAL. I have a JPEG file that I have some data in x,y pixel positions.I georeference this image with gdal translate and some gcp(s).How to translate (transform) these x,y pixel positions from ...
0
votes
0answers
33 views

I have a number of polygons attached to each other. How do I smoothly distort them such that they all have about the same area?

I'm trying to make a map for a board game: (Incomplete, but you get the idea) Each of these polygons is of roughly equal importance, and ought to be about the same area on the final board. How can I ...
0
votes
3answers
68 views

Divide and write raster in GDAL using Python?

I have a folder of raster .tif. files. I want to iterate through all the rasters in this folder and divide them by a specific raster. I then want to take these outputs and write them to new rasters. ...
0
votes
0answers
22 views

How to read and plot multiple TIFF files in Colaboratory?

I'm new in python and I would like to know how I can read and plot MULTIPLE TIFF files in Colaboratory with (maybe) a for loop. Here is what I did for a single TIFF image: from google.colab import ...
2
votes
1answer
27 views

Coordinate transformation with NTv2 and cs2cs works in console but not in GDAL

Our Java application uses GDAL (v3.2.0) and I am trying to convert some coordinates from EPSG:31467 (DHDN GK3) to EPSG:25832 (ETRS89 UTM32). For this I downloaded the grid shift file BETA2007.gsb and ...
0
votes
0answers
35 views

Shaded relief / Hill shade - GRASS vs GDAL and QGIS

I tried generating shaded relief / hill shade maps using different algorithms in GRASS and QGIS. It was found that r.relief of GRASS produced more realistic terrain shading compared to GDAL Hillshade ...
0
votes
1answer
33 views

Building DTM using GDAL

I want to build a DTM. I have extract the ground points from DSM raster by slope base methods and saved in to a raster.tif file. Now I'm trying to extract ground points from raster.tif as GDAL dataset ...
-2
votes
0answers
19 views

How to make a pansharpened using gdal? [duplicate]

I am working with Jupyter notebook and I need to create a pansharpened with landsat8 Is there any tool in gdal to make a pansharpened ? Can you show an example?
1
vote
1answer
21 views

Coordinate Operations Error for NAD83(2011) Alaska Zone 1

I am receiving the following error below when running gdalwarp to crop an input orthomosaic in the NAD83(2011)-Alaska Zone 1 CRS. The command still runs and the output cropped TIFF file renders fine ...
0
votes
0answers
36 views

QGIS and GRASS: r.in.gdal "View output" produces "Unavailable layer! Layer data source could not be found"

I'm quite new to QGIS and I'm working with QGIS 3.22.2-Bialowieza and GRASS 7 package, I use macOS Monterey 12. I have a few vectors and rasters I need to transform to GRASS format in order to ...
1
vote
1answer
38 views

How to change the default compression method in QGIS raster creation tools

Tools which create new rasters in QGIS let you set the compression method, using GDAL's -co COMPRESS= method. The "High Compression" is set by default to "DEFLATE" (and PREDICTOR=2)...
4
votes
1answer
73 views

Vector layer with "GEOM_POSSIBLE_NAMES" not working when source as *file*

I have two CSV files having the below content. pnt as WKT.csv: sl,wkt 1, POINT(50.0 50.0) pnt as PNT.csv: sl,pnt 1, POINT(50.0 50.0) The difference in both the file is column name in the ...
3
votes
1answer
62 views

JPEG compress hillshade

I have a hillshade which I want to compress using JPEG compression: gdal_translate -co COMPRESS=JPEG -co TILED=YES /home/bera/Drives/ssd1/Hillshades/testhillshade.tif /home/bera/Drives/ssd1/Hillshades/...
2
votes
2answers
103 views

Rasterize and sum polygons in Python

I have the following shapefile of NYC with all 5 Boroughs as separate polygons, called Boroughs.shp. Data Source (NYC OpenData): https://data.cityofnewyork.us/City-Government/Borough-Boundaries/tqmj-...
1
vote
0answers
32 views

ogrinfo filter invalid geometries

I have shapefile and I want to filter all invalid geometries. ogrinfo -q /workspace/INVALID/0.shp -sql "SELECT * FROM \"0\"" -fid 1749 Layer name: 0 OGRFeature(0):1749 Target (...
0
votes
0answers
34 views

gdal_pansharpen.py raise module errors

I want to use gdal pansharpen python function. I have two tif files, one is the panachromatic raster and on is the 4 bands raster. I'm using gdal version 3.4.0. I have tried to use it, based on this ...
3
votes
2answers
67 views

Is it possible to clip a shapefile from a raster layer using gdalwarp?

I have a shapefile with a single geometry as the following: I also have a GeoTIFF raster that I can put behind this vector layer... I'd like to find a way of programmatically clipping this shapefile ...
1
vote
1answer
57 views

Summing all rasters in folder using Python

I have a folder containing many raster files (.tif). I want to sum all of the rasters in this folder into a single output raster using Python in Jupyter Notebook. I have been able to use GDAL command ...
3
votes
1answer
69 views

Rename layer after gdal:rasterize

I rasterized a layer using gdal:rasterize like this: raster = processing.run( "gdal:rasterize", {...}, is_child_algorithm=True, context=context, feedback=feedback ) But ...
6
votes
1answer
86 views

Single sided buffer QGIS strange behaviour

I'm creating a single sided buffer in QGIS based on line segments. In the project the line segments represent river shore lines. Therefore, they are often of meandering shape. I used the algorithms '...
1
vote
2answers
44 views

GDAL script to merge geotif images by placing each band input into a separate band

In QGIS when I merge two images with 3 and 5 bands respectively via Raster >> Miscellaneous >> Merge with the option checked on place each input into a separate band it resulted in a ...
2
votes
3answers
58 views

Get the geo-coordinates of a point from a pixel

I need to get the geo-coordinates of a point from a pixel GeoTiff. I am using the following code: import gdal from affine import Affine # open the dataset and get the geo transform matrix ds = gdal....
7
votes
3answers
224 views

GeoTIFF creation using gdal_translate fails to produce expected result

I am converting weather radar data (grib2) to raster tiles for Mapbox. The resulting tiles are mis-aligned from the original grib2 data and I am not sure why. I have a 4-step process using GDAL in the ...
0
votes
0answers
18 views

How to enable GDAL ECW plugin in Windows10?

I have the following system info: gdalinfo --version = GDAL 3.3.3, released 2021/10/25 python = Python 3.7.8 (tags/v3.7.8:4b47a5b6ba, Jun 28 2020, 08:53:46) [MSC v.1916 64 bit (AMD64)] on win32 After ...
2
votes
1answer
39 views

GDAL - csv to TIFF, struggling with gdal.Rasterize

I am looking to interpolate some dataset via IDW with gdal. I am first trying to create a tiff out of my data to then be able to interpolate it. My code is returning no error however the file created ...

1
2 3 4 5
108