I have three numpy arrays, one with data, and two more with explicit longitudes and latitudes. I'd like to write this data to make a GeoTIFF file with rasterio
such that I can load it with QGIS. The data comes originally from a known lambert conformal projection, if it helps. How can I save this matrix in GeoTIFF format?
Trying to be more precise, I'm following this tutorial to get radar data. Following it, I have two matrices x
and y
of shape (720, 1832)
, and an additional matrix ref_data
with the same shape, which contains the actual data. The matrices x
and y
represent the distance in meters in the zonal and meridional distances to a given point of coordinates (-85.94388888888889, 37.97527777777778)
. Now, I'd like to diverge from the tutorial in that I do not want to get a plot using cartopy and matplotlib, but to save a GeoTIFF image with rasterio
. For this I need the affine transformation (I believe). How can I get it and save this data as a raster properly georeferenced?
Is it possible to do this with Python and rasterio?
Affine
transform. There's not much more we can say unless you edit your question and include more details about your arrays, in particular array shape and x,y coordinates of the bounds (upper left, lower right) which you can extract from your arrays of coordinates. Note if the array is actually in lamberts, then these coordinates won't/shouldn't be lon, lat but x, y