Skip to content

Instantly share code, notes, and snippets.

View springmeyer's full-sized avatar

Dane Springmeyer springmeyer

View GitHub Profile
$ git checkout v0.4.0
Note: checking out 'v0.4.0'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:
@springmeyer
springmeyer / gist:1125844
Created August 4, 2011 18:26
hello cairo kitchen sink
./configure \
--enable-pdf=yes \
--enable-ft=yes \
--enable-svg=no \
--enable-ps=no \
--enable-fc=no \
--enable-png=no \
--enable-gtk-doc=no \
--enable-qt=no \
--enable-quartz=no \
Creating files dir /Users/jmarlow/Documents/MapBox
Creating export dir /Users/jmarlow/Documents/MapBox/export
Creating project dir /Users/jmarlow/Documents/MapBox/project
Creating data dir /Users/jmarlow/Documents/MapBox/data
Creating cache dir /Users/jmarlow/Documents/MapBox/cache
Creating cache/tile dir /Users/jmarlow/Documents/MapBox/cache/tile
Started [Server Core:8889].
Error: Shape Plugin: error no attribute by the name of 'COUNTRY', available attributes are: 'ScaleRank' 'LabelRank' 'Z_POSTAL' 'Z_ABBREV' 'Z_NAME' 'Z_ADMIN' 'FeatureCla' 'SOVEREIGNT' 'SOV_A3' 'ADM0_DIF' 'LEVEL' 'TYPE' 'ADMIN' 'ADM0_A3' 'GEOU_DIF' 'NAME' 'ABBREV' 'POSTAL' 'NAME_FORMA' 'TERR_' 'NAME_SORT' 'MAP_COLOR' 'POP_EST' 'GDP_MD_EST' 'FIPS_10_' 'ISO_A2' 'ISO_A3' 'ISO_N3'
npm ERR! registry error parsing json
npm ERR! Error sending version data
npm ERR! SyntaxError: Unexpected token ILLEGAL
npm ERR! <html><title>Request timeout</title><body><h1>Request timeout</h1></body></html>
npm ERR! at Object.parse (native)
npm ERR! at IncomingMessage.<anonymous> (/Users/dane/.nvm/v0.4.9/lib/node_modules/npm/lib/utils/npm-registry-client/request.js:163:25)
npm ERR! at IncomingMessage.emit (events.js:81:20)
npm ERR! at HTTPParser.onMessageComplete (http.js:133:23)
npm ERR! at CleartextStream.ondata (http.js:1227:22)
npm ERR! at CleartextStream._push (tls.js:303:27)
@springmeyer
springmeyer / test.c
Created July 28, 2011 17:18
test atof conversion of string to double
#include <stdlib.h>
#include <stdio.h>
/* test:
gcc -o test test.c
./test
0.000000
*/
int main(int argc, char **argv)
(node) warning: possible EventEmitter memory leak detected. 11 listeners added. Use emitter.setMaxListeners() to increase limit.
Trace:
at MapnikSource.<anonymous> (events.js:126:17)
at MapnikSource.once (events.js:147:8)
at new MapnikSource (/Users/dane/projects/tilemill-04/node_modules/tilelive-mapnik/lib/mapnik.js:34:16)
at Object.load (/Users/dane/projects/tilemill-04/node_modules/tilelive/lib/tilelive.js:95:19)
at /Users/dane/projects/tilemill-04/models/Datasource.server.bones:51:14
at [object Object].fetch (/Users/dane/projects/tilemill-04/node_modules/bones/node_modules/backbone/backbone.js:249:34)
at [object Object].<anonymous> (/Users/dane/projects/tilemill-04/node_modules/bones/servers/Route.bones:115:15)
at Router.<anonymous> (native)
@springmeyer
springmeyer / mapnik_proj_test.py
Created July 21, 2011 21:19
test various exotic projections with mapnik and osm data
#!/usr/bin/python
import mapnik2 as mapnik
#mapfile = "tests/data/good_maps/bounds_clipping.xml"
mapfile = "/Users/dane/src/osm_mapnik3/osm2.xml"
projections = {
"latlon": "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs", #EPSG:4326
"google": "+proj=merc +lon_0=0 +lat_ts=0 +x_0=0 +y_0=0 +a=6378137 +b=6378137 +units=m +no_defs", # SR-ORG:95
"mercator_world": "+proj=merc +lon_0=0 +k=1 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs", # SR-ORG:16
<?xml version="1.0" encoding="utf-8"?>
<Map srs="+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs">
<Layer name="land0" srs="+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs"/>
<Layer name="borders0" srs="+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs"/>
<Layer name="places0" srs="+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs"/>
<Layer name="land1" srs="+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs"/>
<Layer name="borders1" srs="+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs"/>
<Layer name="places1" srs="+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs"/>
<Layer name="land2" srs="+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs"/>
<Layer name="borders2" srs="+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs"/>
LAYER
TYPE POLYGON
STATUS ON
PROJECTION
"init=epsg:900913"
END
NAME "waterarea7"
GROUP "default"
CONNECTIONTYPE POSTGIS
CONNECTION "host=localhost dbname=osm user=postgres password=postgres port=5432"
@springmeyer
springmeyer / gist:1095107
Created July 20, 2011 14:50
mapserver crash
Python 2.6.1 (r261:67515, Jun 24 2010, 21:47:49)
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import mapscript
>>> m = mapscript.mapObj('../mapserver/osm-google.map')
>>> sld = m.generateSLD()
Abort trap
-------------