Solved

Converting vector grid to raster - unwanted raster cells


Badge

I have created a vector grid consisting of polygons with size 0.00027778 degrees (around 30m). The polygons have a value which represents the number of people living whithin it. Naturally, lots of polygons will have zero inhabitants. These polygons are filtered out. I want to convert this grid to a raster grid with each raster cell matching the vector polygons exactly. The "missing" polygons with zero inhabitants should result in a NoData raster cell.

I'm feeding the polygons into NumericRasterizer, using the exact same cellsize as with the polygons. It seems that what I'm trying to do is possible. However, in the northern parts of my grid, there are raster cells which should be NoData, but instead they have taken the value of the cell above it.

The image shows comparison of polygons (red outline) and raster cells:

In the northern part of the image, all raster cells have a "twin" directly below them which should be NoData and thus invisible. Everything to the south is OK. The total size of my grid is 0.5x0.5 degrees, but I have also tried with 1x1 degree with the exact same results. I have also tried with "Tolerance" in NumericRasterizer at both 0 and 1, with no luck.

Anyone have an idea of how to get rid of these unwanted cells?

icon

Best answer by takashi 9 June 2017, 23:23

View original

2 replies

Userlevel 2
Badge +17

Hi @mbu, if it was caused by slight error of the location or the size of the polygons, possibly it could be resolved by replacing the polygons with their center points using the CenterPointReplacer before rasterising.

In addition, if the extents of resulting raster would not be precisely match required extents, consider specifying ground extents parameters in the NumericRasterizer.

Badge

Hi @mbu, if it was caused by slight error of the location or the size of the polygons, possibly it could be resolved by replacing the polygons with their center points using the CenterPointReplacer before rasterising.

In addition, if the extents of resulting raster would not be precisely match required extents, consider specifying ground extents parameters in the NumericRasterizer.

@takashi, this fixed the problem, thank you very much!

 

Reply