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
1answer
35 views

Clipping raster layer supplied from web (e.g. OSM)

When I try (in QGIS 3.8 "Zanzibar") to clip a "web layer", i.e. a raster layer provided from the web (e.g. an OSM map loaded via the QuickMapServices plugin) by the usual method Raster > Extraction > ...
0
votes
2answers
59 views

Converting GeoTIFF to np array?

I am fairly new to GIS in general. I am having some issues converting a GeoTIFF into an numpy array. There are multiple questions online about how to do it, I've tried, many, with the same result ...
0
votes
0answers
9 views

Getting elevation data of a location using ALOS data

I'm working on a program to determine the line of site that a particular point will have using the ALOS data set from JAXA. So far I've managed to download a data set, and am a confused on where to go ...
1
vote
0answers
28 views

Warping a GeoTIFF File (Error1: Cannot open CSV)

Here is my code for the script : import os import subprocess as sub # get your files path = r'C:\Users\User\Downloads\jalna\pdf\test' files = [os.path.join(path, f) for f in os.listdir(path) if f....
1
vote
3answers
38 views

GDAL 2.x method for determing if an object is a raster or a vector

What is the correct method to determine if the resulting object is a raster and/or a vector from the result of a gdal.OpenEx call? The "old" way (GDAL/OGR Determine if dataset is raster or vector) ...
1
vote
1answer
31 views

GDAL rasterise vector to raster error

I am trying to convert a SHP vector file of X,Y,Z bathymetry. I am trying to use the GDAL Rasterise (vector to raster) tool. When I run it I get the following error in the log. I have tried looking ...
1
vote
1answer
37 views

Exporting a GeoTIFF in Float16 format

I'm trying to merge large raster files (DEM's) together but I run into memory errors using the 'Raster Merge' tool in QGIS 3.8. I suspect the issue is mainly the high amount of precision in the ...
0
votes
0answers
28 views

Tilestache server not serving MBTiles converted using gdal2mbtiles and gdal_translate

I'm getting this error: Exception: Requested format "PNG" does not match tileset format "png" I am using RedHat Linux 7.5 (RHEL7.5). I have setup GDAL 2.4.0 with following options while configuring:...
2
votes
1answer
59 views

Rasterio - save multiband raster to TIFF file

I was trying to get Rasterio to save a 3 band raster to a TIFF file. For some reason, the example in the documentation only shows how to save raster with only 1 band. Now when I tried to save a 3 band ...
2
votes
0answers
18 views

TIFF to KMZ passing altitude data

I am currently trying to create a KMZ from a GeoTIFF by using gdal_translate. This Works fine and I am accomplishing this by using by using this command gdal_translate.exe -of KMLSUPEROVERLAY c:\in....
1
vote
1answer
41 views

Rasterio resampling image to lower resolution error: 'float' object cannot be interpreted as an integer

I am trying to downsample a raster image to a lower resolution using rasterio. I am running into an error about 'float' object cannot be interpreted as an integer and I can't seem to figure out the ...
1
vote
1answer
27 views

Creating Raster from Array using GDAL Results in Stripes

I am using a template raster to create another raster with the same resolution/projection/extent from an array. The original raster looks good, but the new raster results in stripes. ds = gdal.Open(...
1
vote
1answer
27 views

Calculating skewness and kurtosis with command line GDAL?

I have calculated histogram bins with the -hist option in gdalinfo. Is there an option to calculate skewness and kurtosis, using this or any other GDAL tool?
0
votes
0answers
19 views

Transform UTM 33 N to ETRS 89 ( epoch 2018.5)

I'm asked to convert coordinates from the WGS 84 UTM 33N system to the ETRS89 with epoch 2018.5. So from a projected to a geographic system. I have no idea how to start with this. I know UTM = ETRS ...
1
vote
0answers
36 views

Writing to file geodatabase in R on Windows?

The title above basically states the question. I have looked around but haven't quite found anything yet. I see this driver: https://gdal.org/drivers/vector/filegdb.html I haven't seen any R ...
1
vote
0answers
8 views

Band rerendering netcdf file by variable not time. Using gdal, nco, cdo

I want to average netcdf data (band1: precipitation) in bins (i.e. 0.01,0.10,0.25,0.5,0.75,1.0, etc.). What nco, gdal, or nco tools can I use to regrid the netcdf file this way?
3
votes
0answers
40 views

What does “OFT” stand for?

What does "OFT" stand for? I'm getting the message "Invalid OFT field name given" in a Python program that uses GDAL, and before I debug it, I'd like to know what it means.
1
vote
1answer
42 views

File size inflation using GDAL

New to GDAL, have some tiff files and I'm trying to do the following: "0 to NoData" to avoid black background in Mapbox: gdalwarp -dstnodata 0 -dstalpha [input file] [output file] The problem is, ...
0
votes
1answer
29 views

GetRasterBand()Method for GDAL in Python

I'm working on getting the NDVI value of Landsat imagery 2018 using band 4 and 5 but I have encountered a slight problem. import osgeo from osgeo import gdal#gdal, data conversion tool from ...
0
votes
1answer
101 views

GDAL 2.4.2 from UbuntuGIS unstable broken because of missing libogdi.so.3.2? [closed]

After an unthoughtful apt-get update today, GDAL no longer works on my Ubuntu Machine (bionic) because libogdi.so.3.2 is missing: daniel@gin-nuest:~$ gdalinfo gdalinfo: error while loading shared ...
0
votes
0answers
36 views

PostGIS Out-DB Rasters - Segmentation Fault

I am loading data from a NETCDF file with raster2pgsql, which I would like to keep as an out-DB raster. The command I use is (note the -R option): raster2pgsql -s 96482 -I -d -F -R NETCDF:"/home/...
2
votes
0answers
14 views

Horizontal color lines artifacts / bug with GDAL Tiff

I would like to document a bug I encountered, and scratched my head against several hours: I wrote a python script for extracting (cropping) many images from a big TIF image. I used both gdal....
-2
votes
1answer
30 views

What do some of the parameters in gdalinfo represent? [closed]

For example, on the gdalinfo documentation, we have gdalinfo ~/openev/utm.tif Driver: GTiff/GeoTIFF Size is 512, 512 Coordinate System is: PROJCS["NAD27 / UTM zone 11N", GEOGCS["NAD27", ...
0
votes
0answers
34 views

Joining file pair for batch gdal_merge.py

I am new to Python and I have been going through past questions and searching trying to determine best way to batch mosaic files. I have a list of .tifs that have been converted from .hdf files I am ...
0
votes
0answers
15 views

gdal_retile.py killed when dealing with large .vrt + pixel function

I have to retile about 100,000 images of size about 2667x2667 pixels for geoserver. The source images' nodata area were badly damaged due to compression so I decided to use VRT pixel function max to ...
0
votes
1answer
32 views

Opening .Jp2 image in QGIS on Mac?

I am trying to open a Jp2 file in QGIS 3.4.5 on a macOS 10.14.5 Mojave. I am new to QGIS and have been looking through forums that discuss GRASS and GDAL but I don't understand the connection to QGIS....
0
votes
0answers
11 views

Initialize spatial_ref_sys table in MySQL 5.7

Using MySQL 5.7 for a spatial application and kind of baffled as to why there doesn't seem to be any nice way to prepopulate spatial_ref_sys. Isn't there any premade SQL script out there to fill the ...
0
votes
2answers
40 views

Invalid geometry after gdal.polygonize

After converting a raster file to a vector file using gdal.polygonize, I cannot carry out further commands (e.g. Clip) because the vector is produced with invalid geometries (as determined by the QGIS ...
0
votes
0answers
26 views

gdal_rasterized failed in terminal

I have this command: gdal_rasterize -l training -a "MC_ID" -ts 3473 4075 -te 42.4132272 -85.3704013 42.41419 -85.3692901 -ot Float32 -of GTiff "training.shp" "training_rasterized2.tif" What I am ...
1
vote
1answer
47 views

Cannot access LibKML driver using OGR in Python

I am trying to read a kmz file using OGR in Python. I believe the standard driver for reading .kmz files is LibKML (Can ogr2ogr read .kmz files? How?), but I am only getting None when I am building ...
0
votes
0answers
66 views

Clipping raster by feature using GDAL in QGIS?

I have successfully selected the feature from a shapefile (boundary) and intend to use this as a mask to clip the raster map underneath. However, having followed instructions when I open the GDAL > ...
0
votes
1answer
22 views

GDAL NULL Path Value On Production Server

I am using c# and visual studio. I have an app using GDAL that works perfectly on the Dev Server. When I transfer it to Production the app fails. I receive the following error message: An error ...
1
vote
1answer
21 views

ogr2ogr MSSQLSpatial truncating attribute fields

I have a Shapefile with a number of attribute fields defined in its corresponding .dbf file. I am trying to transfer this data to an Azure SQL Server DB using the following command: ogr2ogr -f ...
0
votes
0answers
24 views

Unsupervised classification using Python? [duplicate]

Is there a way to use unsupervised classification with satellite images to determine similar regions using python with gdal or with any library?
1
vote
0answers
54 views

Gdalwarp orthorectification WorldView-3 not using RPC projection properly

I have a high-resolution WorldView-3 image that I am trying to orthorectify using gdalwarp -rpc -to "RPC_DEM=dem.tif" input.tif output.tif However the output is not aligned with Bing or Google maps ...
2
votes
0answers
31 views

GDAL Warp Memory Datasource as Cutline

I am attempting to use a memory vector to crop a raster using GDAL warp but I get the following error: ERROR 1: Cannot open <osgeo.ogr.DataSource; proxy of <Swig Object of type '...
1
vote
1answer
40 views

Offset in GeoTIFF coordinates Google Earth Engine extracts

I download a certain geographic location (lon,lat) with buffer radius around for MODIS products, such as MCD43A2/MCD43A4 from Google Earth Engine using ee, such as: lon = 10.452175 lat = 51.079206 ...
1
vote
0answers
22 views

Correct syntax for specifying multiple Layer Creation Options in ogr2ogr

I am trying to run a GDAL 300 command line command to convert a file to GeoJSONSeq, projecting output using ESRI:102008 (Albers North America), using a SQL query to choose and rename some columns, and ...
0
votes
0answers
25 views

Possible to import current version (v2) of the SQL Server Spatial binary format with QGIS/GDAL?

I'm running QGIS 3.4.3 on a Windows 10 machine and when loading vector layers from our MS SQL Server version 12 everything seems to be working great. No problems connecting or visualizing the data. ...
0
votes
0answers
30 views

Creating virtual tiles of raster in Python?

I have a large raster and want to analyze it on smaller subsets but also want to save space so I am trying to avoid actually tiling the raster. Is there a way to make virtual tiles that python can ...
2
votes
1answer
50 views

How to change the field value of a specific feature in a Shapefile using GDAL/OGR?

I am trying to change the field value of a shapefile, but only in some specific features. However the code I have changes the value for all features in the shapefile. Is there any way of accessing the ...
3
votes
0answers
61 views

“Clip Raster by Mask Layer” produces zero values (and not Nodata) outside mask boundaries

This is my first question here. I have a big raster of the world's nighttime lights and want to clip it down to the Adm0 of a country: In order to do so, in QGIS 2.18 what I do is using the Clipper ...
1
vote
0answers
62 views

Unable to import GDAL in Python 3.7 [closed]

I have installed GDAL using conda and it installed successfully. But when I try import gdal in jupyter notebook, it is showing this error. -----------------------------------------------------------...
2
votes
1answer
58 views

How to make 'gdalUtils' package in R to use GDAL installed in OSGeo's directory instead of QGIS's directory

I have GDAL installed through QGIS and OSGeo in the directories: C:\Program Files\QGIS 3.6\bin\gdalinfo.exe C:\OSGeo4W64\bin\gdalinfo.exe My gdalUtils package uses GDAL installed in QGIS and I want ...
1
vote
0answers
26 views

Get maximum value from two raster using gdal_calc.py with option Ignore NoData calculation enabled

I would like to get maximum value from two raster using gdal_calc.py with option Ignore NoData calculation enabled. My question is similar to this unsolved problem: How do I get the maximum value of ...
2
votes
2answers
73 views

Calculate coverage percentage of an area covered by shapefiles using GDAL? [closed]

I have thousands of shapefiles covering around the world. I need to calculate coverage percentage. For example, a pixel located in Hawaii was covered by 100 of all shapefiles, then this pixel value of ...
1
vote
1answer
53 views

ogr2ogr write multiple layers to one geopackage

I'm using ogr2ogr to write a SQL query from PostGIS to a GeoPackage in a linux shell. Query by Query to many GPKG: ogr2ogr -f "GPKG" point.gpkg PG:"host=localhost dbname=data user=user password=******...
1
vote
2answers
54 views

What is the correct GDAL Calc Syntax?

I need to calculate in gdal_calc the following python script. if (A == 0 and B == 0): wd = 0.0 else: wd = np.arctan2(A,B) I have tried if(A = 0 && B = 0,(0.0), else,(...
0
votes
1answer
26 views

Error using gdalwarp

I have this NetCDF file of the Greenland ice sheet velocities but the coordinate system is NSIDC Sea Ice Polar Stereographic North (y: -655750 to -3355750 and x: -639750 to 855750 meters). I wanted to ...
1
vote
1answer
99 views

Create elevation-service from geotiff using python and gdal

I'd like to create a little server for us, that tells us the elevation of a point in a geotiff file. I already got it working basically using the following: dataset = gdal.Open('test_file.tif', gdal....