Question

MapnikRasterizer - Polygon Pattern unexpected results

  • 30 April 2021
  • 2 replies
  • 5 views

Badge

Hello,

 

I have a set of polygons to which I'm trying to attach an image texture (grass polygon + grass jpeg). The image is in pngformat, resolution is 1140x1140 and covers approximately 5x5 meters. I've used the tiler to tile the grass area into 5x5 tiles and used the Polygon texture in the MapnikRasterizer with the Local alignment option.

 

I would expect the image to be fit into the entire polygon tile but it's not. It's instead cut into a smaller image and fit like that. Example workspace and image are attached.

 

Is there something I'm doing wrong? I would like the image to fit the polygon tile and that's it. Any recommendations?

 

Thanks


2 replies

Userlevel 2
Badge +17

Hi @mrdado12345​ ,

It appears that Mapnik does not scale the pattern image when using it to fill the polygon. Your pattern image is 1140x1140, but the output polygon raster is only 500x500, so only a section of the pattern image will be used.

 

You may want to try scaling the pattern image before using it, or render to a higher resolution.

Badge

Hi @mrdado12345​ ,

It appears that Mapnik does not scale the pattern image when using it to fill the polygon. Your pattern image is 1140x1140, but the output polygon raster is only 500x500, so only a section of the pattern image will be used.

 

You may want to try scaling the pattern image before using it, or render to a higher resolution.

Is there a way to do it as I described - fit the image to polygon tiles? I tried with AppearanceSetter but it did a similar thing as the Mapnik and didn't fit the entire image to tiled polygons.

 

My goal is to is to set the appearance of my surface with ortho image + polygonal textures (grass, pavement etc.).

 

Thanks

Reply