Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options not deleted user 9628

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

9 votes
1 answer
10k 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 …
krishnab's user avatar
  • 929
1 vote
1 answer
435 views

Is there a command line tool like `gdalinfo` for vector files?

I use gdalinfo all the time to obtain basic information about raster files. I was wondering if there was a similar tool to obtain information from vector files, such as the spatial projection, list of …
krishnab's user avatar
  • 929
1 vote
1 answer
3k views

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

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 ca …
krishnab's user avatar
  • 929
6 votes
1 answer
10k views

Can Gdal.Translate() return an object instead of writing a file?

I have some Python GDAL code I am using to convert a GeoTIFF file to PNG. The code uses the gdal.Translate() function which generates a new file each time I run it. … Here is some sample code I am using: from osgeo import gdal scale = '-scale min_val max_val' options_list = [ '-ot Byte', '-of JPEG', scale ] options_string = " ".join(options_list) gdal.Translate …
krishnab's user avatar
  • 929
0 votes
0 answers
711 views

Why doesn't installing GDAL from `pip` work on Ubuntu 18.04x64

Here are other folks who have had similar issues installing gdal. Python GDAL package missing header file when installing via pip How to (re)install gdal in python3 (mac)? … https://stackoverflow.com/questions/43587960/gdal-installation-error-using-pip Installing GDAL and OGR for Python? …
krishnab's user avatar
  • 929
0 votes
0 answers
2k views

Converting a GeoTIFF image from RGB to gray scale using Rasterio or GDAL in Python

If there is a convenience function in rasterio or GDAL for this, could someone point it out. I searched but could not find anything. Otherwise I can try to work on creating a windowed read. …
krishnab's user avatar
  • 929
0 votes
0 answers
426 views

Writing dirty block from GDALRasterBand::IRasterIO` even with `LibTiff` > 4.0 on Windows and...

I am using rasterio 1.1.7, and Gdal 3.1.2, and LibTiff 4.1.0. The code I am using for compression is below, and the error message is below as well. …
krishnab's user avatar
  • 929
1 vote
1 answer
482 views

Invalid geometry error after polygonizing a GeoTIFF file

Any suggestions about how to either correct the original GDAL code to make valid geometries, or how to fix the subsequently generated polygons? …
krishnab's user avatar
  • 929
1 vote
0 answers
610 views

Mathematical rule to convert between degrees and centimeters based upon projection

In terms of tools, I was using rasterio and GDAL in python. I would like to do this through code instead of through a tool like QGIS. …
krishnab's user avatar
  • 929
5 votes
2 answers
4k views

create polygon adjacency matrix using python

I am trying to create an adjacency matrix from a set of polygons. That is, I have a bunch of polygons and I want to identify which polygons have a common edge or "touch" each other. Once I find this i …
krishnab's user avatar
  • 929
5 votes
1 answer
960 views

Seeking code behind Fix Geometries tool in QGIS

I also looked in the Log window of the Fix Geometries tool, but it did not seem to show the GDAL code or such, as in other tools. …
krishnab's user avatar
  • 929
2 votes
1 answer
6k views

Read and then write rasterio GeoTIFF file without loading all data into memory

I work with large drone image raster files, on the order of 40,000 x 40,000 and above. I have a large uncompressed GeoTIFF file and I want to use rasterio to rewrite the file in compressed format. I c …
krishnab's user avatar
  • 929