I have been trying to convert one of Sentinel-5P (Sentinel-5P Data) dataset (viz. 'methane_mixing_ratio_precision') to GeoTIFF file. The plot of one of its dataset viz. 'methane_mixing_ratio_precision' using the below code is methane_mixing_ratio_precision:
import xarray
import matplotlib.pyplot as plt
netcdf_fname = r'C:\Users\User\Desktop\NC Files\CH4_1.nc'
xds = xarray.open_dataset(netcdf_fname, group='PRODUCT')
plt.figure(figsize=(14,8))
ax = plt.axes()
xds.methane_mixing_ratio_precision[0].plot.pcolormesh(ax=ax, x='longitude', y='latitude',add_colorbar=True, cmap='jet');
Till now I have successfully created a point shapefile (Point Shapefile) of the above mentioned dataset. Now I want to convert this point shapefile to polygon shapefile which then I can rasterize to get GeoTIFF file as shown in methane_mixing_ratio_precision.
Using @gene suggestion, I was successfully able to create a buffer (7Km x 7Km) around each point geometry using geopandas:
import geopandas as gpd
points = gpd.read_file(r'C:\Users\User\Desktop\NC Files\methane_mixing_ratio_precision_points.shp')
points.geometry= points.geometry.apply(lambda x: x.buffer(0.063, cap_style = 3))
points.to_file(r'C:\Users\User\Desktop\NC Files\methane_mixing_ratio_precision_points_buffer.shp')
What I basically want is to create a grid (inclined in nature) of (5.5 Km * 3.5 Km) around each point geometry and that grid should like Section of Methane Plot.