[OSM-dev] "Retina" tiles - best way to support them?

Igor Brejc igor.brejc at gmail.com
Thu Jun 28 09:22:51 BST 2012


Hi,

FWIW, Maperitive provides a "resolution" parameter to its generate-tiles
command. The parameter is an integer value indicating the scale to use when
rendering tiles - the default 1 renders 256x256 tiles. If you set it to 2,
you get 512x512.
Technically the whole thing is implemented by scaling the graphics, which
is quite easy to do in GDI+ (.NET graphics engine). The user doesn't have
to change the map style.
I used the same technique to achieve the subpixel accuracy in Maperitive
(since GDI+ doesn't provide for this):
http://braincrunch.tumblr.com/post/13459650973/maperitive-beta-subpixel-accuracy

Best regards,
Igor

On Tue, Jun 26, 2012 at 11:05 PM, Frederik Ramm <frederik at remote.org> wrote:

> Hi,
>
>   I have had some people asking whether I could supply them with "Retina"
> map tiles. "Retina" is an Apple brand name for higher resolution displays,
> and these users tend to mean tiles with twice the resolution.
>
> I wonder if anyone has done this already. I can think of a number of
> possible angles to attack this:
>
> 1. Double all font sizes, line widths, etc. in the Mapnik style file
> (recent Mapnik versions also have a built-in scaling option that achieves
> about the same) and adapt all scale denominators accordingly.
>
> This would mean that meta tile size, tile size, and everything else would
> remain unchanged but you'd be shifting everything by one zoom level - what
> was on one z16 tile before is now on four z17 tiles. The "Retina" user
> would see less detail on the same zoom level and therefore would have to go
> down to z19 to see what is currently shown on 18.
>
> Also, font nastiness along the metatile edges would increase; the amount
> of font nastiness depends on the ratio of tile size to font size, so
> doubling font sizes and keeping metatile sizes will increase label clipping
> and other strange things. (Simply increasing the buffer doesn't help.)
>
> 2. Modify style as per 1., but also double the size of meta tiles to
> 4096x4096. Cut 16x16 normal tiles out of one meta tile, rather than 8x8.
> This avoids the increase in font nastiness but requires internal processes
> to adapt to larger metatiles. The "zoom level shift" problem is the same as
> in 1.
>
> 3. Modify style as per 1., double size of meta tiles to 4096x4096, and
> double size of tiles to 512x512. This avoids the increase in font nastiness
> *and* it has the nice effect that one "Retina" tile at a certain zoom level
> shows exactly the same content as a normal tile, just on 512x512 instead of
> 256x256 and therefore at twice the resolution. It would, however, require
> clients (OpenLayers et al.) to work with the larger tile size.
>
> Your thoughts on these options - are there more than these three, perhaps?
> - would be most welcome.
>
> ("Tiles for printing" is a very similar issue - "print" users tend to want
> quad-resolution tiles, and again you have the options of shifting the zoom
> level by 2 or making 1024x1024 tiles.)
>
> Bye
> Frederik
>
> --
> Frederik Ramm  ##  eMail frederik at remote.org  ##  N49°00'09" E008°23'33"
>
>
> ______________________________**_________________
> dev mailing list
> dev at openstreetmap.org
> http://lists.openstreetmap.**org/listinfo/dev<http://lists.openstreetmap.org/listinfo/dev>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/dev/attachments/20120628/a2a7beb2/attachment-0001.html>


More information about the dev mailing list