mapnik / mapnik-support

Use the issues queue here to ask questions and offer help on using Mapnik (maybe if this works well we can retire the mailing list at http://mapnik.org/contact/?)
6 stars 6 forks source link

Scaling png in `PolygonPatternSymbolizer` #131

Open zdila opened 4 years ago

zdila commented 4 years ago

Hello,

Is there a way to scale raster image in PolygonPatternSymbolizer? Attribute `transform="scale(0.5)" doesn't seem to work for rasters.

We don't want to save the scaled image directly because we want it to be crisp also for high-resolution rednering. And we can't use SVG because Mapnik renders the edges ugly if clipping is used.

talaj commented 4 years ago

Hi, this was reported recently in https://github.com/mapnik/mapnik-support/issues/129 and in https://github.com/mapnik/mapnik/issues/4097. It's really a shame this is not supported. I don't have time to work on it currently. What's the problem with ugly edges and clipping?

zdila commented 4 years ago

Clipping is actually ignored. This is just a testcase:

image

SVG file:

orchard.svg.gz

lightmare commented 4 years ago

Mapnik ignores SVG clip-path. That particular orchard.svg can be amended to not use clipping. Just crop the "apples" path by intersecting it with the clipPath rectangle.

zdila commented 4 years ago

Yes, I am cropping it now, but some patters were difficult to crop (in Inkscape).