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
0
votes
0answers
19 views

Generated GeoTiff in GDAL not opening in ImageMagick

I have netCDF data I convert to geoTiff using the following code: import numpy as np from osgeo import gdal from osgeo import osr from netCDF4 import Dataset import glob def open_netCDF(filename, ...
0
votes
0answers
19 views

Reprojecting a local CRS

We have point data (x,y in m from a local 0,0) from an archaeological campaign, that we would like to display embedded into real-world cartography. We know either the real world coordinates of 0,0 (e....
1
vote
0answers
9 views

Creating overview images for individual rasters becomes more flexible when the layer is partially updated. How do I do this?

I use a GeoServer. I want to create a layer from a mosaic that I got using gdal from a vrt file that is created from pieces of a map whose size is 9 000 000 * 3 000 000 pixels. To create a VRT file, ...
0
votes
2answers
36 views

Combining two rasters based on a Condition using Open Source Python

I'm new to Python. My only experience is with Arcpy. I need to combine two rasters with the same extent into one output raster based on a condition. Using Arcpy, I would do something like this: ...
2
votes
0answers
19 views

Transforming lat/lon coordinates into an undescribed DATUM from NOAA .grib2 files

I seem to be having issues with converting coordinates. I'm currently working in Python v3.7 osgeo (ogr, osr, gdal) I want to find specific values (like temperature, wind, humidity) based on input ...
0
votes
0answers
18 views

Align multiple rasters of different extents in python? [closed]

I know that multiple rasters can be aligned in tools like QGIS, but I would like to do that in python. It should be done without clipping the extent or masking, whole multiple rasters should be ...
0
votes
1answer
24 views

Creating a shapefile from a numpy array

I was following this tutorial: http://www.acgeospatial.co.uk/k-means-sentinel-2-python/ on how to generate an unsupervised classification for sentinel-2 images. img_ds = gdal.Open('data/products/...
0
votes
1answer
17 views

GDAL 2.4.2 installation problem in Debian

I have built GDAL 2.4.2 in Debian package through the following commands sudo apt-get install build-essential python-all-dev wget https://download.osgeo.org/gdal/2.4.2/gdal-2.4.2.tar.gz tar xvfz gdal-...
1
vote
1answer
22 views

Converted GeoJSON have 3 elements in each coordinate entry [closed]

I'm working on something that converts DXF file to GeoJSON. I'm using ogr2ogr to do the conversion. I noticed that after the conversion there are sometimes 3 coordinates in elements of the coordinate ...
0
votes
0answers
16 views

Create vector mbtiles file from Shapely geometry using GDAL/OGR

I am looking for an example of creating vector mbtiles file from Shapely geometry using GDAL/OGR. Like this: from osgeo import ogr from shapely.geometry import Polygon poly = Polygon([(0, 0), (0, 1),...
1
vote
0answers
9 views

Does gdalwarp resample when calculating geoid correction?

I wanted to perform a geoid offset correction to a DEM and saw this really useful post: Vertical Datum conversion of a raster with gdal I noticed that although they use gdalwarp, they do not specify ...
0
votes
0answers
9 views

Convert and set projection from h5 file

I want to save georeferences readed from input data to output data. I don't want use copy georeferences because input data is in .h5 format and georeferences was read from metadata. I use GDAL and C ...
0
votes
1answer
18 views

PHOTOMETRIC tag not producing expected result

Code takes a netCDF4 file and converts the data to GeoTiff: import numpy as np, sys from osgeo import gdal from osgeo import osr import netCDF4 f=netCDF4.Dataset("mydata.nc") time = f.variables["...
0
votes
0answers
19 views

Crop `vrt` by vector-geometry with gdal

Is it possible to crop a .vrtmosaic to a vector-geometry? I have a .vrt-file which is a mosaic of various sentinel2-scenes. For me it seems to be more efficient to already crop and mask (set ...
1
vote
1answer
22 views

GDAL polygonize processing

I am a bit of a GIS beginner here. I've got an image mask in .jpg format that I'm trying to convert to a shapefile .shp format. To do so, I use the GDAL polygonize function. This is what the input ...
0
votes
0answers
29 views

Installing GDAL for Python 3.8 IDLE

I'm using IDLE. GDAL command works in QGIS' Python console but not Python 2.7 (ArcMap) and 3.8 (separate install) IDLEs. So far, I have tried Downloading this (GDAL/OGR IN PYTHON) and following the ...
3
votes
1answer
72 views

How to resample a raster layer to match a specific raster layer's cell size?

I would like to resample the cell size of a GeoTIFF raster layer with dimensions equal to the reference file (a Sentinel-2 B12 band with 20 m resolution to 10 m resolution). I use the following code ...
0
votes
1answer
25 views

Reading Sentinel2 ROI using GDAL and vsizip without downloading the whole image

I would like to read Sentinel2 data from remote using GDAL and /vsizip so to access just a portion (let's say a square of about few hundreds meters) of each image, from which extract and display just ...
1
vote
0answers
25 views

GDAL C# - ReWrite of PY function in C# to CHIP dataset

I am working on a small project that utilises GDAL and its C# bindings. TASK To chip a dataset given the top left and bottom right LAT/LNG coordinates. PROBLEM My resulting CHIP is offset by 40km ...
0
votes
0answers
12 views

GDAL 0ERROR 1: Bitmap decoded size (16200272x0) doesn't match raster size (2405x1386)

I was migrating Gdal OpenSuse to Red Hat 7.4 64bit. I did a procedure for installing the packages and compiling, below are the steps: yum groupinstall "Development Tools" yum install fontconfig....
2
votes
1answer
27 views

Trying to install gdal 3.0.4 on Red Hat 8

I'm running Red Hat 8, and I'm trying to install gdal 3.0.4 on it. The commands I've excuted thus far: wget http://download.osgeo.org/gdal/3.0.4/gdal-3.0.4.tar.gz tar zxvf gdal-3.0.4.tar.gz cd gdal-...
2
votes
2answers
39 views

Unable to connect WFS datasource with ogr, but works with QGIS

I am accessing some WFS layers via QGIS. I want to download those same layers via ogr. This doesn't work and I can't find why. The WFS URL is https://www.mercator.vlaanderen.be/...
2
votes
1answer
19 views

Write output of multiple files to a directory after processing using gdal.Translate and glob.glob?

I want to convert the data type (Int32 to Float32) of all the tiff images in a directory 'F:\\prep\\input\\' and save/write the outputs to a new directory 'F:\\prep\\converted\\'. I have tried using ...
1
vote
1answer
41 views

Access Google Cloud Data using VSIGS

I want to access landsat data from gcp-public-data-landsat bucket using vsigs . My code looks like , import os, sys from osgeo import gdal print(gdal.VersionInfo('–version')) print(sys.version) ...
2
votes
2answers
55 views

gdal CoordinateTransformation.TransformPoint result is not same gdal.Warp

I produce NDVI data from Landsat8 (UTM). End of the calculation, I want to export result EPSG:4326 so I used code that is below. I realized my new coordinates and qgis gdal warp result are different. ...
2
votes
1answer
66 views
+50

Hillshade function calculation: ValueError: Received a NULL pointer

I'm trying to get a raster from a DSM running the following code from python libraries osgeo-gdal in python qgis console: import pandas as pd from osgeo import gdal df = pd.read_csv(azimut_altitude....
1
vote
2answers
30 views

GDAL SetGeoTransform() issue

SetGeoReference it is not working with this code. (I think that I should need some more explanation on how this works...) """ Retrieve Georef & Projection from a reference image """ ...
2
votes
1answer
24 views

gdal_translate problem translating 16bit PNGs

I am trying to use the SRTM earth images to convert them into heightmaps for 3D application. I can output a 8-bit PNG like this: gdal_translate -ot Byte -scale -of PNG srtm_44_05.tif heightmap.png ...
1
vote
1answer
58 views

Zoom level issue with openlayers 5 and custom tile generation using gdal2tiles

Now i have changed my code but the output is still not what is expected, because the resolution provided is of 0 - 8 zoom but my minZoom starts from 12 itself, will i get my tiles rendered ?? how ...
1
vote
1answer
47 views

'gdal_merge' is not recognized as an internal or external command, operable program or batch file in OSGeo4w Shell

I am trying to batch mosaic a set of rasters using gdal in OSGeo4w shell command line. When I try to use gdal_merge I am getting error as below. run o-help for a list of available commands ...
0
votes
0answers
12 views

Clip raster with PostGIS polygon layer using Python

I have two layers in the same SRID: single-band georeferenced raster in a TIF file single multipolygon in PostGIS I need to convert the pixels of the raster within the polygon into points (at the ...
2
votes
1answer
35 views

Using GDAL Virtual I/O (/vsicurl) when Adding a Geoserver Store

I was under the impression that configuring Geoserver with the GDAL plugin would allow me to utilize GDAL's virtual I/O prefix for accessing data stores in a zip file, s3, etc. using /vsicurl/ or /...
0
votes
0answers
32 views

QGIS GDAL Build VRT results do not reflect input raster values

I am having trouble successfully creating a VRT. My Build VRT gdal command results in values of ±1.79769e+308. The values should be 1,2,3, or 4. I've verified projection info is the same across the ...
0
votes
2answers
35 views

What libraries/tools are recommended when creating API performing basic GIS functions? [closed]

I'm software engineering student and as intern I received task to create spatial data analysis and transformation web service. The api should be able to perform these data analysis functions: merge, ...
0
votes
1answer
29 views

How can I modify a VRTRasterBand sub-class,etc from Python?

I am using GDAL to merge a series of overlapping rasters using Pixel Functions to combine the color bands. As a proof-of-concept, my approach has been to create a VRT, and then to modify it in a text ...
0
votes
0answers
11 views

GetGeoTransform provides wrong values with esri ascii raster file

The gdal documentation says when using the GetGeoTransform() function "The (GT(0),GT(3)) position is the top left corner of the top left pixel of the raster.", but if I read an esri ascii raster file ...
0
votes
0answers
14 views

Convert 1-band .nc file to GeoTiff with RGB

How can I convert 1-band .nc file to GeoTiff with RGB? I have tried using gdal translate but it won't let me apply color interp of RGB to the .nc as it has 1 band.
1
vote
1answer
28 views

Transform equirectangular simple TIFF to Mercator projection with gdal_translate / gdalwarp

I'm trying to transform this shaded map of Venus, a 2000x1000 TIFF in what I believe is equirectangular projection, without GIS metadata, to Mercator. I first tried gdalwarp -s_srs EPSG:4326 -t_srs ...
0
votes
1answer
35 views

Warning1: TIFFReadDirectory:Sum of Photometric type-related color channels

I am reading and writing rasters using gdal and keep running into the error: Warning 1: TIFFReadDirectory:Sum of Photometric type-related color channels and ExtraSamples doesn't match ...
0
votes
1answer
18 views

gdalwmscache folder on Windows

Could somebody explain what the gdalwmscache folder does? Is it save to delete the gdalwmscache folder on Windows? Is my file still able to be opened? I can't test this so it would be nice of someone ...
1
vote
0answers
30 views

Gdal format command not found

I am trying to clip a raster image based on a vector mask layer and I am encountering this error: Gdal format command not found. I am on a Macintosh and my QGIS version is 3.4.
1
vote
1answer
28 views

BuildOverviews() not supported for VRT dataset

I am trying to build overviews in a VRT dataset with python GDAL. I try this code: out_vrt = os.path.join(out_dir, 'mosaic.vrt') ds = gdal.BuildVRT(out_vrt, [raster1.tif, raster2.tif]) factors = [...
3
votes
1answer
50 views

Why is there an extra pixel in some world images, 43201 vs 43200?

I have two images both of which have world nighttime lights. They are off by 1 pixel and the equivalent decimal degrees, but the 43201 image seems to be "too large." Using gdal: Driver: GTiff/GeoTIFF ...
4
votes
1answer
62 views

Converting geographic coordinates into tangent-plane Cartesian with GDAL

I'm working on reading a variety of geographic raster data (primarily elevation data, land clutter type, and land clutter height) to project them into a local-tangent-plane Cartesian system (east-...
1
vote
1answer
43 views

How can I get the points where two line shapefiles intersect?

I have two shapefiles that I want to compare and get the points where they cross. I would like to avoid opening QGIS or GRASS since I am trying to automate a process so I have been looking at OGR, ...
0
votes
1answer
27 views

Resample raster from one resolution to another with GDAL Python API

i have some trouble warping one raster to different resolution. My input is a one channel tiff with. I know the geo-coordinates of x_min and y_max. I also know that the pixel resolution is 5 meters. I ...
1
vote
0answers
14 views

Get elevation of GeoTIFF using GDAL bindings in Java

I'd like to read an elevation value from a GeoTIFF that I have. It's already working, but I'd like to interpolate the values for better results. I currently do so like this: Dataset dataset = gdal....
1
vote
2answers
21 views

gdalbuildvrt.exe doesn't recognize existing path

I used this function before but it suddenly stopped working on some updates. The simple command throws an error. PS C:\> c:\ProgramData\Anaconda3\Library\bin\gdalbuildvrt.exe 'c:/tmp/index.vrt' 'c:...
0
votes
1answer
53 views

Install gdal2tiles inside conda environment

I need to use gdal2tiles with Anaconda 3 on Ubuntu 18.04. I've created the environment using: conda create --name gisenv python=3.6 I've installed GDAL with: conda install gdal After this I've ...
1
vote
1answer
19 views

GDAL Convert Format with PROJ string

I would like to perform the following transformation in the GDAL Convert Format tool in QGIS: projinfo -s ETRF2000 -t ITRF2008 -o PROJ Candidate operations found: 1 --------------------------...

1 2 3 4 5 87