Question

Mapnikrasterizer marker fails on FME server

  • 7 November 2019
  • 4 replies
  • 7 views

Badge +2

I'm having trouble with the migration of one of my workflows to the FME server. The goal is to create a legend out of attribute_1 (images) and attribute_2 (text). The end result is this:

0684Q00000ArBBrQAN.png

How it works:

 

My program (outside the FME workflow) prepares a table (MySQL) with the text and the image (SVG tag). When the table is finished I use FME to save these SVG tags to an text file with .svg extension on my hard disk and then convert them into raster using the MapnikRasterizer and store them again as PNG files on my hard disk using FeatureWriter (PNG).

Running this with FME desktop is no problem (hence the above result) and so far so good.

But, I’m having trouble getting this to work with FME server parameters. For example when one of the attributes has the following value.

2296    Attribute(string) : `row1' has value `$(FME_SHAREDRESOURCE_TEMP)/Temp/242/2.svg'

0684Q00000ArBBmQAN.png

It ends with this error:

0684Q00000ArBBwQAN.png

 

So i tried to fix it and using string replacer on row1 and pointing to the file directly: 

2005    Attribute(string) : `row1' has value `/data/fmeserver/resources/temp/Temp/242/2.svg'

With the same settings as above gives me:

0684Q00000ArB6FQAV.png

 

Where is the shapefile coming from? I never used anything like a shapefile in this flow. But saw that the mapnik uses them for temp files:

2019-11-07 15:05:50|   5.4|  0.1|INFORM|Using Shape Writer to write shape files to folder `C:\Users\jeroen\AppData\Local\Temp\mapnikfactory1573135549949_15276'
2019-11-07 15:05:50|   5.4|  0.0|INFORM|Opened Shape File 'C:\Users\jeroen\AppData\Local\Temp\mapnikfactory1573135549949_15276\0.shp' for output
2019-11-07 15:05:50|   5.4|  0.0|INFORM|Opened DBF file 'C:\Users\jeroen\AppData\Local\Temp\mapnikfactory1573135549949_15276\0.dbf' for output

Is there a way to fix this or am i missing something?


4 replies

Badge +2

I managed to finish the migration of the whole workflow to the server except for this part. Ruling out all other things and pinpointing it ever more on this little section. When turning off the MapnikRasterizer that turns the svg's in 30x30 png images the result is as followed:

0684Q00000ArKEqQAN.png

The images that are there are GIF files stored somewhere else and see the blank spots where the SVG images should have been.

I'm using two input ports with the rasterizer: The first one is a polygon of the area of the image (30x30) and the second is a point object marking the centre point of this polygon using the Markers symbolizer with the style pointing to a file. The file name is in the attribute row1 and it contains the location of the SVG on the server like this:

$(FME_SHAREDRESOURCE_TEMP)/Temp/258/2.svg

I checked and made sure that the svg files are made before getting to this part.

The file is there:

0684Q00000ArJw5QAF.png

But still getting this:

0684Q00000ArK7YQAV.png

When i disconnect the input of the points and only use the polygon it finishes everything like it should and makes the png files (containing white 30 x 30 pixel images). So i'm getting there but not quite yet. Are there any kind of restrains for the Mapnik that limits it to do something with svg's files or FME-server parameters in a field/attribute?

Badge +2

I made a testflow with just this part in it:

temp.zip

Excel is a copy of the relevant data from my database. Also the svg files are present and need to be in the $(FME_SHAREDRESOURCE_TEMP)/Temp/259/ location on the FME server.

Badge +2

I fixed it!

The solution:

Did not get it to work in one transformer because of the FME server parameter.

Badge +2

I fixed it!

The solution:

Did not get it to work in one transformer because of the FME server parameter.

I do not know why it did not work last time i tried this, but this works for me :). Looks like the MapnikRasterizer does not like FME-server parameters in the value you use in the file options of the markers style.

Reply