hholzgra / ocitysmap

Fork of ocitysmap repository at savannah.nongnu.org
Other
35 stars 12 forks source link

PDF and PNG have different outputs (zoom levels) #97

Open Falke-Design opened 11 months ago

Falke-Design commented 11 months ago

PDF has no housenumbers, and less icons. For me it looks like the PDF is generated on a lower zoom level.

https://print.get-map.org/maps/294517

PNG: grafik

PDF: grafik

hholzgra commented 11 months ago

All the vector formats are created using the default DPI settings from which the Mapnik renderer then determines the zoom factor. (not sure whether that is 72 or 96 dpi right now)

When rendering bitmaps I bump up the resolution to 300dpi as long as the total image size allows for that (there is a 32 000 x 32 000 limit in the underlying Cairo graphics library), and fall back to the default resolution when things get too big otherwise.

Unfortunately bumping up the resolution sometimes leads to weird side effects that I wasn't so far file a good minimal reproducing Mapnik renderer bug report for: https://github.com/hholzgra/ocitysmap/issues/62

The solution for higher resolution PDFs I use so far is to render for a larger paper format, then scale it down when printing.

I may actually want to re-visit that idea and change the default DPI for PDFs to a higher value, too (assuming that it is possible not only for bitmap formats which I have to verify first)