Skip to content

Instantly share code, notes, and snippets.

View devdattaT's full-sized avatar

Devdatta Tengshe devdattaT

View GitHub Profile
@devdattaT
devdattaT / mohallas.geojson
Last active June 24, 2016 12:27
The Polygons of Mohallas of Delhi
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@devdattaT
devdattaT / getTiles.py
Created July 14, 2014 08:31
Downloading of Slippy Tiles using Shapely.
import math
import os
import urllib
from shapely.geometry import Polygon
def deg2num(lat_deg, lon_deg, zoom):
lat_rad = math.radians(lat_deg)
n = 2.0 ** zoom
xtile = int((lon_deg + 180.0) / 360.0 * n)
ytile = int((1.0 - math.log(math.tan(lat_rad) + (1 / math.cos(lat_rad))) / math.pi) / 2.0 * n)