Instantly share code, notes, and snippets.

View .block
ae534a5cedfa284086717f1814bafe81
View .block
13029d084201f5012391e231215961f0
View .block
ab01821e77d2f1c44e9d71c826e54db6
View .block
f2605e92dff3a976d97ae6027d07f6b5
View .block
0b0995536ec3e691cec6725783870a70
View .block
281f92fae4192c4a569fc992d10a9914
View .block
a0b505c3d0e42cfbdf39b0d2c19ada0c
View .block
eda813560c801474904004d6b6b1cc4c
View catcsv.py
# -*- coding: utf-8 -*-
import sys
import csv
from collections import deque
from itertools import islice
def skip_last_n(iterator, n=1):
it = iter(iterator)
prev = deque(islice(it, n), n)
View translate_ine_projection.py
# returns latlng
def get_maxmin_latlon_region(region):
lon_max = -180
lon_min = 180
lat_max = -90
lat_min = 90
if region['type'] == 'Polygon':
for polygon in region['coordinates']:
for point in polygon: