Skip to main content
Solved

Problem to add dynamically number of rows and columns parameters to MapnikRasterizer transformer.


Forum|alt.badge.img

In the MapnikRasterizer settings, in the Raster Properties section, it is necessary to specify the number of columns and rows of the output raster. 

 

When I enter this information manually, there is no problem.

 

When I want these parameters to be filled in dynamically, i.e. using the number of columns and rows of the input raster (using a RasterPropertyExtractor beforehand to access the attributes), I get this error message:

"MapnikRasterizer_2 (MapnikFactory): No values were specified for either NUM_ROWS and NUM_COLUMNS, or SPACING. One or the other must be specified

MapnikRasterizer_2 (MapnikFactory): A fatal error has occurred. Check the logfile above for details

AttributeManager_OUTPUT_-1_84_Player (RecorderFactory): A fatal error has occurred. Check the logfile above for details

A fatal error has occurred. Check the logfile above for details".

 

The number of columns and rows in the input raster are 32 bit unsigned integer. When I converted it to 64 bit integer via the Attribute Manager and the arithmetic calculator, it doesn't change anything, I still get the same error message.

 

However, if I create user parameters by manually entering the number of columns and rows in them. And then I assign these user parameters to the raster via AttributeManager (the parameters are in 64 bit integer). And finally, I assign these new attributes in a "dynamic" way as parameter values for the number of columns and rows of the raster in the output that WORKS.

 

In the end, I still find myself manually modifying the number of columns and rows of the output raster each time the input raster is modified.

 

Do you have an explanation/solution?

 

Thank you.

 

 

Best answer by bdel

https://community.safe.com/s/question/0D54Q000080hIjKSAU/mapnikrasterizer-cell-spacing-from-attribute

 

A FeatureMerger should be used, which allows the number of columns and rows in the raster to be added to the feature set (used as input to MapnikRasterizer).

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

4 replies

Forum|alt.badge.img
  • Author
  • Best Answer
  • June 8, 2022

https://community.safe.com/s/question/0D54Q000080hIjKSAU/mapnikrasterizer-cell-spacing-from-attribute

 

A FeatureMerger should be used, which allows the number of columns and rows in the raster to be added to the feature set (used as input to MapnikRasterizer).


daraghatsafe
Forum|alt.badge.img
bdel wrote:

https://community.safe.com/s/question/0D54Q000080hIjKSAU/mapnikrasterizer-cell-spacing-from-attribute

 

A FeatureMerger should be used, which allows the number of columns and rows in the raster to be added to the feature set (used as input to MapnikRasterizer).

@bdel​ Were you able to successfully add the rows and columns dynamically by using the FeatureMerger?


Forum|alt.badge.img
  • Author
  • June 13, 2022
daraghatsafe wrote:

@bdel​ Were you able to successfully add the rows and columns dynamically by using the FeatureMerger?

Yes @daraghatsafe​ that way it worked !

So as an input to MapnikRasterizer, I had :

  • One feature in raster format (with the number of columns and rows)
  • Multiple features in a vector format

Beforehand, I used a FeatureMerger to add to all features in a vector format the attributes number of columns and rows of my input raster.


daraghatsafe
Forum|alt.badge.img
daraghatsafe wrote:

@bdel​ Were you able to successfully add the rows and columns dynamically by using the FeatureMerger?

Hi @bdel​ that is great to hear glad that you were able to solve the problem.


Reply


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