Skip to content

Instantly share code, notes, and snippets.

View springmeyer's full-sized avatar

Dane Springmeyer springmeyer

View GitHub Profile
@springmeyer
springmeyer / osm-carto-out.diff
Created December 21, 2012 18:44
minor differences of openstreetmap-carto between carto master and condense branch
--- osm-carto-master.xml 2012-12-21 10:41:57.000000000 -0800
+++ osm-carto-condense.xml 2012-12-21 10:36:55.000000000 -0800
@@ -12543,7 +12543,7 @@
<Style name="amenity-symbols-power" filter-mode="first" >
<Rule>
<MaxScaleDenominator>25000</MaxScaleDenominator>
- <Filter>([power] = 'generator') and ([generator:source] = 'wind')</Filter>
+ <Filter>([power] = 'generator') and (generator:source = 'wind')</Filter>
<PointSymbolizer file="symbols/power_wind.png" placement="interior" />
</Rule>
@springmeyer
springmeyer / image.md
Created December 21, 2012 01:01
test mapniks ability to prevent text placed along lines from overlapping other text
We couldn’t find that file to show.
<Style name="landcover" filter-mode="first" >
</Style>
<Style name="landcover-highway" filter-mode="first" >
<Rule>
<MaxScaleDenominator>50000</MaxScaleDenominator>
<Filter>([highway] = 'rest_area')</Filter>
<PolygonSymbolizer fill="#efc8c8" />
</Rule>
<Rule>
<MaxScaleDenominator>50000</MaxScaleDenominator>
//-- starting rendering timer...
0.04ms (cpu 0.04ms) | rendering total for layer: 'world'
22.00ms (cpu 21.99ms) | rendering style for layer: 'coast-poly' and style 'coast-poly'
percent rendered: 100% - 2 rendered for 2 queried for layer 'coast-poly' and style 'coast-poly'
22.96ms (cpu 22.96ms) | rendering total for layer: 'coast-poly'
notice: reprojecting layer: 'builtup' from/to:
'+proj=merc +datum=WGS84 +over'
'+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over'
0.14ms (cpu 0.14ms) | rendering total for layer: 'builtup'
//-- starting rendering timer...
0.04ms (cpu 0.04ms) | rendering total for layer: 'world'
21.99ms (cpu 21.98ms) | rendering style for layer: 'coast-poly' and style 'coast-poly'
percent rendered: 100% - 2 rendered for 2 queried for layer 'coast-poly' and style 'coast-poly'
22.94ms (cpu 22.94ms) | rendering total for layer: 'coast-poly'
notice: reprojecting layer: 'builtup' from/to:
'+proj=merc +datum=WGS84 +over'
'+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs +over'
0.14ms (cpu 0.13ms) | rendering total for layer: 'builtup'
@springmeyer
springmeyer / bbox2csv.py
Created December 14, 2012 21:20
Convert bbox to polygon and encode as geo csv for TileMill
#!/usr/bin/env python
'''
Usage:
# edit the script below "main" then:
python bbox2csv.py > bounds.csv
'''
def bbox2wkt(minx, miny, maxx, maxy):
@springmeyer
springmeyer / clang-rebuild.sh
Last active October 14, 2015 00:27
clang install/rebuild notes
# current method:
rm -rf /opt/llvm/
make clean && git pull
cd tools/clang
make clean && git pull
cd tools/clang-tools-extra
make clean && git pull
cd ../include-what-you-use
make clean && svn up
@springmeyer
springmeyer / install-carto.sh
Created December 13, 2012 03:39
Install Carto.js (CartoCSS compiler written in Javascript) to use from the command line on OS X
# First install the latest version of Node.js if you don't already have node.js v0.8.x
# WARNING: do not use the .pkg installer for node. A bug in the installer will break
# later installs causing errors like "no suitable image found. Did find: /path/to/some/lib: mach-o, but wrong architecture"
# install node either from source or from homebrew. Here we use homebrew:
brew install node
# Then make sure /usr/local/bin is on your PATH
export PATH=/usr/local/bin:$PATH
@springmeyer
springmeyer / faster-trim.cpp
Created December 7, 2012 20:21
benchmark of std::string trim
#include <iostream>
#include <algorithm>
#include <functional>
#include <cctype>
#include <locale>
#define BOOST_CHRONO_HEADER_ONLY
#include <boost/chrono/process_cpu_clocks.hpp>
#include <boost/chrono.hpp>
#include <boost/thread/thread.hpp>
@springmeyer
springmeyer / dot-density-points.diff
Created December 6, 2012 04:42
Messing around with using halton sequences for quasi-random point filling of polygons (applied to mapnik @ ff8f3f1d4597eed89e04aa1dc7cb4755f6d4a744)
diff --git a/src/agg/process_point_symbolizer.cpp b/src/agg/process_point_symbolizer.cpp
index 6854903..abf1972 100644
--- a/src/agg/process_point_symbolizer.cpp
+++ b/src/agg/process_point_symbolizer.cpp
@@ -40,8 +40,58 @@
// boost
#include <boost/make_shared.hpp>
+#include <boost/utility.hpp>
+