Skip to main content
Solved

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

  • June 8, 2022
  • 4 replies
  • 52 views

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).

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

4 replies

Forum|alt.badge.img
  • Author
  • 4 replies
  • 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
  • 135 replies
  • June 10, 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).

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


Forum|alt.badge.img
  • Author
  • 4 replies
  • June 13, 2022

@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
  • 135 replies
  • June 13, 2022

@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.