0

Todo

  1. Generated tiles from image1.tif - done
  2. Generated tiles from image2.tif - done
  3. Need to overlay these 2 sets of tiles on top of google maps - this is the problem

gdal2tiles generated ready-made HTML that plotted those generated tiles but since it came from 2 different image files, it also generated 2 ready-made HTMLs.

How do I integrate those multiple tile outputs generated from gdal2tiles into a single google map?

2
  • Are they two different thematic layers with an overlapping geographic extent, or do they not overlap in space? Jun 27, 2016 at 3:19
  • @RichardLaw one should be able to overlap the other Jun 27, 2016 at 3:22

1 Answer 1

1

You have three options:

  • Combine your images into a single VRT, run it through gdal2tiles, and then display it on your map. In this scenario, you would have to pick which raster is top and which is botton and GDAL would merge the two sets together at tile-time. The easiest solution.
  • Modify some Javascript to treat the two tilesets as discrete layers loaded from their file directories into your google maps viewer. This is the hardest solution, especially since the ready-made HTML from gdal2tiles is using file:/// handles instead of web services.
  • Expose your two tilesets as a web service and give them to your google maps viewer as two service layers. This is essentially the same as the above suggestion, however it will work without modifying any Javascript. This isn't difficult but you have to provision server resources.
2
  • option 1 works good, except that the two layers appear overlapped one to the other (in this case they are two different images of the same area), so it is not possible to see one and the other alternatively. Is there a way to turn on an off each one, in order to see one at a time?
    – APR
    Feb 15, 2017 at 6:31
  • If you are tiling a VRT, no, the gdal2tiles script will not make any unnecessary tiles of the unviewable imagery. If you want to see both, you must tile both separately, unfortunately. :(
    – Trann
    Feb 16, 2017 at 14:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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