Skip to content

Instantly share code, notes, and snippets.

View renaudallioux's full-sized avatar

Renaud ALLIOUX renaudallioux

View GitHub Profile
@renaudallioux
renaudallioux / gdal2tilesG.py
Last active May 23, 2018 19:06 — forked from jeffaudi/gdal2tilesG.py
This is a version of gdal2tiles.py that generates tiles with the Google Maps naming rather than the normal OGC TMS one. This is just an inversion in the direction of the Y axis (ynew = 2^zoom – yold). I have also replaced EPSG:900913 by EPSG:3785 since gdal issues a warning.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#******************************************************************************
# $Id: gdal2tiles.py 27044 2014-03-16 23:41:27Z rouault $
#
# Project: Google Summer of Code 2007, 2008 (http://code.google.com/soc/)
# Support: BRGM (http://www.brgm.fr)
# Purpose: Convert a raster into TMS (Tile Map Service) tiles in a directory.
# - generate Google Earth metadata (KML SuperOverlay)
# - generate simple HTML viewer based on Google Maps and OpenLayers