Skip to content

Instantly share code, notes, and snippets.

View iandees's full-sized avatar
🏠
Working from home

Ian Dees iandees

🏠
Working from home
View GitHub Profile
@iandees
iandees / detect_osm_weirdness.py
Created June 3, 2011 22:05
An OSM "weirdness" detector: Reads minutely/hourly diffs and looks for oddly-shaped ways or ways that don't quite make sense.
#!/bin/python
import sys
import urllib2
import xml.etree.cElementTree as ElementTree
import simplejson as json
from datetime import datetime
import StringIO
import gzip
import time
@iandees
iandees / gist:1215596
Created September 14, 2011 00:53
A script to keep an osm2pgsql database running with minutely diffs and osmosis.
#!/bin/bash
set -e
# Initialize timestamp with day of latest planet dump
# Setting to midnight ensures we get conistent data after first run
# osmosis --read-replication-interval-init
OSMOSIS_PATH=/home/iandees/osmosis-SNAPSHOT-r25995
OSMOSIS_WORKDIR=/home/iandees/.osmosis
OSM2PGSQL_PATH=/home/iandees/osm2pgsql
@iandees
iandees / expire_tiles.py
Created October 8, 2011 03:23
A tool to parse the OSM API's list of expired z12 tiles and delete the corresponding tiles in a TileStache disk cache.
#!/bin/python
import sys
import xml.etree.cElementTree as ET
import urllib2
# Expire tiles in a TileStache default file cache based on the OpenStreetMap server's z12 change output
# at http://www.openstreetmap.org/api/0.6/changes
maxZoom = 19
iandees@benzene:~/tilemill$ mapnik-config --libs
-L/usr/local/lib -lmapnik2
iandees@benzene:~/tilemill$ which mapnik-config
/usr/local/bin/mapnik-config
@iandees
iandees / buffer.txt
Created July 12, 2012 13:34
New user log
INFO 2012-07-12T07:02:25 Looking for new users.
ERROR 2012-07-12T07:02:26 Traceback (most recent call last):
File "/home/iandees/supybot/plugins/OSM/plugin.py", line 187, in _minutely_diff_poll
content = urllib2.urlopen(url)
File "/usr/lib/python2.6/urllib2.py", line 126, in urlopen
return _opener.open(url, data, timeout)
File "/usr/lib/python2.6/urllib2.py", line 397, in open
response = meth(req, response)
File "/usr/lib/python2.6/urllib2.py", line 510, in http_response
'http', request, response, code, msg, hdrs)

Learn How to Use OpenStreetMap US Resources

Join us for a 1 hour virtual workshop on how to use OpenStreetMap US server resources.

OpenStreetMap US provides a series of server resources to the OpenStreetMap community free of charge. You can use these servers for jobs that are too large or too long running for your local machine and for cooperating with other community members.

You can see a full list of our servers on our Wiki. These servers offer the following:

  • Full, hourly updated copy of the OpenStreetMap rendering database
  • Latest Mapnik installed and the ability to render and cache arbitrary tile sets
Type Code Expanded Full Text Display Name Abbreviation Spanish Translation Prefix Type Suffix Type
103 Academy Acdmy Y Y
104 Acueducto Acueducto Yes Aqueduct Y N
105 Aeropuerto Aero Yes Airport Y N
106 Air Force Base AFB N Y
107 Airfield Airfield N Y
108 Airpark Airpark N Y
109 Airport Arprt N Y
110 Airstrip Airstrip N Y
112 Alley Aly N Y
// Load data tiles from an AJAX data source
L.TileLayer.Ajax = L.TileLayer.extend({
_requests: [],
_addTile: function (tilePoint) {
var tile = { datum: null, processed: false };
this._tiles[tilePoint.x + ':' + tilePoint.y] = tile;
this._loadTile(tile, tilePoint);
},
// XMLHttpRequest handler; closure over the XHR object, the layer, and the tile
_xhrHandler: function (req, layer, tile, tilePoint) {
Congressional District FIPS Code is adjacent to
2707 2702
2707 2706
2707 2708
2707 2701
2707 3800
2707 4600
2702 2707
2702 2706
2702 2701

Keybase proof

I hereby claim:

  • I am iandees on github.
  • I am iandees (https://keybase.io/iandees) on keybase.
  • I have a public key whose fingerprint is F495 5459 BF3B D7D7 D1EB EC9C 9F02 C910 B63D 7E05

To claim this, I am signing this object: