The Geo-ICT Blog

Tutorials/Post – ICT, GIS, Remote Sensing, Earth System, Humanitarian, Disaster Management, Travel

Converting Satellite Imagery to Tile Map Service

Converting an satellite image to TMS is relatively easy, especially if you are using powerful GDAL library. GDAL has binding in Python which I will be using in this post.

  1. Install the OSGeo4W for windows. For linux, you can use OSGeoLive which has everything that OSGeo4W has. For more information on linux equivalent to OSGeo4W, see this stackoverflow post.
  2. Open up the OSGeo4W shell and type o-help to see the list of commands that can be used with the OGR/GDAL binding.pumtty2
  3. We will be using gdal2tiles to convert image into tiles. An imagery can be available in different format. Normally a single image as TIF or GeoTIF and mosiac of images as VRT (Virtual Raster Tables) . VRT can be use to store information to generate layers or can be used to mosaic multiple data in one. You need to convert VRT as one using gdal_merge.
  4. Minimal thing you need is an input file to the gdal2tiles command.
    gdal2tiles -z 1-21 C:\data\JIL-PHU-PAN.tif C:\xampp\htdocs\TMS
    where I specified the tiles to be generated for from zoom level 1 to zoom level 21. JIL-PHU-PAN.tif is my input file and TMS is the output directory.kq20njp
  5. You can use these tiles for various purpose. One purpose is using in Web Mapping Application. If you look inside the folder for TMS, you can find file named googlemaps.html, leaflet.html and openlayers.html which you can double click to view in browser (picture below).xaaaxzc
  6. Another interesting example is utilizing these tiles in OpenStreetMap to digitize. If you have web server like xampp, copy the folder to the document root. Get your IP address. Open up the OpenStreeMap, zoom enough into your area so you can Edit with iD (in-browser editor).7nvskcsType B (shortcut to Background settings), click custom and then get the URL of the TMS directory. In my case, those are at the http://172.24.144.1:85/TMS hosted on local xampp server. So the custom URL to enter will be http://172.24.144.1:85/TMS/{z}/{x}/{-y}.png.xpkodqw

Now you can start using the TMS with the openstreetmap.

Previous

Building capacity on Common Alerting Protocol for Nepal

Next

Installing GDAL on Ubuntu

4 Comments

  1. Pasc

    Hi i’ve tried your to generate tiles with gdal2tiles, it works well, i’ve also tried it with the Qtiles plugin in Qgis.
    I’ve got a weird result, tile generated from Qtiles don’t have the same name than the ones generated by gadal2tiles.
    Do you have any idea of what happen ?

  2. venugopal

    what are the linux commands for making landsat8 image to tileset y using gdal2tiles and how to colour it

Leave a Reply

Powered by WordPress & Theme by Anders Norén

%d bloggers like this: