Skip to content

Instantly share code, notes, and snippets.

View springmeyer's full-sized avatar

Dane Springmeyer springmeyer

View GitHub Profile
*** Running visual tests...
--------------------------------------------------------------------------------
Error: 904 different pixels
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Visual text rendering summary: Could not verify /tmp/mapnik-visual-images/lines-4-800-agg.png: No reference image found!
Could not verify /tmp/mapnik-visual-images/lines-4-600-agg.png: No reference image found!
Could not verify /tmp/mapnik-visual-images/lines-4-400-agg.png: No reference image found!
Could not verify /tmp/mapnik-visual-images/lines-4-200-agg.png: No reference image found!
Could not verify /tmp/mapnik-visual-images/lines-5-800-agg.png: No reference image found!
@springmeyer
springmeyer / millstone-status.txt
Created September 13, 2012 16:13
new millstone debug output in tilemill logs
~/projects/tilemill[master]$ rm -rf ~/Documents/MapBox/ && ./index.js
Note: Unknown option "updatesVersion" in config file.
Note: Unknown option "updatesTime" in config file.
Note: Unknown option "updates" in config file.
Note: Unknown option "profile" in config file.
[tilemill] Creating files dir /Users/dane/Documents/MapBox
[tilemill] Creating export dir /Users/dane/Documents/MapBox/export
[tilemill] Creating project dir /Users/dane/Documents/MapBox/project
[tilemill] Note: Unknown option "updatesVersion" in config file.
[tilemill] Note: Unknown option "updatesTime" in config file.
diff --git a/commands/global.bones b/commands/global.bones
index b411ea2..bb56b3b 100644
--- a/commands/global.bones
+++ b/commands/global.bones
@@ -32,5 +32,11 @@ Bones.Command.options['syncAccessToken'] = {
'default': defaults.syncAccessToken || ''
};
+Bones.Command.options['verbose'] = {
+ 'title': 'verbose=on|off',
@springmeyer
springmeyer / rint-ceil.cpp
Created September 5, 2012 18:21
compare cmath::rint and std::ceil
#include <cmath>
#include <iostream>
/*
clang++ -o rint-ceil rint-ceil.cpp;./rint-ceil
rint(1.11111): 1
ceil(1.11111): 2
rint(1.44444): 1
ceil(1.44444): 2
rint(1.5): 2
@springmeyer
springmeyer / extent.md
Created August 30, 2012 20:47
TileMill postgis extent widget

three drop downs:

button name / gray help text in input

  • Pre-Calculate / auto-calculate and cache the extent for this layer
  • Dynamic / for each map draw dynamically fetch the extent (can be slow)
  • Custom / Limit the drawing of the layer with a custom 'minx,miny,maxx,maxy' in the projection of the data

With Pre-Calculate the default. Dynamic would maintain the current TileMill 0.9.0 behavior, which hurts performance. Custom would be for advanced users that want to (ab)use this setting to actually limit large data. In the future we could make this option available for all datasources, not just postgis.

@springmeyer
springmeyer / geos-crash.txt
Created August 30, 2012 18:48
GEOS crash on 'POLYGON((-13707002 0, 10000000 2000000, 0 2000000, -13707002 0))' (more info: https://github.com/mapnik/mapnik/issues/1118)
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 libsystem_kernel.dylib 0x00007fff9308b82a __kill + 10
1 libsystem_c.dylib 0x00007fff8f491a9c abort + 177
2 libsystem_c.dylib 0x00007fff8f4c45de __assert_rtn + 146
3 libgeos-3.3.5.dylib 0x00000001121acb88 geos::geomgraph::PlanarGraph::linkResultDirectedEdges() + 232
4 libgeos-3.3.5.dylib 0x00000001121cfe64 geos::operation::valid::ConnectedInteriorTester::isInteriorsConnected() + 94
5 libgeos-3.3.5.dylib 0x00000001121d8c30 geos::operation::valid::IsValidOp::checkConnectedInteriors(geos::geomgraph::GeometryGraph&) + 34
6 libgeos-3.3.5.dylib 0x00000001121d81b9 geos::operation::valid::IsValidOp::checkValid(geos::geom::Polygon const*) + 233
7 libgeos-3.3.5.dylib 0x00000001121d7cf3 geos::operation::valid::IsValidOp::getValidationError() + 27
8 libgeos_c.1.dylib 0x000000011215c15f GEOSisValid_r + 87
@springmeyer
springmeyer / re-concoct.xml
Created August 27, 2012 19:37
Re-implement the visualization from https://github.com/shawnbot/concoct in one fell swoop using Mapnik 2.1
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE Map [
<!-- compositing mode: https://github.com/mapnik/mapnik/blob/master/include/mapnik/image_compositing.hpp#L42-79 -->
<!ENTITY comp_op "darken">
<!-- leave blank to render all data or set to some integer to render faster -->
<!ENTITY row_limit "">
<!-- size of marker ellipse -->
@springmeyer
springmeyer / mapnik-python-layer-access.py
Created August 23, 2012 16:51
Mapnik python example: load a map XML from a string and introspect the layers data
>>> import mapnik
>>> m = mapnik.Map(256,256)
>>> map_string = '''
... <Map>
... <Layer name="layer" srs="+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs">
... <Datasource>
... <Parameter name="inline">
... x,y,name
... 0,0,foo
... 1,1,foo
@springmeyer
springmeyer / install-mapnik-amazon-ami.sh
Last active January 6, 2024 15:06
Mapnik on Amazon Linux AMI (Fedora)
# http://aws.amazon.com/amazon-linux-ami/
# http://aws.amazon.com/amazon-linux-ami/faqs/
# Boot up a machine with at least 1.5 to 2 GB Ram
# login
chmod 600 key.pem
ssh -i key.pem ec2-user@ec2...compute.amazonaws.com
# update
@springmeyer
springmeyer / mapnik-reference-validate.py
Created August 21, 2012 02:27
look for omissions or inconsistencies in mapnik's python bindings using mapnik-reference
import mapnik
import json
reference = json.load(open('../mapnik-reference/2.1.0/reference.json', 'r'))
style = mapnik.Style()
for prop in reference['style'].items():
key = prop[0].replace('-','_')
assert hasattr(style,key), "'%s' not a valid property of Style" % key