tiff

How to make binary mask of large .tif file fast using .shp file with polygons (GPS coordinates)?

How to make binary mask of large .tif file fast using .shp file with polygons (GPS coordinates)? Question: I have a large .tif file (~24 Gb, more, than RAM could store) (Similar question: https://rasterio.readthedocs.io/en/latest/topics/masking-by-shapefile.html) (Method from library: https://rasterio.readthedocs.io/en/latest/topics/masking-by-shapefile.html) But I’m searching another faster solution. Maybe I should create numpy array with zeros and add polygon …

Total answers: 1

Xarray clip or mask dataset with another dataset

Xarray clip or mask dataset with another dataset Question: Goal: Replace values of a dataset by NaNs if the values of another, smaller dataset, are non-nan. Context: I have 1 netcdf file (DEM) that covers a large area. I have another netcdf file (BED) that covers a smaller area included in the bigger dataset. I …

Total answers: 1

High performance (python) library for reading tiff files?

High performance (python) library for reading tiff files? Question: I am using code to read a .tiff file in order to calculate a fractal dimension. My code looks like this: import matplotlib.pyplot as plt raster = plt.imread(‘xyz.tif’) for i in range(x1, x2): for j in range(y1, y2): pixel = raster[i][j] This works, but I have …

Total answers: 2

Reading 5th TIFF's channel in Python?

Reading 5th TIFF's channel in Python? Question: I have some TIFF files that are the output of a Maya renderer, and I need to composite them with some real footage. The TIFF files have 5 channels, rgba + depth channel for compositing. However, all the TIFF loading libraries I have tried seem to discard the …

Total answers: 1

Python: Read and write TIFF 16 bit , three channel , colour images

Python: Read and write TIFF 16 bit , three channel , colour images Question: Does anyone have a method for importing a 16 bit per channel, 3 channel TIFF image in Python? I have yet to find a method which will preserve the 16 bit depth per channel when dealing with the TIFF format. I …

Total answers: 6

Write Latitude and Longitude to Geotiff file

Write Latitude and Longitude to Geotiff file Question: I am basically trying to achieve the opposite of this question. I have a set of latitude and longitude coordinates (with values) in the WGS84 coordinate system, that I would like to write to a geotiff (or just add to a gdal dataset) via the gdal python …

Total answers: 2

Working with TIFFs (import, export) in Python using numpy

Working with TIFFs (import, export) in Python using numpy Question: I need a python method to open and import TIFF images into numpy arrays so I can analyze and modify the pixel data and then save them as TIFFs again. (They are basically light intensity maps in greyscale, representing the respective values per pixel) I …

Total answers: 12

Obtain Latitude and Longitude from a GeoTIFF File

Obtain Latitude and Longitude from a GeoTIFF File Question: Using GDAL in Python, how do you get the latitude and longitude of a GeoTIFF file? GeoTIFF’s do not appear to store any coordinate information. Instead, they store the XY Origin coordinates. However, the XY coordinates do not provide the latitude and longitude of the top …

Total answers: 2