Skip to content

Instantly share code, notes, and snippets.

View jeffaudi's full-sized avatar

Jeff Faudi jeffaudi

View GitHub Profile
var isoCountries = {
'AF' : 'Afghanistan',
'AX' : 'Aland Islands',
'AL' : 'Albania',
'DZ' : 'Algeria',
'AS' : 'American Samoa',
'AD' : 'Andorra',
'AO' : 'Angola',
'AI' : 'Anguilla',
'AQ' : 'Antarctica',
@jeffaudi
jeffaudi / bucket_upload.py
Created January 2, 2015 22:47
This python script use threads to upload files to S3. The number of threads is configurable. It should be used when a huge number of files needs to be uploaded (millions). This is typically the case for TileCache i.e. GoogleMaps background. The Amazon AWS credentials should be passed in the command line or included in a configuration file main.cfg.
#!/usr/bin/env python
#
# Copyright 2014 Jeff Faudi.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
@jeffaudi
jeffaudi / shapefile.py
Created October 12, 2014 20:12
This is just a slight modification of the pyshp python library. It enables to read and convert files where STRING are stored instead of NUMBER. Instead of failing, this script will log an error message and replace the value by 0.0
"""
shapefile.py
Provides read and write support for ESRI Shapefiles.
author: jlawhead<at>geospatialpython.com
date: 20130727
version: 1.2.0
Compatible with Python versions 2.4-3.x
"""
__version__ = "1.2.0"
@jeffaudi
jeffaudi / gdal2tilesG.py
Last active March 17, 2023 10:14
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
@jeffaudi
jeffaudi / tumblr-likes-downloader.py
Last active June 15, 2022 01:25
This python script downloads all the photos liked of your tumblr account. This is usually more useful than downloading the photos from a specfic blog. Updated to also download videos and store content is folders. Please, note that currently the Tumblr API only returns the first 1000 likes (https://groups.google.com/forum/#!searchin/tumblr-api/li…
import pytumblr
import os
import code
import oauth2 as oauth
from pprint import pprint
import json
import urllib
import codecs
# Number of likes to fetch in one request
@jeffaudi
jeffaudi / get_meta.py
Last active December 30, 2017 18:23
This python script uses the Airbus Geo Catalog API to retrieve the meta-data associated to a list of imagery identifiers
# Script : get_meta.py
# Source : https://gist.github.com/jeffaudi/9fcac727cf6251287ecc/
# Copyright (c) 2014, Jeff Faudi
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.