Skip to content

Instantly share code, notes, and snippets.

View springmeyer's full-sized avatar

Dane Springmeyer springmeyer

View GitHub Profile
diff --git b/deps/agg/include/agg_span_image_filter_rgba.h a/deps/agg/include/agg_span_image_filter_rgba.h
index 134a802..77949f9 100644
--- b/deps/agg/include/agg_span_image_filter_rgba.h
+++ a/deps/agg/include/agg_span_image_filter_rgba.h
@@ -725,6 +725,7 @@ namespace agg
base_type::m_ry_inv) >>
image_subpixel_shift;
int total_weight = 0;
+ int total_weight_alpha = 0;
int x_lr = x >> image_subpixel_shift;
@springmeyer
springmeyer / custom_span_vs_agg24_orig.diff
Created May 24, 2012 20:56
customization to agg 2.4 span_image_resample_rgba_affine
diff --git a/include/mapnik/span_image_filter.hpp b/include/mapnik/span_image_filter.hpp
index e32b5a2..a4f8159 100644
--- a/include/mapnik/span_image_filter.hpp
+++ b/include/mapnik/span_image_filter.hpp
@@ -29,7 +29,7 @@ using namespace agg;
template<class Source>
class span_image_resample_rgba_affine :
- public span_image_resample_affine<Source>
@springmeyer
springmeyer / launchpad_stats.py
Created May 24, 2012 00:26
launchpad download stats for ppa package
# See https://api.launchpad.net/+apidoc/devel.html#binary_package_publishing_history
# See https://help.launchpad.net/API/launchpadlib
from launchpadlib.launchpad import Launchpad
import os
USERNAME='developmentseed'
PPA='mapbox'
PACKAGE='tilemill'
@springmeyer
springmeyer / boost-backporting-guide.md
Last active January 11, 2021 18:57
How to backport recent Boost packages to older ubuntu distro's and build using personal PPA

Boost backporting

Goal here is to document the steps I took in May 2012 to get Boost 1.49 packages backported and working on Lucid, Maverick, Natty, Oneiric, and Precise.

TODO: look into using ubuntu-dev-tools and backportpackage -s [new_release] -d [old_release] -u [ppa] [package_name]

Install dev tools

sudo apt-get install debhelper devscripts dput git-core python pgpgpg
@springmeyer
springmeyer / boost-deb-scripts-python.diff
Created May 23, 2012 18:46
patch boost 1.49 quantal debian scripts to work on lucid (dh_python2 -> pysupport)
diff --git a/debian/control b/debian/control
index 566426c..9bc8571 100644
--- a/debian/control
+++ b/debian/control
@@ -8,9 +8,11 @@ Uploaders: Steve M. Robbins <smr@debian.org>, Domenico Andreoli <cavok@debian.or
Build-Depends: debhelper (>= 8),
zlib1g-dev, libbz2-dev, libicu-dev,
bison, flex, docbook-to-man, help2man, xsltproc, doxygen,
- python, python-all-dev,
+ python-support (>= 0.6), python, python-all-dev,
@springmeyer
springmeyer / boost-deb-scripts.diff
Created May 23, 2012 01:07
diff between boost 1.45 package scripts (svn://svn.debian.org/svn/pkg-boost/boost/tags/1.45.0-1) and trunk (svn://svn.debian.org/svn/pkg-boost/boost/trunk) (for 1.49)
Common subdirectories: 1.45.0-1/debian/.svn and boost/trunk/debian/.svn
diff -u 1.45.0-1/debian/NEWS.Debian boost/trunk/debian/NEWS.Debian
--- 1.45.0-1/debian/NEWS.Debian 2012-05-22 18:03:49.000000000 -0700
+++ boost/trunk/debian/NEWS.Debian 2012-05-22 18:02:59.000000000 -0700
@@ -1,3 +1,11 @@
+boost1.46 (1.46.1-3) unstable; urgency=low
+
+ Boost.Build and bjam now ship in the main -dev package (currently
+ libboost1.46-dev). Packages boost-build and bjam are obsolete and to
+ be removed from the archive.
src/image_compositing.cpp:105:27: error: no matching constructor for initialization of
'agg::rendering_buffer' (aka 'row_ptr_cache<int8u>')
agg::rendering_buffer mask(im2.getBytes(),im2.width(),im2.height(),im2.width() * 4);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/image_compositing.cpp:112:15: note: in instantiation of function template specialization
'mapnik::composite<mapnik::ImageData<unsigned int>, mapnik::ImageData<unsigned int> >' requested here
template void composite<mapnik::image_data_32,mapnik::image_data_32>(mapnik::image_data_32&,...
^
deps/agg/include/agg_rendering_buffer.h:158:9: note: candidate constructor not viable: 1st argument
('const unsigned char *') would lose const qualifier
@springmeyer
springmeyer / extent-tokenizer.py
Created May 17, 2012 22:49
test mapnik's tokenization of extent strings
>>> mapnik.PostGIS(dbname='haiti',table='(select * from planet_osm_line limit 3) as t',extent='1 2 3 4').envelope()
Box2d(1.0,2.0,3.0,4.0)
>>> mapnik.PostGIS(dbname='haiti',table='(select * from planet_osm_line limit 3) as t',extent='1 2,3 4').envelope()
Box2d(1.0,2.0,3.0,4.0)
>>> mapnik.PostGIS(dbname='haiti',table='(select * from planet_osm_line limit 3) as t',extent='1,2,3,4').envelope()
Box2d(1.0,2.0,3.0,4.0)
>>> mapnik.PostGIS(dbname='haiti',table='(select * from planet_osm_line limit 3) as t',extent='1 2 3 4').envelope()
Box2d(1.0,2.0,3.0,4.0)
$ clang++ -o src/load_map.os -c -DHAVE_JPEG -ansi -Wall -ftemplate-depth-300 -DDARWIN -DBOOST_SPIRIT_THREADSAFE -
airomm/1.10.0/include/cairomm-1.0 -I/usr/local/Cellar/cairomm/1.10.0/lib/cairomm-1.0/include -I/usr/local/Cellar/libsigc++/2.2.10/include/sigc++-2.0 -I/usr/local/Cellar/libsigc++/2.2.10/lib/sigc++-2.0/include -I/usr/local/Cellar/pixman/0.24.4/include/pixman-1 -I/usr/X11/include/cairo -I/usr/X11/include/libpng15 -Ideps/agg/include -I. -Iinclude -I/opt/boost-45/include -I/usr/local/Cellar/postgresql/9.1.3/include -I/usr/local/Cellar/geos/3.3.3/include -I/usr/local/Cellar/gdal/1.9.0/include -I/usr/local/Cellar/icu4c/4.8.1.1/include -I/usr/local/include -I/usr/include
In file included from src/load_map.cpp:26:
In file included from include/mapnik/load_map.hpp:27:
In file included from include/mapnik/map.hpp:28:
In file included from include/mapnik/feature_type_style.hpp:27:
In file included from include/mapnik/rule.hpp:27:
In file included from include/mapnik/building_symbolizer.hpp:28:
In file includ
/opt/boost-42/include/boost/spirit/home/support/attributes.hpp: In static member function ‘static Transformed boost::spirit::traits::transform_attribute<Exposed, Transformed, Enable>::pre(Exposed&) [with Exposed = boost::variant<mapnik::filter::blur, mapnik::filter::gray, mapnik::filter::agg_stack_blur, mapnik::filter::emboss, mapnik::filter::sharpen, mapnik::filter::edge_detect, mapnik::filter::sobel, mapnik::filter::x_gradient, mapnik::filter::y_gradient, mapnik::filter::invert, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_>, Transformed = std::vector<boost::variant<mapnik::filter::blur, mapnik::filter::gray, mapnik::filter::agg_stack_blur, mapnik::filter::emboss, mapnik::filter::sharpen, mapnik::filter::edge_detect, mapnik::filter::sobel, mapnik::f