Skip to content

Instantly share code, notes, and snippets.

View rishabhjain30's full-sized avatar

Rishabh Jain rishabhjain30

View GitHub Profile
@cspanring
cspanring / pip-install-gdal.md
Last active October 18, 2023 07:56
Installing GDAL in a Python virtual environment

Installing GDAL in a Python virtual environment

Get gdal development libraries:

$ sudo apt-add-repository ppa:ubuntugis/ubuntugis-unstable
$ sudo apt-get update
$ sudo apt-get install libgdal-dev

Create and activate a virtual environment:

@perrygeo
perrygeo / mercator_scale.py
Last active February 17, 2023 08:10
Web Mercator Scale/Resolution Calculations
"""
Web Mercator Scale and Resolution Calculations
Python implementation of the formulas at http://msdn.microsoft.com/en-us/library/bb259689.aspx
"""
import math
def meters_per_pixel(zoom, lat):
"""
ground resolution = cos(latitude * pi/180) * earth circumference / map width
"""