Skip to content

Instantly share code, notes, and snippets.

View springmeyer's full-sized avatar

Dane Springmeyer springmeyer

View GitHub Profile
@springmeyer
springmeyer / README.md
Last active August 29, 2015 14:00
tilelive-overlay benchmark

Setup

npm install

Running

node bench.js 10 100

@springmeyer
springmeyer / campus-maps.md
Last active November 6, 2018 03:29
Campus Map Technology
@springmeyer
springmeyer / index.html
Created April 17, 2014 20:23
Example of how to use a MapBox map id to overlay a tileset generated in TileMill on top of a Stamen basemap
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>External Layers</title>
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no' />
<script src='https://api.tiles.mapbox.com/mapbox.js/v1.6.2/mapbox.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox.js/v1.6.2/mapbox.css' rel='stylesheet' />
@springmeyer
springmeyer / README.md
Last active August 29, 2015 13:58
OpenFileGDB rendering with SetSpatialFilterRect

Bug description

When reading from the cdfadmin13_1_unit layer of cdfadmin13_1.gdb with OpenFileGDB driver and setting a SetSpatialFilterRect from Mapnik I'm seeing not all shapes returned. The incorrect.png demostrates this. It should be a solid red color, but instead some polygons are missing and the shapefile underneath renders green and shows through.

Data from: http://frap.cdf.ca.gov/data/statewide/cdfadmin13_1.zip downloaded from http://frap.cdf.ca.gov/data/frapgisdata-sw-cdfadmin13_1_download.php

I found:

  • disabling SetSpatialFilterRect works around the problem (produces no_filter.png below)
@springmeyer
springmeyer / mocha-early-exit.txt
Created April 10, 2014 13:43
mocha forced exit causing mapnik threadpool crash
Process: node [44234]
Path: /Users/USER/*/node
Identifier: node
Version: ???
Code Type: X86-64 (Native)
Parent Process: node [44233]
Responsible: Terminal [16998]
User ID: 501
Date/Time: 2014-04-10 09:18:45.498 -0400
@springmeyer
springmeyer / map.xml
Last active August 29, 2015 13:58
angled text in mapnik testcase
<Map srs="+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs">
<Style name="ellipse">
<Rule>
<MarkersSymbolizer
width="240"
height="240"
fill="steelblue"
fill-opacity=".7"
stroke="yellow"
stroke-width="16"
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
@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)
@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 / 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