Have you looked at the MapnikRasterizer?
I find that one easy to use.
Have you looked at the MapnikRasterizer?
I find that one easy to use.
Thanks @erik_jan
I tried the MapnikRasterizer but I am getting the following error:
REJECTING BELOW FEATURE:
Polygon feature must have at least 4 coordinates...rejecting
I am importing a point shapefile not a polygon file. Is there a way to set it so that it knows I am importing point data.
Thanks @erik_jan
I tried the MapnikRasterizer but I am getting the following error:
REJECTING BELOW FEATURE:
Polygon feature must have at least 4 coordinates...rejecting
I am importing a point shapefile not a polygon file. Is there a way to set it so that it knows I am importing point data.
Per imported layer in the MapnikRasterizer you can set the type of features (geometry) and the style options.
Have a look at this document:
MapnikRasterizer
Can you show us how you've configured the NumericRasterizer?
Can you show us how you've configured the NumericRasterizer?
Hi @david_r
These are the settings I used!
Hi @david_r
These are the settings I used!
This is what the transformer is doing, based on your configuration:
- Calculate the extent (bounding box) of all your points
- Divide the totalt extent into a grid of 0.5 x 0.5 meter large cells
- If a point is inside a cell, the cell gets the value from the point
So unless your points are all perfectly lined up in accordance with the grid, you'll often get these effects.
One way to mitigate this problem could be to set a user-defined ground extent in the NumericRasterizer and do a slight offset compared to your point extents, e.g. half a cell off (-0.25).
Hi @aquamarine, I think the NumericRasterizer with your setting creates desired raster if the original points form a grid with spacing 0.5m x 0.5m. How did you confirm that the center of cells in the resulting raster have been moved 0.25m from the original points?
Hi @aquamarine, I think the NumericRasterizer with your setting creates desired raster if the original points form a grid with spacing 0.5m x 0.5m. How did you confirm that the center of cells in the resulting raster have been moved 0.25m from the original points?
I checked it with this workspace.
numericrasterizer-experiment.fmw (FME 2017.1.2.1)
Result. Looks the center of cells in the resulting raster match the original points (red).
A possible source of the issue could be that the raster cell size isn't exactly the same as the point spacing. Here's what it looks like if we use Takashi's example and set a raster cell size of 0.55 while retaining a point spacing of 0.5:
Notice how the points "drift" compared to the raster cells, eventually crossing into the neighboring cell.
A possible source of the issue could be that the raster cell size isn't exactly the same as the point spacing. Here's what it looks like if we use Takashi's example and set a raster cell size of 0.55 while retaining a point spacing of 0.5:
Notice how the points "drift" compared to the raster cells, eventually crossing into the neighboring cell.
Yes, it's a possible situation. Also if the original points didn't form a grid with equi-spacing, naturally cell centers won't match the original points.
Another thought. Once set the cell origin to (0, 0) and then transform the raster into grid points with the RasterCellCorecer, the resulting points match left-bottom corners of the cells. It seems that FME reads an Esri ASCII Grid raster with cell origin (0, 0), so I think this is also a possible situation.
Anyway, let's wait for @aquamarine's response.
Hi @aquamarine, I think the NumericRasterizer with your setting creates desired raster if the original points form a grid with spacing 0.5m x 0.5m. How did you confirm that the center of cells in the resulting raster have been moved 0.25m from the original points?
Thanks @takashi
I realize now that the issue was that my original point shapefile was not evenly gridded at 0.5m intervals and that's why I wasn't getting the NumericRasterizer to work. I will need to recreate the point shapefile with 0.5m intervals.