Skip to main content
Solved

Converting vector grid to raster - unwanted raster cells


Forum|alt.badge.img

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?

Best answer by takashi

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.

View original
Did this help you find an answer to your question?

2 replies

takashi
Influencer
  • Best Answer
  • June 9, 2017

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.


Forum|alt.badge.img
  • Author
  • June 11, 2017
takashi wrote:

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!

 


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings