1

[Update 6.6.2019]

Ok...new detail. I checked a different Apache error log and discovered that it's littered with these errors, generically corresponding to..

failed to allocate png_ptr

Actual errors (I tried changing the PNG I was using)..

Mapnik LOG> 2019-06-06 12:08:04: Exception caught while loading: '/etc/tilestache/styles/images/click_marker_sm.png' (failed to allocate png_ptr)
libpng warning: Application built with libpng-1.6.16 but running with 1.5.13
Mapnik LOG> 2019-06-06 12:08:04: Exception caught while loading: '/etc/tilestache/styles/images/click_marker_sm.png' (failed to allocate png_ptr)
libpng warning: Application built with libpng-1.6.16 but running with 1.5.13
Mapnik LOG> 2019-06-06 12:08:04: Exception caught while loading: '/etc/tilestache/styles/images/click_marker_sm.png' (failed to allocate png_ptr)

Yikes. Is this a build issue? When Googling it, coincidentally, I find where I asked a largely ignored question over at Unix.SE about this exact Mapnik build. I wonder if the gremlin is hiding somewhere in the weeds behind this comment..

make test ## Mine had a few errors, but I ignored them.. :/

So the error notes Mapnik wants to use libpng-1.6.16, but if I run this..

libpng-config --version I get.. 1.5.13

Is it maybe enough to just "fix" my default libpng to sync the versions?


[Original Post]

While migrating to a new system (from Ubuntu to CentOS) I've run into an issue where our new Mapnik 3.0.22—built from source—is mostly working, but with one exception. Any layer consuming an external image asset isn't working—specifically, they seem to be rendering 100% alpha/transparent. Any PointSymbolizer or PolygonPatternSymbolizer referencing a PNG file perform the same.

In Tilestache, all of our layers are configured to render from Mapnik XML declarations—so we shouldn't be bumping into Python bindings issues, as 1) that seems to only affect TextSymbolizer, and 2) XML styling is immune to the problem.

Next, I'm sure our data is accessible with the user credentials provided to Mapnik and that the underlying geodata's projection is correct, because tiles will render if I leave the PointSymbolizer parameters empty and force it to use the Mapnik defaults, which seems to be a black dot. For instance here is a tile rendered from the defaults..

<PointSymbolizer allow-overlap="yes">

With no params, it works!

Meanwhile, the moment I try to point it at a PNG, I just get an empty tile like this (although it's 256x256 of empty pixels)..

<PointSymbolizer allow-overlap="yes" file="/etc/tilestache/styles/images/click_marker.png">

With a PNG param, it fails!

[Update 6.6.2019] FWIW, this is what it should look like (the server in this case is my personal Ubuntu instance with a similar stack, Mapnik 3.1.0, that I sometimes use to experiment or just check my sanity):

enter image description here

The PolygonPatternSymbolizer behaves similarly. For example, here is a tile rendered by our old Ubuntu server using this XML declaration—note the cartographic hashes:

<PolygonPatternSymbolizer file="/etc/tilestache/styles/images/bw-diag-hatch.png"/>

enter image description here

And here's the same tile rendered by the new server using the same XML declarationnote the absence of the cartographic hashes:

enter image description here

I'm not getting any errors pushed up through Apache into the logs. It just seems like Mapnik is ignoring the image assets. Is there something I can do to easily and definitively test whether my Mapnik install will properly consume PNG assets?

I'm to the point where I am questioning my build. :/ Does anyone have any insight or other troubleshooting ideas I can pursue?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.