Skip to content

Instantly share code, notes, and snippets.

@springmeyer
springmeyer / node-mapnik-install.md
Created February 12, 2014 18:41
testing node-mapnik install via node-pre-gyp binaries

install protoc

For now you still need the protobuf depedency installed.

For OS X do:

brew install protobuf

The protoc command should then be on your path.

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@springmeyer
springmeyer / gist:9630512
Created March 18, 2014 21:51
g++4.8 / gdal warning
/home/ubuntu/mapnik-packaging/osx/out/build-cpp11-libstdcpp-gcc-x86_64/lib/libgdal.a(cpl_minixml.o): In function `_ZL19CPLSerializeXMLNodePK10CPLXMLNodeiPPcPjS4_.constprop.4':
cpl_minixml.cpp:(.text+0xf57): warning: memset used with constant zero length parameter; this could be due to transposed parameters
@springmeyer
springmeyer / gist:9675127
Created March 20, 2014 22:16
libosmium osm-testdata output
./testdata-multipolygon ../../../osm-testdata/grid/data/all.osm
Pass 1...
relations: 57
node members: 0
way members: 136
relation members: 0
Pass 1 done
Pass 2...
Build relation id()=701900 members.size()=2 segments.size()=4
@springmeyer
springmeyer / 14_10083_6161.vector.pbf.z
Last active August 29, 2015 13:57
AGG line-join:round triangle artifacts bug testcase
diff --git a/deps/agg/include/agg_math_stroke.h b/deps/agg/include/agg_math_stroke.h
index 4806dcd..7ba45f6 100644
--- a/deps/agg/include/agg_math_stroke.h
+++ b/deps/agg/include/agg_math_stroke.h
@@ -22,6 +22,7 @@
#include "agg_math.h"
#include "agg_vertex_sequence.h"
+#include <mapnik/debug.hpp>
@springmeyer
springmeyer / agg_vcgen_stroke.cpp.diff
Created March 22, 2014 02:08
agg_vcgen_stroke.cpp diff to avoid bogus line joins from numerical instability with nearly collinear segments (https://github.com/mapnik/mapnik/issues/2186)
diff --git a/deps/agg/src/agg_vcgen_stroke.cpp b/deps/agg/src/agg_vcgen_stroke.cpp
index 3ee336f..f00014f 100644
--- a/deps/agg/src/agg_vcgen_stroke.cpp
+++ b/deps/agg/src/agg_vcgen_stroke.cpp
@@ -20,6 +20,7 @@
#include "agg_vcgen_stroke.h"
#include "agg_shorten_path.h"
+const static double eps = 1e-2;
namespace agg
@springmeyer
springmeyer / README.md
Last active August 29, 2015 13:57
numerical instability in collinear segments

Results in a massive dx2 value which breaks return values for dx and dy:

Output is:

$ ./calc-intersection-test
m_width * (v1.y - v0.y): 0.200000000023408
m_width * (v2.y - v1.y): 0.300000000000018
dx2: 9771986970684.640625000000000

1 9771986970692.2246093750000000 8934388088183.3027343750000000

@springmeyer
springmeyer / failures.txt
Created April 1, 2014 03:38
visual test failures with mapnik 2.3.x and 'vertex_dist_epsilon:1e-5' https://github.com/mapnik/mapnik/issues/2196
Visual rendering: 19 failed / 776 passed
1) 1104 different pixels:
/tmp/mapnik-visual-images/image-filters-multi-blur-inflate-512-512-1.0-agg.png (actual)
tests/visual_tests/images/image-filters-multi-blur-inflate-512-512-1.0-agg-reference.png (expected)
2) 180 different pixels:
/tmp/mapnik-visual-images/image-filters-multi-blur-inflate-512-512-2.0-agg.png (actual)
tests/visual_tests/images/image-filters-multi-blur-inflate-512-512-2.0-agg-reference.png (expected)
3) 68 different pixels:
/tmp/mapnik-visual-images/lines-5-800-800-1.0-agg.png (actual)
tests/visual_tests/images/lines-5-800-800-1.0-agg-reference.png (expected)
Process: Python [10242]
Path: /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
Identifier: Python
Version: 2.7.5 (2.7.5)
Code Type: X86-64 (Native)
Parent Process: sh [10221]
Responsible: Terminal [78893]
User ID: 501
PlugIn Path: /opt/mapnik/*/_mapnik.so