I want to convert point data into a grid and used the gdal tool rasterize. The tool works but unfortunately the result looks like this.
The converted point does not represent the center of the grid but the topleft corner. I need it to be in the center. I couldn't find any settings in the tool nor Explanation in the GDAL-Documentation to accomplish that.
Does anyone have suggestions?
I rasterrized the points into raster and NOT raster to point.
If I upload the data directly as raster I get them correct but that doesn't always work. In the picture the underlying raster image is the correct one.
Answer
Just modify the extent to so that xmin = xmin - 1/2 pixel, xmax = xmax + 1/2 pixel, ymin = min - 1/2 pixel, ymax = ymax + 1/2 pixel.
i.e assuming your desired pixel size is 1m and your point layer extent is xmin, xmax, ymin, ymax = 32346264.0,32346299.0,5631990.0,5631999.0
Then set your extent to 32346263.5,32346299.5,5631989.5,5631999.5
No comments:
Post a Comment