Skip to content

Instantly share code, notes, and snippets.

View springmeyer's full-sized avatar

Dane Springmeyer springmeyer

View GitHub Profile
@springmeyer
springmeyer / node-srs-geojson-url.js
Last active April 12, 2016 14:44
test parsing geojson urn style crs definition
~/projects/node-srs[master]$ node
> var srs = require('srs')
// http://geojson.org/geojson-spec.html#coordinate-reference-system-objects
> srs.parse('urn:ogc:def:crs:OGC:1.3:CRS84')
{ input: 'urn:ogc:def:crs:OGC:1.3:CRS84',
proj4: '+proj=longlat +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +no_defs',
srid: 4326,
auth: 'EPSG',
pretty_wkt: 'GEOGCS["WGS 84",\n DATUM["WGS_1984",\n SPHEROID["WGS 84",6378137,298.257223563,\n AUTHORITY["EPSG","7030"]],\n TOWGS84[0,0,0,0,0,0,0],\n AUTHORITY["EPSG","6326"]],\n PRIMEM["Greenwich",0,\n AUTHORITY["EPSG","8901"]],\n UNIT["degree",0.0174532925199433,\n AUTHORITY["EPSG","9108"]],\n AUTHORITY["EPSG","4326"]]',
esri: false,
#include <iostream>
#include <sstream>
#include <vector>
#include <string>
#include <mapnik/version.hpp>
#include <mapnik/image_util.hpp>
#include <mapnik/graphics.hpp>
#include <mapnik/datasource_cache.hpp>
#include <mapnik/map.hpp>
brew install fltk
sudo pip install mercurial
hg clone http://hg.orfeo-toolbox.org/OTB
cd OTB
mkdir build
cmake \
-DBUILD_APPLICATIONS:BOOL=ON \
-DCMAKE_BUILD_TYPE:STRING=Release \
-DCMAKE_C_FLAGS:STRING=-Wall -Wno-uninitialized -Wno-unused-variable -fPIC \
@springmeyer
springmeyer / no-quant.diff
Created January 23, 2013 21:40
Fix hang in mapproxy rendering due to PIL quantize deadlock on osx by disabling quantization
diff --git a/mapproxy/image/__init__.py b/mapproxy/image/__init__.py
index b5bb73b..0c6c6ac 100644
--- a/mapproxy/image/__init__.py
+++ b/mapproxy/image/__init__.py
@@ -282,22 +282,6 @@ def img_to_buf(img, image_opts):
return buf
def quantize(img, colors=256, alpha=False, defaults=None, quantizer=None):
- if hasattr(Image, 'FASTOCTREE') and quantizer in (None, 'fastoctree'):
- if not alpha:
@springmeyer
springmeyer / test-bit-rounding.cpp
Created January 18, 2013 22:14
test rounding to 16 and 32 bit integer boundaries - output on os x 10.7: https://gist.github.com/4f5eea309fc4656b5261
#include <iostream>
/*
clang++ -o test-bit-rounding test-bit-rounding.cpp -O3 -g -Wconversion -Wsign-conversion;./test-bit-rounding
https://github.com/mapnik/mapnik/commit/e7ae5121a2551763e81aa19fe8a4db66226e829e
*/
diff --git a/src/database.cc b/src/database.cc
index 33d3992..4d4351a 100644
--- a/src/database.cc
+++ b/src/database.cc
@@ -138,7 +138,7 @@ Handle<Value> Database::New(const Arguments& args) {
void Database::Work_BeginOpen(Baton* baton) {
int status = uv_queue_work(uv_default_loop(),
- &baton->request, Work_Open, Work_AfterOpen);
+ &baton->request, Work_Open, (uv_after_work_cb)Work_AfterOpen);
diff --git a/deps/agg/include/agg_array.h b/deps/agg/include/agg_array.h
index 8d56683..9c7a447 100644
--- a/deps/agg/include/agg_array.h
+++ b/deps/agg/include/agg_array.h
@@ -513,7 +513,7 @@ namespace agg
//------------------------------------------------------------------------
template<class T, unsigned S> pod_bvector<T, S>::~pod_bvector()
{
- if(m_num_blocks)
+ if(m_num_blocks > 0)
@springmeyer
springmeyer / clang-runtime-checks.sh
Last active December 10, 2015 19:18
Using clang++ 3.x -fsanitize
# Clang runtime checks
## gochas
- The compiler_rt code must be built (if compiling llvm/clang with
cmake you need cmake > 2.8.7)
- `-fsanitize=thread` and therefore the `tsan` symbols are not available on OS X
- Missing `asan` symbols can be solved on OS X by doing:
```
export DYLD_INSERT_LIBRARIES=/opt/llvm2/lib/clang/3.3/lib/darwin/libclang_rt.asan_osx_dynamic.dylib
Visual text rendering: 7 failed / 146 passed
1) 1 different pixels:
/tmp/mapnik-visual-images/lines-shield-800-grid.json (actual)
tests/visual_tests/grids/lines-shield-800-reference.json (expected)
2) 452 different pixels:
/tmp/mapnik-visual-images/lines-shield-600-agg.png (actual)
tests/visual_tests/images/lines-shield-600-reference.png (expected)
3) 1 different pixels:
/tmp/mapnik-visual-images/lines-shield-600-grid.json (actual)
tests/visual_tests/grids/lines-shield-600-reference.json (expected)
@springmeyer
springmeyer / svg-renderer.diff
Created December 21, 2012 20:45
enable native svg renderer over cairo in mapnik python bindings
diff --git a/bindings/python/build.py b/bindings/python/build.py
index 2a83607..df6dd9d 100644
--- a/bindings/python/build.py
+++ b/bindings/python/build.py
@@ -182,6 +182,9 @@ if 'uninstall' not in COMMAND_LINE_TARGETS:
py_env.ParseConfig('pkg-config --cflags pycairo')
py_env.Append(CXXFLAGS = '-DHAVE_PYCAIRO')
+ if env['SVG_RENDERER']:
+ py_env.Append(CXXFLAGS = '-DSVG_RENDERER')