Openlayers / Deepzoom format

Jan Harkes jaharkes at cs.cmu.edu
Wed Oct 3 15:50:12 EDT 2012


On Wed, Oct 03, 2012 at 07:22:46AM +0200, PD Dr. M. Weihrauch wrote:
> As we are using openlayers as a client software, we now wanted to
> present deepzoom-formatted tiles with it. However, there is not native
> support for the deepzoom-format in openlayers (they have a Zoomify
> support, but no Deepzoom).

At some point I looked at both leaflet.js and openlayers, and more
generally the map tile layout used by Google/OpenStreetmap, to see
if there was a viable alternative to openseadragon.

I found the various viewers all had their own set of issues, but format-
wise the problems are not too hard to overcome. You've already
identified two,

> The problem lies - as far as I understand it - in the tile size of
> deepzoom beginning with 1px in folder 0. Also, the "native" openlayers

This is 'trivially' solved in the openslide-python example dynamic tiler
by adding an extra tile-serving handler that adds 8 to the requested
level. So if the browser asks for a level 0 tile, it is passed down to
openslide as a request for a tile at level 8.

    @app.route('/<slug>_osm/<int:level>/<int:col>_<int:row>.<format>')
    def osm_tile(slug, level, col, row, format):
        return tile(slug, level+8, col, row, format)

If you use static tiling it would require some scripting to rename the
generated directories, delete directories numbered from 0 - 7 and then
rename 8 to 0, 9 to 1, etc.

> only supports tiles of 256x256 and deepzoom may have different
> tile-sizes on the right border and the bottom border of the images.

I just looked at the openslide-python:openslide/deepzoom.py code and it
looks like it will always return square (256x256) tiles.

Not sure if I actually would even have noticed if this was a problem,
the example slides I was working with had no data around the edges so
those edge tiles were completely blank in which case you wouldn't even
be able to tell if anything was stretched incorrectly.

Another problem that I found was the fact that map viewers are built to
show coordinates on a globe, so the slide may wrap around and repeat
itself if you scroll around and you want to use vector overlays you
might have to convert the coordinate system to correct for the assumed
projection.

Jan


More information about the openslide-users mailing list