This is a static archive of our old OpenStreetMap Help Site. Please post any new questions and answers at community.osm.org.

Increase PNG output resolution in Mapnik

2

We would like to print maps using Mapnik.

The SVG export seems not to be perfect, but PNG is nice - the only problem is the low resulution.

Is there an "easy" way to export in a around 300dpi instead of screen resolution?

Basically in the OSM Mapnik stylesheet all values are pixels. Using the scale parameter in the TileMill project file, caused strange results.

asked 15 Dec '12, 16:04

AddisMap_Alexander's gravatar image

AddisMap_Ale...
1.1k314062
accept rate: 0%

1
(16 Dec '12, 14:05) AddisMap_Ale...

3 Answers:

4

This may be no complete answer - but hopefully still good help: You could search the web for tiles retina - it is quite a similar (same) problem for high-resolution displays (popular through Apple's high-resolution displays, named "retina"). http://openstreetmap.at/content/hires is a good example of high-res tiles. A search for high-res tiles openstreetmap is also promising. ;-)

Also see our wiki entry on printing. If you want to print OSM for personal use - did you try the pdf version of the export tab on our main map page?

answered 15 Dec '12, 17:00

aseerel4c26's gravatar image

aseerel4c26 ♦
32.6k18248554
accept rate: 18%

edited 20 Nov '14, 13:32

4

Explain "strange results" - I use the --scale-factor parameter on nik2img and I believe that should do the same as TileMill's scale parameter. Of course you have to adjust the output size accordingly; if you specify --scale-factor 4 and want the same detail then you need to quadruple your width and height as well.

answered 15 Dec '12, 19:02

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
82.5k927201273
accept rate: 23%

2

Actually it looks like this strange results only happen in the tile view in TileMill. When I export it is actually all fine, as long as I zoom in more according to the current scale.

(16 Dec '12, 14:04) AddisMap_Ale...

2

Recently found: Nik4 ... there you can choose ppi or dpi value, I think.

answered 20 Nov '14, 19:37

stephan75's gravatar image

stephan75
12.6k556210
accept rate: 6%

Source code available on GitHub .