Hot answers tagged

3

I guess you can vectorize the part of your overlaping raster (the one on the right), then use this vector shape to crop the other raster (the red one). Using rasterio library in Python, you can do the following: import numpy as np import rasterio from rasterio import features from rasterio.mask import mask # the first one is your raster on the right # and ...


2

Your coordinates in -a_ullr -151.8860639 56.77489167 -52.91295 14.56403889 are not in -a_srs EPSG:3857 because I do not believe that your data presents the Null Island. If you have the aux.xml file you should not need to do anything special because both the projection and coordinates are stored into the xml file. Keep the aux.xml and the image file in the ...


1

The output image is ruined when the 16 bit source is converted directly with gdalwarp into 8 bit BMP image without scaling the data range. I suggest to make the conversion in two steps. gdalwarp -cutline cutline.json -crop_to_cutline -of GTiff -overwrite W020N90.DEM out.tif gdal_translate -of bmp -ot byte -scale out.tif out.bmp Gdalinfo about the out.tif ...


1

Here's a method using R: library(raster) library(sf) # Load rasters, make sure they are same resolution r1 = raster("aridity.tif") r2 = raster("landcover.tif") r2_resamp = resample(r2, r1) # Get raster extents and find intersection r1_ext = st_as_sf(st_as_sfc(st_bbox(r1))) r2_ext = st_as_sf(st_as_sfc(st_bbox(r2_resamp))) r1_r2_intersect = st_intersection(...


1

Works for me with GDAL 3.1.0, your data, and command gdal_translate -b 1 MRMS_MergedReflectivityQCComposite_00.50_20200527-094830.grib2 output.tif For some reason you got an output image with just -999 values in all pixels. Min=-999 and Max=-999 means that. In my output.tif the statistics show these values STATISTICS_MAXIMUM=60 STATISTICS_MEAN=-424....


Only top voted, non community-wiki answers of a minimum length are eligible