Skip to content

Instantly share code, notes, and snippets.

View aaronlidman's full-sized avatar

Aaron Lidman aaronlidman

View GitHub Profile
#!/bin/bash
# This script is for exporting MBTiles directly to your Mapbox account.
# Requires a Mapbox account with sufficient storage for your tiles and
# authorized with your TileMill 0.10.0 install.
# Note that the maximum file transfer size is 5GB.
# Adapted from https://gist.github.com/springmeyer/7875415.
# Settings: edit these as needed
PROJECT_NAME="geography-class" # the folder name in your /project directory
OUTPUT_DIRECTORY="~/Documents/MapBox/export/"

Native OS X OpenStreetMap editing app

Reasoning

Prompted by:

Who wants to write a Mac-native OSM editor with me?

— Ian Dees (@iandees) February 9, 2014
<script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>

And a few more key followups:

@emacsen
emacsen / mb2s3.py
Created May 1, 2011 21:16
First rough cut at an mbtiles to s3 uploader. Needs work
#!/usr/bin/env python
"""Script to upload contents of an mbtile to an s3 storage bucket"""
from boto.s3.connection import S3Connection
import sqlite3
import sys
import os
import progressbar
import threading
@xarg
xarg / dp.py
Created June 28, 2011 14:31
Douglas-Peucker
# pure-Python Douglas-Peucker line simplification/generalization
#
# this code was written by Schuyler Erle <schuyler@nocat.net> and is
# made available in the public domain.
#
# the code was ported from a freely-licensed example at
# http://www.3dsoftware.com/Cartography/Programming/PolyLineReduction/
#
# the original page is no longer available, but is mirrored at
# http://www.mappinghacks.com/code/PolyLineReduction/
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Simple script to create geojson from osm files.
Prints geojson features line by line.
Currently we don't support relations.
Requires (unmodified) imposm and imposm.parser
Inspired by https://github.com/emka/OSMCouch
'''
@GothAck
GothAck / index.js
Created March 20, 2012 18:33
Parsing BIG compressed XML data (OpenStreetMap) with Node.js
#!/usr/bin/env node
/*
* Parsing BIG compressed data with Node.js and SAX
* Probably some bugs, but worked fine for OpenStreetMap Great Britain bz2
* Greg Miell 2012
*/
// Simple string trim prototype extension
String.prototype.trim = function() {
@emacsen
emacsen / pyxbot.py
Created May 11, 2012 00:15
OSM Tiger expansion code
from xml.sax.handler import ContentHandler
import os
import codecs
from xml.sax.saxutils import escape
class OSMHandler(ContentHandler):
"""This is a base OSMHandler class which sets up the XML parsing, etc.
You will want to override the selectElement and transformElement
functions"""
@tmcw
tmcw / README.md
Created June 20, 2013 14:51
Gist Backup

Back up your gists: update YOUR_USERNAME and YOUR_PASSWORD and run it. Requires

sudo pip install requests

I use this mainly to be able to quickly search through my thousands of Gists with a tool like ack or ag.

@ian29
ian29 / macpg.sh
Last active December 21, 2015 22:49
easiest way to install postgres (and postgis) on mac os x
# !/bin/bash
# make sure homebrew is up-to-date and install some stuff
brew update
brew install postgres || brew upgrade postgres
brew install postgis || brew upgrade postgis
# if you dont have brew on your path yet
echo "export PATH=/usr/local/bin:$PATH" >> ~/.bash_profile
source ~/.bash_profile
@tmcw
tmcw / hexer.md
Last active December 28, 2015 03:38
Hexer is Cool

hexer is cool. It's a new project by Howard Butler that makes hexagon binned files out of point files.

Building hexer

This worked on my system (OSX 10.9, git via homebrew)

git clone https://github.com/hobu/hexer.git