[GIS] Creating tiles for OpenLayers.Layer.XYZ

openlayers-2tilesweb-mappingxyz

I am trying to use a 200GB ortophoto tif file in a web application using OpenLayers library. As I don't have no software to create WMS WMTS etc. I want to use OpenLayers.Layer.XYZ.

How can I create files required for that (the small tiles and any other metadata file)?

Can I just place that in my web directory or do I need a handler to translate the requests from OpenLayers to find the tile and ship it back?

Best Answer

You can try using GDAL2Tiles. It is a small utility that will convert your GeoTIFFs into a directory structure of small map tiles which you can just copy to your webserver. Once installed, you can use it like so:

gdal2tiles --profile=mercator -z 1-8 yourmap.tif outputfolder

This command will generate tiles from zoomlevel 1-8 outputfolder. You can then upload outputfolder to your webserver and call the tiles using OpenLayers.Layer.XYZ.

Related Question