Question

MapnikRasterizer and text

  • 19 February 2015
  • 5 replies
  • 7 views

Badge
Hi All,

 

I'm trying something that should be super-easy but it's simply not playing ball.

 

 

I have a creator that creates a single point (X:500, Y:-500 for example). I feed that point into the MapnikRasterizer (MR) transformer, changing it to "Text" symboliser.

 

I set a massive size to the raster (1000*1000), and "Use input data ground extents".

 

 

But 9 times out of 10, there is no text anywhere on the raster. On the 1/10 times that I've had text, it hasn't been near the point, instead using the top-left as its anchor.

 

 

I've tried just about every possible combination of settings I can think of, all to little avail. I've also looked at the examples Mark Ireland created for his blog post - those work, but when I try and copy the values to my data... it fails.

 

 

So, incredibly simple question:

 

How do you use MR to create text on a point?

 

 

Thanks,

 

Jonathan

 

 

(Surprisingly few questions about the MapnikRasterizer transformer on here.)

5 replies

Userlevel 4
Hi,

 

 

I've never used the MapnikRasterizer before, but it worked really well IF I specified the ground extents in the transformer. Leaving it as "use input ground extents" didn't really work if the only input was a point (i.e. not really any extents, as such).

 

 

David
Badge +3
Hi,

 

 

If you use a point feature to place text and you set a pixelframesize.

 

You must check what the placement is. You can use Text dx and Text dy to offset it.

 

500,500 will bring it to centre (when using a 1000X100 raster)

 

 

 

 

Then youy won't need to enter some groundextent either.
Badge +3
Oh, it is found under edit-->positioning. Lots of options there.
Badge +3
and it doesn't matter to the rasterizer if u place your point at 500,-500 or 0,0.

 

The postioning (mnr parameters) matter.

 

 

If left to its own device, your point is at the left uppercorner
Badge
Hi Gio,

 

I'd found Dx/Dy and played with them, but that requires manually setting attributes (or linking to attributes). I was wondering how to just get FME to handle the point automatically.

 

 

It seems that David's suggestion is the one that works. Don't "use input data ground extents" if your input is a single point. Or even two points (it'll use a bbox around the points; they'll still be on the edges).

 

 

Thanks both,

 

Jonathan

Reply