Skip to content

Instantly share code, notes, and snippets.

View springmeyer's full-sized avatar

Dane Springmeyer springmeyer

View GitHub Profile
@springmeyer
springmeyer / osr_osx.diff
Created January 17, 2011 20:33
patch to compile libosr on os x
Index: ogr/GNUmakefile
===================================================================
--- ogr/GNUmakefile (revision 21433)
+++ ogr/GNUmakefile (working copy)
@@ -18,4 +18,5 @@
$(LIB): $(OBJ)
rm -f $(LIB)
$(AR) rc $(LIB) $(OBJ)
+ ranlib $(LIB)
@springmeyer
springmeyer / mapnik_pg_test.sql
Created January 8, 2011 00:47
benefit to having !bbox! query manually placed inside subselect beside other WHERE?
/* (SELECT * FROM polygons9 WHERE iucn_category_id = 2) AS GEOM */
tiledb=# explain analyze SELECT AsBinary("the_geom") AS geom from
(SELECT * FROM polygons9 WHERE iucn_category_id = 2) AS GEOM
WHERE "the_geom" && SetSRID('BOX3D(-20037510 2505758.018505042,60267.60323439911 8276874.507094959)'::box3d, 900913);
QUERY PLAN
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Bitmap Heap Scan on polygons9 (cost=19.85..264.07 rows=8 width=93117) (actual time=1.173..2.883 rows=21 loops=1)
Recheck Cond: (the_geom && '010300002031BF0D00010000000500000000000060F81B73C18B5F5E020F1E434100000060F81B
map.describe_data()
{ world:
{ type: 'vector',
extent:
[ -20037508.342789248,
-8283343.693882697,
20037508.342789244,
18365151.363070473 ],
encoding: 'utf-8',
@springmeyer
springmeyer / node-mapnik json.js
Created January 7, 2011 19:35
node-mapnik inspection outputs
map.layers() // all layers
[ { name: 'world',
srs: '+proj=merc +lon_0=0 +lat_ts=0 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs',
styles: [ 'style' ],
datasource:
{ file: './examples/data/world_merc.shp',
type: 'shape' } } ]
$ cd node-mapnik
$ for VER in {"0.2.4","0.2.5","0.2.6","0.3.0","0.3.1","0.3.2","0.3.3","0.3.4"}
> do ../../sources/node$VER/bin/node test.js
> done
importing ./0.2.4/_mapnik.node
All tests pass...
importing ./0.2.5/_mapnik.node
All tests pass...
importing ./0.2.6/_mapnik.node
All tests pass...
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Application Specific Information:
abort() called
Thread 0 Crashed: Dispatch queue: com.apple.main-thread
0 libSystem.B.dylib 0x00007fff8062f616 __kill + 10
1 libSystem.B.dylib 0x00007fff806cfcca abort + 83
@springmeyer
springmeyer / boost 1.45, clang trunk, pch error
Created January 4, 2011 20:36
compile error when compiling boost_python app using precompiled headers that include boost
clang -cc1 version 2.9 based upon llvm 2.9svn hosted on x86_64-apple-darwin10
ignoring duplicate directory "/usr/local/include"
as it is a non-system directory that duplicates a system directory
ignoring duplicate directory "/usr/include"
as it is a non-system directory that duplicates a system directory
#include "..." search starts here:
#include <...> search starts here:
agg/include
.
@springmeyer
springmeyer / gdb backtrace from boost python
Created November 30, 2010 21:11
solaris amd64 boost python exception translation failing
(gdb) bt
#0 0x000000000005fb0e in ?? ()
#1 0xfffffd7fff2ec5d1 in _Unwind_RaiseException_Body () from /usr/lib/amd64/libc.so.1
#2 0xfffffd7fff2ec855 in _Unwind_RaiseException () from /usr/lib/amd64/libc.so.1
#3 0xfffffd7ffa98bb39 in __cxa_throw (obj=<value optimized out>, tinfo=0x1, dest=0x474e5543432b2b00)
at ../../../../.././libstdc++-v3/libsupc++/eh_throw.cc:78
#4 0xfffffd7ff6313272 in boost::python::throw_error_already_set () from /usr/local/lib/libboost_python.so.1.45.0
#5 0xfffffd7ff5199a95 in boost::python::objects::caller_py_function_impl<boost::python::detail::caller<boost::python::objects::iterator_range<boost::python::return_value_policy<boost::python::return_by_value, boost::python::default_call_policies>, std::_Rb_tree_iterator<std::pair<std::string const, mapnik::value> > >::next, boost::python::return_value_policy<boost::python::return_by_value, boost::python::default_call_policies>, boost::mpl::vector2<std::pair<std::string const, mapnik::value>&, boost::python::objects::iterator_rang
diff --git a/src/image_util.cpp b/src/image_util.cpp
index 1718d79..0e8ed06 100644
--- a/src/image_util.cpp
+++ b/src/image_util.cpp
@@ -329,7 +329,7 @@ scaling_method_e get_scaling_method_by_name (std::string name)
}
template <typename Image>
-void scale_image_bilinear8 (Image& target,const Image& source, double x_off_f=0, double y_off_f=0)
+void scale_image_bilinear8 (Image& target,const Image& source, double x_off_f, double y_off_f)
@springmeyer
springmeyer / gist:705987
Created November 19, 2010 01:22
agg blur
diff --git a/src/image_util.cpp b/src/image_util.cpp
index ae36062..f1cace0 100644
--- a/src/image_util.cpp
+++ b/src/image_util.cpp
@@ -69,6 +69,7 @@ extern "C"
#include "agg_span_image_filter_rgba.h"
#include "agg_span_interpolator_linear.h"
#include "agg_trans_affine.h"
+#include "agg_blur.h"