Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@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"
@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 / 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 / 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 14:00
tilelive-overlay benchmark

Setup

npm install

Running

node bench.js 10 100

@springmeyer
springmeyer / homebrew-clang.txt
Created May 9, 2014 14:42
llvm/clang 35 homebrew build failure
This file has been truncated, but you can view the full file.
~$ brew install llvm35 --HEAD --with-clang --with-asan --rtti --disable-assertions --without-python --all-targets --verbose
==> Cloning http://llvm.org/git/llvm.git
git --git-dir /Library/Caches/Homebrew/llvm35--git/.git status -s
Updating /Library/Caches/Homebrew/llvm35--git
git config remote.origin.url http://llvm.org/git/llvm.git
git config remote.origin.fetch +refs/heads/master:refs/remotes/origin/master
git fetch origin
remote: Counting objects: 40, done.
@springmeyer
springmeyer / README.md
Last active August 29, 2015 14:01
llvm/clang crash when using -flto together with -g

Just build clang from trunk on OS X 10.9.2 like this:

git clone http://llvm.org/git/llvm.git
cd llvm/tools
git clone http://llvm.org/git/clang.git
cd ../
cd ./projects
git clone http://llvm.org/git/compiler-rt.git
cd ../
$ ./benchmark/out/test_array_allocation --threads 10 --iterations 10000
calloc: t:10 i:10000 1620 milliseconds
malloc/memcpy: t:10 i:10000 1610 milliseconds
malloc/memset: t:10 i:10000 2360 milliseconds
new: t:10 i:10000 2000 milliseconds
vector(N): t:10 i:10000 5900 milliseconds
vector/resize: t:10 i:10000 4240 milliseconds
vector/assign: t:10 i:10000 5950 milliseconds
std::string range: t:10 i:10000 3110 milliseconds
std::string &[0]: t:10 i:10000 1680 milliseconds
@springmeyer
springmeyer / mapnik-plugin.diff
Created May 16, 2014 22:50
atexit OGRCleanupAll() and GDALDestroyDriverManager()
diff --git a/plugins/input/gdal/gdal_datasource.cpp b/plugins/input/gdal/gdal_datasource.cpp
index 78ca37a..866057e 100644
--- a/plugins/input/gdal/gdal_datasource.cpp
+++ b/plugins/input/gdal/gdal_datasource.cpp
@@ -44,7 +44,13 @@ using mapnik::featureset_ptr;
using mapnik::layer_descriptor;
using mapnik::datasource_exception;
+void atexit_handler_1()
+{
~/mapnik-packaging/node-mapnik$ valgrind --num-callers=40 node ./node_modules/.bin/_mocha test/vector-tile.test.js
==1320== Memcheck, a memory error detector
==1320== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==1320== Using Valgrind-3.10.0.SVN and LibVEX; rerun with -h for copyright info
==1320== Command: node ./node_modules/.bin/_mocha test/vector-tile.test.js
==1320==
==1320== Warning: set address range perms: large range [0x1566ba9c2000, 0x1566da9c2000) (noaccess)