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
13 views

DSM - DTM = -ve value

I want to calculate the elevation of a particular feature. I have both DSM and DTM as input data, both with the same cell size and same number of columns and rows (same resolution). For the DSM, min = ...
0
votes
1answer
29 views

GDAL Delete geopackage layer

This seems like it ought to be straightforward: from osgeo import gdal gpkg = gdal.OpenEx('path_to_gpk',gdal.OF_VERBOSE_ERROR,allowed_drivers=['GPKG']) error = gpkg.DeleteLayer(0) After running this ...
0
votes
0answers
7 views

How to read ushort and uint data using gdal C# Band.ReadRaster method?

I am using C# bindings for gdal in order to get elevation data from GeoTIFF files. The API contains a Band.ReadRaster method. This method supports a lot of data types, but for reading unsigned ...
0
votes
0answers
12 views

Using gdal_translate with a high number of gcp

I've a CSV file witch describes the coordinates of each pixels in a image, it is structured like this: xcoord,ycoord,row,col 716657.6518375501,4784215.095395751,0,0 716657.6915582813,4784215....
0
votes
0answers
17 views

Using GDAL in Python 3.7

Recently installed the GDAL software on my Windows 10 computer for the first time. Process indicated the install was successful. When I did the command gdalinfo --version I get gdal 3.0.0 with the ...
0
votes
0answers
14 views

After r.sun processing pixels in [0,:] row and [:,0] column of output contain NaN/nodata values

I am using r.sun to calculate the daily insolation values for a region of a GeoTIFF. I noticed that the resulting output has a 1-pixel wide artefact along the [0,:] row and the [:,0] column (assuming ...
0
votes
0answers
14 views

gdal_polygonize on S3 images

I'm trying to use gdal_polygonize on S3 images, I'm doing: obj_url = "/vsis3/" + bucket + "/" + elem aws_ds = gdal.Open(obj_url) p1 = subprocess.Popen(["python3", "path_to_gdal_polygonize.py", aws_ds,...
-1
votes
0answers
34 views

Using gdal_rasterize gives ERROR 1

I'm trying to rasterize a single-band raster, the NDVI from sentinel 2 but I have problems with gdal_rasterize. gdalinfo -proj4 C:\Users\....\....\clip_NDVI.tif gdal_rasterize -a "id" -l myshapefile ...
5
votes
1answer
119 views

Reading GeoPackage with large feature classes is very slow

I'm running a project which provides OpenStreetMap data on a global scale as GeoPackages. The data is created/transferred from a PostGIS database to GeoPackage by ogr2ogr. Issue: Initially reading of ...
0
votes
0answers
17 views

Converting TIFF to IMG using GDAL [duplicate]

I would like to convert a bunch of .tifs to .img using GDAL. Here's what I've got: D:\>gdal_translate -of HFA D:\*.tif D:\*.img Where am I going wrong?
2
votes
2answers
111 views

rasterio “invalid dtype: 'bool'”

I want to write a binary raster to disk. I have the numpy array whose dtype is: dtype('bool') I try to open a GTiff for writing: img_output = rasterio.open( "../../binary_output.tif", ...
0
votes
0answers
17 views

Python GDAL; GRASS QGIS Open 3D NetCDF file with “subdatasets” [closed]

I am trying to open a NetCDF file with GRASS with this code: r.in.gdal -k input=C:\Users\JUL\Desktop\GISNETCDF\Ppt_DRY_subset.nc output=Ppt_DRY title=PPT DRY But I get the following error: ...
1
vote
2answers
46 views

Problem processing Slovenian LiDAR DTM with GDAL (and QGIS): “too many stepY values” error

If I want to apply GDAL (version 2.2.3) on the LiDAR derived DTM (ASCII) from Slovenia (Link to Slovenian DTM below), I run into this error: gdalinfo input.asc ERROR 1: Ungridded dataset: At line ...
0
votes
0answers
19 views

3D Display of sub map on a map with python [closed]

I have a map of heights represented by a numpy array (x,y, z = height), and a sub map of the first map, also represented by an numpy array. Is there a way to display a 3-dimensional representation of ...
3
votes
0answers
33 views

Specify open options in datasource

I am using the GDAL csv driver and I can open a csv and specify geometry columns with ogrinfo using the -oo flags. However, when I want to specify these as part of another command-line tool, for ...
1
vote
0answers
26 views

Point/Area location of data in reference to geotransform of raster

I'm trying to understand how to interpret the position of pixel data within a GDAL raster, specifically as it applies to files containing height data. I'm create Triangular Regular Network (TRN) for ...
1
vote
1answer
28 views

Using command line gdal to open and convert OSM file to feature class

I have an file that is in the format .osm.pbf. It's about 8GB. I want to convert it to a feature class and place it in a file geodatabase. From what I can see, the simplest way to do that is using ...
1
vote
1answer
26 views

Raster Image Tiles created using GDAL2Tiles (from GDAL 2.4.2) does not align properly with Open Street Map Tile layer

I am trying show a custom tile overlay (created from a raster image) on top of openstreetmap base layer using Leaflet. I used one of the raster images from https://www.naturalearthdata.com/downloads/...
0
votes
0answers
53 views

Using GDAL with Anaconda

I want to read sentinel-2's image (jp2 format) with anaconda: geopanda: for read shapefile folium (for create map in jupyter notebook ) (optional) gdal /osgeo : for read jp2 image I follow this ...
0
votes
1answer
32 views

How can I use GDAL in Python to Convert NetCDF to ASCII - and flip the latitudes?

I have a NetCDF file containing bathymetry. I am using the GDAL and NETCDF4 libraries to export the file to ESRI ASCII using the 'AAIGrid' format. However, a common problem is the latitudes are in the ...
0
votes
2answers
77 views

Writing gdal_translate in a script

I want to run the command below over 100 images in a directory. The problem is that scale_1, scale_2 and scale_3 are currently obtained manually in the QGIS GUI under Layer->Layer Properties->Band ...
1
vote
0answers
30 views

Get coordinates of all pixels in a raster [closed]

I have a georeferenced raster and I need to extract a list with the coordinates of pixel in reference system (EPSG:32631) and the coordinate of pixel in raster reference. I want a list like this (...
1
vote
1answer
27 views

gdalwarp to change block size also changes pixel values

I'm working with a GeoTIFF from http://www.fao.org/geonetwork/srv/en/main.home?uuid=ba4526fd-cdbf-4028-a1bd-5a559c4bff38 The original has data values from 0-11: $ gdalinfo -hist ./data/FAO/...
0
votes
0answers
18 views

Seeking documentation for GDAL_ERROR 0

I'm trying to use vsis3 to access a raster remotely. I had a lot of issues having to install curl with http2 support and dealt with a bunch of issues with package versions and what not but I'm still ...
0
votes
0answers
24 views

Different color interpreter for Planet Images

I'm trying to merge a set of Planet Imagery with gdal, but I'm getting Warning 6: gdalbuildvrt does not support heterogeneous band characteristics. Skipping ./out2.tif. After checking gdalinfo I ...
0
votes
0answers
24 views

Error “Too many points failed to transform, unable to compute output bounds.” using gdal2tiles

I want to generate tiles from a GeoTIFF file using gdal2tiles. gdal2tiles.py input.tif when I try the above command I got the following error Too many points (10201 out of 10201) failed to ...
1
vote
0answers
17 views

Retrieving individual pixel height data given color table/relief data and color shaded relief map using C# and GDAL?

I am using C# GDAL/OGR/OSR bindings. I have a GeoTIFF file where each pixel is stored as a color in a Red, Green, and Blue raster band. I have a color table/color relief file (.csv) which I am able to ...
0
votes
1answer
47 views

Remove Angle or Projection in GDAL

I am completely new to GeoData so this might be somewhat of a silly problem, but I am having a problem with the angle GeoTIFF images tend to come with. I am collecting satellite images for a deep ...
0
votes
1answer
38 views

Loading color table (.csv) file to interpret raster data using C#?

I have a raster (GeoTIFF .tif file) that is stored in three bands (Red, Green, Blue), with each band's data type as a byte. I have a separate color table in the form of a .csv file, that stores a ...
2
votes
0answers
26 views

Use color map from .tif.aux.xml from ArcGIS in QGIS

I have a raster file (.tif) of different ecosystem types (from natureserve). Each value corresponds to a different type. I'm trying to get a table of those attributes and colors. The file includes (...
0
votes
0answers
7 views

Warping large virtual mosaic into a small raster results in IntegerOverflow error

I'm coming across an interesting situation using gdalwarp. I have a very large virtual mosaic with varying resolutions of source files. I use this virtual mosaic to create smaller rasters using ...
1
vote
0answers
42 views

raster2pgsql fail with JPEG encoded image

The problem I have one JPEG encoded raster that works in GDAL and QGIS. The original file 05-D Braga.jpg is available online. The CRS is EPSG:20790. To upload it to Postgis, I use: raster2pgsql -s ...
1
vote
0answers
41 views

Python Rasterio not recognized as a supported file format [duplicate]

I'm trying to run this python code with anaconda. I have an error that I can not solve. I try execute this tutorial : https://towardsdatascience.com/satellite-imagery-access-and-analysis-in-python-...
0
votes
0answers
21 views

Clip two shapefiles in Python using only OGR results in error Segmentation fault (core dumped)

Is it possible to clip two polygon shapefiles using only the ogr library? It has to be a native Python solution, so subprocess.call(['ogr2ogr', '-clipsrc', ...] ) is not what I'm looking for. ...
1
vote
0answers
19 views

Interpolating VRT to Geotiff using gdal.Grid in Python creates null image

I have a set of points with X, and Y coordinates and associated Z values POINT (-102.9071045 31.43453407 1871.930298) POINT (-102.8339386 31.45111084 1856.14209) POINT (-102.4687424 31.53144836 1869....
0
votes
0answers
33 views

Degradation of the quality of a raster after publishing to GeoServer [duplicate]

I'm trying to publish a satellite raster (.tif) into GeoServer and display it in a web application using OpenLayers. I tried to use many procedures but without any good results. This is the original ...
0
votes
1answer
20 views

FileGDB write support for GDAL/OGR in macOS

I am using macOS Mojave and Homebrew with latest update. I have tried to install gdal 3.0.1 and filegdb plugins via homebrew-osgeo4mac tap as below: brew tap osgeo/osgeo4mac brew install osgeo-gdal ...
3
votes
1answer
22 views

How can I build GDAL without the static libraries?

Background I'm building GDAL myself, because I need it linked against libkml, with: wget -O gdal.tar.gz "https://github.com/OSGeo/gdal/archive/${GDAL_VERSION}.tar.gz" tar --extract --file gdal.tar....
2
votes
0answers
47 views

Errors opening Geospatial PDF in QGIS 3.8.3

I'm a complete QGIS newbie so bear with me if I'm missing something obvious... I'm unable to open GeoPDF's that I've downloaded from USGS's The National Map (TNM) site. This is the error that I get ...
0
votes
0answers
18 views

On converting raster image to tiles using GDAL the initial image is blurred

On converting a raster image to tiles using GDAL the initial image is blurred. I have followed this tutorial. My image is getting converted into tiles but the raster initial image is blurred (see ...
1
vote
0answers
34 views

How to fix rasterio error: The EPSG code is unknown. Unable to open EPSG support file gcs.csv

I try to open a jp2 image with the Python's Rasterio package. The code is below. The problem is that the coordinate reference system is not recognised and when I want to see the meta attribute of the ...
0
votes
1answer
41 views

GDAL/OGR losing OSM closed way features that OGR2OGR imports

I have managed to import an OSM PBF file into QGIS using ogr2ogr -> SQLite and then importing layers using the GUI- (essentially as per the first step in this answer : ogr2ogr -f "SQLite" -dsco ...
1
vote
1answer
46 views

gdalwarp resampling method

I'm trying to mosaic some georeferenced images using gdalwarp. But if I change the resampling method the result is always the same, why? I need to build a mosaic where the value of each pixel is the ...
1
vote
0answers
37 views

Getting inconsistent raster output from gdal_calc.py raster calculation

I'm attempting to do what is generally a straightforward raster calculation when I do this in QGIS, but am trying to do this with gdal_calc.py in terminal. The output is close, but produces banding ...
0
votes
0answers
25 views

Converting from netCDF to GeoTiff using gdal_translate

gdal_translate netcdf_file.nc output.tif I'm trying to generate a GeoTiff using this command, and it works... kind of. The output tif image is just black and white, and I'd like actual colors on the ...
1
vote
0answers
38 views

Mathematical rule to convert between degrees and centimeters based upon projection

I have some Tanzania drone imagery data in a local geographic projection EPSG:32737 that uses the unit of meters. Then I have other vector data that is in EPSG:4326 which is denominated in degrees. In ...
1
vote
1answer
45 views

Converting Longitude range from (0,360) to (-180,180) in Python or by using gdal commands

I have a raster downloaded. Visualising it in QGIS. I want to correctly project it so that its extent varies with longitudes from -180 to 180 instead of 0 to 360. gdalinfo filename.nc outputs the ...
2
votes
0answers
19 views

How to set the extent with gdal_rasterize, the “-te” does not work

I use gdal_rasterize to clip mask by shpaefile. however, the parameter "-te" does not work. get subprocess to call GDAL util import subprocess # define paths to raster and vector inraster = r'I:\...
1
vote
0answers
27 views

How can I easily determine the precision of an OGR geometry?

I'm writing a python tool to update some river catchment boundaries and keep running into geometry errors, such as WARNING: TopologyException: Input geom 1 is invalid: Self-intersection at or near ...
1
vote
2answers
37 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 ...