Hi there,
I've been toying a lot with rasters lately, but I've hit a bit of a snag. I need to create a raster from shape files that has a resolution based on another step that takes place in my workbench. I'll explain:
So first thing I have is a set of polyline geometries. In quite few steps (BoundingBoxAccumilator ->GeometryCoarcer ->Chopper ->LengthCalculator-> StatisticsCalculator) I know what the longest and shortest edge is of the bounding box of my geometry, by using the Minimum and Maximum based on the lengths calculated. Anyway, this is just to give some context, it is not the problem area. I did inspect this output and I do get for example Minimum:1000, Maximum 1500.
I also have a FeatureReader separately attached to the BoundingBoxAccumilator mentioned above, which calls a WMS layer and outputs a raster based on the inside of the bounding box. Naturally this will also have a Rows/Columns of 1000x1500 as it uses the same bounding box as my geometries.
Now the problem happens in my final step where I want to bring it all together. I now want to take the original polylines and rasterize them via the MapnikRasterizer. The catch is, I want to use the Minimum and Maximum values determined in the first step (by the StatisticsCalculator) to be used as the Columns and Rows values in the MapnikRasterizer, as I will be using the workbench on multiple separate geometries, and I want the values to always match the bounding box, and the WMS tile I'm calling.
I understand this is a long and confusing explanation, so here's an image of my workspace to make more sense of it all (EDGESHORT and EDGETALL is just Minimum and Maximum renamed:
When I do run the workbench I get the following error:
MapnikRasterizer(MapnikFactory): No values were specified for either both NUM_ROWS and NUM_COLUMNS, or SPACING. One or the other must be specified
A VERY IMPORTANT NOTE: In principal, my workspace works perfectly how I want it if I manually place 1000 and 1500 as the MapnikRasterizer's Columns and Rows. Then my output is a perfect raster of my WMS backdrop, and my Line geometries overlapping that, all at the same resolution. The issue is not there, but specifically on how to dynamically set the MapnikRasterizer's Columns and Rows based on whatever the bounding box extent is of my line geometries.
My aplogies for the wall of text, and thanks in advance for any help :)