I have been working on a project where I need to create rasters from irregularly spaced point clouds. I am resampling my point clouds to a regular 0.25 cm grid using a nearest neighbor method pyresample. I am using the output array to make a raster using GDAL and my raster is inverted on the y-axis. For a particular dataset I get the extents and apply a geotransfrom using the following parameters:
top_left_x(i.e., xMin)
top_left_y(i.e., yMax)
x_resolution
y_resolution
x_rotation
y_rotation
For a hypothetical dataset, let's say my geo transform parameters are:
top_left_x(i.e., xMin)=223280.0
top_left_y(i.e., yMax)=577877.75
x_resolution=0.25
y_resolution=-0.25
x_rotation=0
y_rotation=0
Using GDAL's GTiff
driver I am successfully creating rasters by writing the output array Result
to rasterband(1)
. The problem is the output raster us upside down w.r.t the y axis. If I flip the array result
using numpy
like: np.flipud(result)
, the raster is plotted in the correct position. I am at a loss why I need to flip result
and want to see if someone can help me understand why.
No comments:
Post a Comment