I have a land cover raster that I'd like to display as part of an Openlayers based application. I'm able to load the raster directly as a PNG but my Openlayers application becomes VERY slow. I think I want something that can tile the raster and send level of detail tiles that Openlayers can fetch, but I'm not sure since I'm a GIS newbie.

Is this something that GeoServer can handle automatically? I'd love to be able to laod rasters and shapefiles onto the server then link to those layers in Openlayers. Is this the correct approach?

Edit: I ended up using GeoServer and adding the rasters as data sources. I was able to copy and paste a lot of code from the "Layer Preview" section of GeoServer to dump into my OpenLayers application. Thanks for the help.


I would say you have 2 options.

1/ Use a WMS server.

  • You can then use tilecache with openlayers. Here is an example.
  • Mapproxy is also an option. You will find a very recente tutorial from FOSS4G2011.
  • Finally GeoWebCache can also be useful to you. Here a guide to set it up with geoserver.

2/ Or use gdal2tiles and display resulting tiles directly in openlayers.


Yes, that is exactly what GeoServer and the built in GeoWebCache does for you.

I'm assuming that your PNG is geocoded already (i.e. you know which area of the world it covers) in which case you'll probably want to convert it to a GeoTIFF (using GDAL). Check out http://demo.geo-solutions.it/share/foss4g2011/gt_raster_simone_foss4g2011.pdf for a full discussion of adding rasters to GeoServer and how to speed up their display.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.